History

lavu/pixfmt: add high-bit-depth semi-planar 4:2:2/4:4:4 formats

These are used by VideoToolbox hardware decoders.

rcombs committed 5 years ago

Commit b2cd1fb1 parent 4b548185 files · +169 −0Browse files

Unified · Split

5 files
  1. doc/APIchanges +3 −0
  2. libavutil/pixdesc.c +96 −0
  3. libavutil/pixfmt.h +18 −0
  4. tests/ref/fate/imgutils +8 −0
  5. tests/ref/fate/sws-pixdesc-query +44 −0
doc/APIchanges+3−0
@@ -14,6 +14,9 @@ libavutil: 2021-04-27 · 13 unmodified lines
14 14
15API changes, most recent first:15API changes, most recent first:
16 16
172021-11-22 - xxxxxxxxxx - lavu 57.9.100 - pixfmt.h
18 Add AV_PIX_FMT_P210, AV_PIX_FMT_P410, AV_PIX_FMT_P216, and AV_PIX_FMT_P416.
19
172021-11-17 - xxxxxxxxxx - lavf 57.9.100 - frame.h202021-11-17 - xxxxxxxxxx - lavf 57.9.100 - frame.h
18 Add AV_FRAME_DATA_DOVI_RPU_BUFFER.21 Add AV_FRAME_DATA_DOVI_RPU_BUFFER.
19 22
libavutil/pixdesc.c+96−0
@@ -2393,6 +2393,102 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { · 2392 unmodified lines
2393 .name = "vulkan",2393 .name = "vulkan",
2394 .flags = AV_PIX_FMT_FLAG_HWACCEL,2394 .flags = AV_PIX_FMT_FLAG_HWACCEL,
2395 },2395 },
2396 [AV_PIX_FMT_P210BE] = {
2397 .name = "p210be",
2398 .nb_components = 3,
2399 .log2_chroma_w = 1,
2400 .log2_chroma_h = 0,
2401 .comp = {
2402 { 0, 2, 0, 6, 10 }, /* Y */
2403 { 1, 4, 0, 6, 10 }, /* U */
2404 { 1, 4, 2, 6, 10 }, /* V */
2405 },
2406 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
2407 },
2408 [AV_PIX_FMT_P210LE] = {
2409 .name = "p210le",
2410 .nb_components = 3,
2411 .log2_chroma_w = 1,
2412 .log2_chroma_h = 0,
2413 .comp = {
2414 { 0, 2, 0, 6, 10 }, /* Y */
2415 { 1, 4, 0, 6, 10 }, /* U */
2416 { 1, 4, 2, 6, 10 }, /* V */
2417 },
2418 .flags = AV_PIX_FMT_FLAG_PLANAR,
2419 },
2420 [AV_PIX_FMT_P410BE] = {
2421 .name = "p410be",
2422 .nb_components = 3,
2423 .log2_chroma_w = 0,
2424 .log2_chroma_h = 0,
2425 .comp = {
2426 { 0, 2, 0, 6, 10 }, /* Y */
2427 { 1, 4, 0, 6, 10 }, /* U */
2428 { 1, 4, 2, 6, 10 }, /* V */
2429 },
2430 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
2431 },
2432 [AV_PIX_FMT_P410LE] = {
2433 .name = "p410le",
2434 .nb_components = 3,
2435 .log2_chroma_w = 0,
2436 .log2_chroma_h = 0,
2437 .comp = {
2438 { 0, 2, 0, 6, 10 }, /* Y */
2439 { 1, 4, 0, 6, 10 }, /* U */
2440 { 1, 4, 2, 6, 10 }, /* V */
2441 },
2442 .flags = AV_PIX_FMT_FLAG_PLANAR,
2443 },
2444 [AV_PIX_FMT_P216BE] = {
2445 .name = "p216be",
2446 .nb_components = 3,
2447 .log2_chroma_w = 1,
2448 .log2_chroma_h = 0,
2449 .comp = {
2450 { 0, 2, 0, 0, 16 }, /* Y */
2451 { 1, 4, 0, 0, 16 }, /* U */
2452 { 1, 4, 2, 0, 16 }, /* V */
2453 },
2454 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
2455 },
2456 [AV_PIX_FMT_P216LE] = {
2457 .name = "p216le",
2458 .nb_components = 3,
2459 .log2_chroma_w = 1,
2460 .log2_chroma_h = 0,
2461 .comp = {
2462 { 0, 2, 0, 0, 16 }, /* Y */
2463 { 1, 4, 0, 0, 16 }, /* U */
2464 { 1, 4, 2, 0, 16 }, /* V */
2465 },
2466 .flags = AV_PIX_FMT_FLAG_PLANAR,
2467 },
2468 [AV_PIX_FMT_P416BE] = {
2469 .name = "p416be",
2470 .nb_components = 3,
2471 .log2_chroma_w = 0,
2472 .log2_chroma_h = 0,
2473 .comp = {
2474 { 0, 2, 0, 0, 16 }, /* Y */
2475 { 1, 4, 0, 0, 16 }, /* U */
2476 { 1, 4, 2, 0, 16 }, /* V */
2477 },
2478 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_BE,
2479 },
2480 [AV_PIX_FMT_P416LE] = {
2481 .name = "p416le",
2482 .nb_components = 3,
2483 .log2_chroma_w = 0,
2484 .log2_chroma_h = 0,
2485 .comp = {
2486 { 0, 2, 0, 0, 16 }, /* Y */
2487 { 1, 4, 0, 0, 16 }, /* U */
2488 { 1, 4, 2, 0, 16 }, /* V */
2489 },
2490 .flags = AV_PIX_FMT_FLAG_PLANAR,
2491 },
2396};2492};
2397 2493
2398static const char * const color_range_names[] = {2494static const char * const color_range_names[] = {
libavutil/pixfmt.h+18−0
@@ -352,6 +352,19 @@ enum AVPixelFormat { · 351 unmodified lines
352 AV_PIX_FMT_X2RGB10BE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), big-endian, X=unused/undefined352 AV_PIX_FMT_X2RGB10BE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), big-endian, X=unused/undefined
353 AV_PIX_FMT_X2BGR10LE, ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), little-endian, X=unused/undefined353 AV_PIX_FMT_X2BGR10LE, ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), little-endian, X=unused/undefined
354 AV_PIX_FMT_X2BGR10BE, ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), big-endian, X=unused/undefined354 AV_PIX_FMT_X2BGR10BE, ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), big-endian, X=unused/undefined
355
356 AV_PIX_FMT_P210BE, ///< interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, big-endian
357 AV_PIX_FMT_P210LE, ///< interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, little-endian
358
359 AV_PIX_FMT_P410BE, ///< interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, big-endian
360 AV_PIX_FMT_P410LE, ///< interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, little-endian
361
362 AV_PIX_FMT_P216BE, ///< interleaved chroma YUV 4:2:2, 32bpp, big-endian
363 AV_PIX_FMT_P216LE, ///< interleaved chroma YUV 4:2:2, 32bpp, liddle-endian
364
365 AV_PIX_FMT_P416BE, ///< interleaved chroma YUV 4:4:4, 48bpp, big-endian
366 AV_PIX_FMT_P416LE, ///< interleaved chroma YUV 4:4:4, 48bpp, little-endian
367
355 AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions368 AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
356};369};
357 370
@@ -444,6 +457,11 @@ enum AVPixelFormat { · 86 unmodified lines
444#define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE)457#define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE)
445#define AV_PIX_FMT_X2BGR10 AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE)458#define AV_PIX_FMT_X2BGR10 AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE)
446 459
460#define AV_PIX_FMT_P210 AV_PIX_FMT_NE(P210BE, P210LE)
461#define AV_PIX_FMT_P410 AV_PIX_FMT_NE(P410BE, P410LE)
462#define AV_PIX_FMT_P216 AV_PIX_FMT_NE(P216BE, P216LE)
463#define AV_PIX_FMT_P416 AV_PIX_FMT_NE(P416BE, P416LE)
464
447/**465/**
448 * Chromaticity coordinates of the source primaries.466 * Chromaticity coordinates of the source primaries.
449 * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and ITU-T H.273.467 * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and ITU-T H.273.
tests/ref/fate/imgutils+8−0
@@ -238,3 +238,11 @@ x2rgb10le planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 · 237 unmodified lines
238x2rgb10be planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288238x2rgb10be planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
239x2bgr10le planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288239x2bgr10le planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
240x2bgr10be planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288240x2bgr10be planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
241p210be planes: 2, linesizes: 128 128 0 0, plane_sizes: 6144 6144 0 0, plane_offsets: 6144 0 0, total_size: 12288
242p210le planes: 2, linesizes: 128 128 0 0, plane_sizes: 6144 6144 0 0, plane_offsets: 6144 0 0, total_size: 12288
243p410be planes: 2, linesizes: 128 256 0 0, plane_sizes: 6144 12288 0 0, plane_offsets: 6144 0 0, total_size: 18432
244p410le planes: 2, linesizes: 128 256 0 0, plane_sizes: 6144 12288 0 0, plane_offsets: 6144 0 0, total_size: 18432
245p216be planes: 2, linesizes: 128 128 0 0, plane_sizes: 6144 6144 0 0, plane_offsets: 6144 0 0, total_size: 12288
246p216le planes: 2, linesizes: 128 128 0 0, plane_sizes: 6144 6144 0 0, plane_offsets: 6144 0 0, total_size: 12288
247p416be planes: 2, linesizes: 128 256 0 0, plane_sizes: 6144 12288 0 0, plane_offsets: 6144 0 0, total_size: 18432
248p416le planes: 2, linesizes: 128 256 0 0, plane_sizes: 6144 12288 0 0, plane_offsets: 6144 0 0, total_size: 18432
tests/ref/fate/sws-pixdesc-query+44−0
@@ -13,6 +13,10 @@ is16BPS: · 12 unmodified lines
13 gray16le13 gray16le
14 p016be14 p016be
15 p016le15 p016le
16 p216be
17 p216le
18 p416be
19 p416le
16 rgb48be20 rgb48be
17 rgb48le21 rgb48le
18 rgba64be22 rgba64be
@@ -57,6 +61,10 @@ isNBPS: · 38 unmodified lines
57 nv20le61 nv20le
58 p010be62 p010be
59 p010le63 p010le
64 p210be
65 p210le
66 p410be
67 p410le
60 x2bgr10be68 x2bgr10be
61 x2bgr10le69 x2bgr10le
62 x2rgb10be70 x2rgb10be
@@ -140,6 +148,10 @@ isBE: · 77 unmodified lines
140 nv20be148 nv20be
141 p010be149 p010be
142 p016be150 p016be
151 p210be
152 p216be
153 p410be
154 p416be
143 rgb444be155 rgb444be
144 rgb48be156 rgb48be
145 rgb555be157 rgb555be
@@ -193,6 +205,14 @@ isYUV: · 47 unmodified lines
193 p010le205 p010le
194 p016be206 p016be
195 p016le207 p016le
208 p210be
209 p210le
210 p216be
211 p216le
212 p410be
213 p410le
214 p416be
215 p416le
196 uyvy422216 uyvy422
197 uyyvyy411217 uyyvyy411
198 xyz12be218 xyz12be
@@ -287,6 +307,14 @@ isPlanarYUV: · 88 unmodified lines
287 p010le307 p010le
288 p016be308 p016be
289 p016le309 p016le
310 p210be
311 p210le
312 p216be
313 p216le
314 p410be
315 p410le
316 p416be
317 p416le
290 yuv410p318 yuv410p
291 yuv411p319 yuv411p
292 yuv420p320 yuv420p
@@ -370,6 +398,14 @@ isSemiPlanarYUV: · 77 unmodified lines
370 p010le398 p010le
371 p016be399 p016be
372 p016le400 p016le
401 p210be
402 p210le
403 p216be
404 p216le
405 p410be
406 p410le
407 p416be
408 p416le
373 409
374isRGB:410isRGB:
375 0bgr411 0bgr
@@ -751,6 +787,14 @@ Planar: · 375 unmodified lines
751 p010le787 p010le
752 p016be788 p016be
753 p016le789 p016le
790 p210be
791 p210le
792 p216be
793 p216le
794 p410be
795 p410le
796 p416be
797 p416le
754 yuv410p798 yuv410p
755 yuv411p799 yuv411p
756 yuv420p800 yuv420p

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t