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
1414
1515 API changes, most recent first:
1616
17+2021-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+
1720 2021-11-17 - xxxxxxxxxx - lavf 57.9.100 - frame.h
1821 Add AV_FRAME_DATA_DOVI_RPU_BUFFER.
1922
libavutil/pixdesc.c+96−0
@@ -2393,6 +2393,102 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { · 2392 unmodified lines
23932393 .name = "vulkan",
23942394 .flags = AV_PIX_FMT_FLAG_HWACCEL,
23952395 },
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+ },
23962492 };
23972493
23982494 static const char * const color_range_names[] = {
libavutil/pixfmt.h+18−0
@@ -352,6 +352,19 @@ enum AVPixelFormat { · 351 unmodified lines
352352 AV_PIX_FMT_X2RGB10BE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), big-endian, X=unused/undefined
353353 AV_PIX_FMT_X2BGR10LE, ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), little-endian, X=unused/undefined
354354 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+
355368 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
356369 };
357370
@@ -444,6 +457,11 @@ enum AVPixelFormat { · 86 unmodified lines
444457 #define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE)
445458 #define AV_PIX_FMT_X2BGR10 AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE)
446459
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+
447465 /**
448466 * Chromaticity coordinates of the source primaries.
449467 * 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
238238 x2rgb10be planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
239239 x2bgr10le planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
240240 x2bgr10be planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
241+p210be planes: 2, linesizes: 128 128 0 0, plane_sizes: 6144 6144 0 0, plane_offsets: 6144 0 0, total_size: 12288
242+p210le planes: 2, linesizes: 128 128 0 0, plane_sizes: 6144 6144 0 0, plane_offsets: 6144 0 0, total_size: 12288
243+p410be planes: 2, linesizes: 128 256 0 0, plane_sizes: 6144 12288 0 0, plane_offsets: 6144 0 0, total_size: 18432
244+p410le planes: 2, linesizes: 128 256 0 0, plane_sizes: 6144 12288 0 0, plane_offsets: 6144 0 0, total_size: 18432
245+p216be planes: 2, linesizes: 128 128 0 0, plane_sizes: 6144 6144 0 0, plane_offsets: 6144 0 0, total_size: 12288
246+p216le planes: 2, linesizes: 128 128 0 0, plane_sizes: 6144 6144 0 0, plane_offsets: 6144 0 0, total_size: 12288
247+p416be planes: 2, linesizes: 128 256 0 0, plane_sizes: 6144 12288 0 0, plane_offsets: 6144 0 0, total_size: 18432
248+p416le 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
1313 gray16le
1414 p016be
1515 p016le
16+ p216be
17+ p216le
18+ p416be
19+ p416le
1620 rgb48be
1721 rgb48le
1822 rgba64be
@@ -57,6 +61,10 @@ isNBPS: · 38 unmodified lines
5761 nv20le
5862 p010be
5963 p010le
64+ p210be
65+ p210le
66+ p410be
67+ p410le
6068 x2bgr10be
6169 x2bgr10le
6270 x2rgb10be
@@ -140,6 +148,10 @@ isBE: · 77 unmodified lines
140148 nv20be
141149 p010be
142150 p016be
151+ p210be
152+ p216be
153+ p410be
154+ p416be
143155 rgb444be
144156 rgb48be
145157 rgb555be
@@ -193,6 +205,14 @@ isYUV: · 47 unmodified lines
193205 p010le
194206 p016be
195207 p016le
208+ p210be
209+ p210le
210+ p216be
211+ p216le
212+ p410be
213+ p410le
214+ p416be
215+ p416le
196216 uyvy422
197217 uyyvyy411
198218 xyz12be
@@ -287,6 +307,14 @@ isPlanarYUV: · 88 unmodified lines
287307 p010le
288308 p016be
289309 p016le
310+ p210be
311+ p210le
312+ p216be
313+ p216le
314+ p410be
315+ p410le
316+ p416be
317+ p416le
290318 yuv410p
291319 yuv411p
292320 yuv420p
@@ -370,6 +398,14 @@ isSemiPlanarYUV: · 77 unmodified lines
370398 p010le
371399 p016be
372400 p016le
401+ p210be
402+ p210le
403+ p216be
404+ p216le
405+ p410be
406+ p410le
407+ p416be
408+ p416le
373409
374410 isRGB:
375411 0bgr
@@ -751,6 +787,14 @@ Planar: · 375 unmodified lines
751787 p010le
752788 p016be
753789 p016le
790+ p210be
791+ p210le
792+ p216be
793+ p216le
794+ p410be
795+ p410le
796+ p416be
797+ p416le
754798 yuv410p
755799 yuv411p
756800 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