History

avutil/pixfmt: add UYVA pixel format

This maps to the 4444YpCbCrA8 pixel format as defined by Apple, which is ordered Cb Y' Cr A.

James Almer committed 2 years ago

Commit dc3ef531 parent 263108a6 files · +22 −1Browse files

Unified · Split

6 files
  1. libavutil/pixdesc.c +13 −0
  2. libavutil/pixfmt.h +2 −0
  3. libavutil/tests/pixfmt_best.c +1 −0
  4. tests/ref/fate/imgutils +2 −0
  5. tests/ref/fate/pixfmt_best +1 −1
  6. tests/ref/fate/sws-pixdesc-query +3 −0
libavutil/pixdesc.c+13−0
@@ -2119,6 +2119,19 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { · 2118 unmodified lines
2119 .name = "cuda",2119 .name = "cuda",
2120 .flags = AV_PIX_FMT_FLAG_HWACCEL,2120 .flags = AV_PIX_FMT_FLAG_HWACCEL,
2121 },2121 },
2122 [AV_PIX_FMT_UYVA] = {
2123 .name = "uyva",
2124 .nb_components = 4,
2125 .log2_chroma_w = 0,
2126 .log2_chroma_h = 0,
2127 .comp = {
2128 { 0, 4, 1, 0, 8 }, /* Y */
2129 { 0, 4, 0, 0, 8 }, /* U */
2130 { 0, 4, 2, 0, 8 }, /* V */
2131 { 0, 4, 3, 0, 8 }, /* A */
2132 },
2133 .flags = AV_PIX_FMT_FLAG_ALPHA,
2134 },
2122 [AV_PIX_FMT_AYUV] = {2135 [AV_PIX_FMT_AYUV] = {
2123 .name = "ayuv",2136 .name = "ayuv",
2124 .nb_components = 4,2137 .nb_components = 4,
libavutil/pixfmt.h+2−0
@@ -441,6 +441,8 @@ enum AVPixelFormat { · 440 unmodified lines
441 441
442 AV_PIX_FMT_AYUV, ///< packed AYUV 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), AYUVAYUV...442 AV_PIX_FMT_AYUV, ///< packed AYUV 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), AYUVAYUV...
443 443
444 AV_PIX_FMT_UYVA, ///< packed UYVA 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), UYVAUYVA...
445
444 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 versions446 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
445};447};
446 448
libavutil/tests/pixfmt_best.c+1−0
@@ -136,6 +136,7 @@ int main(void) · 135 unmodified lines
136 TEST(AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P);136 TEST(AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P);
137 TEST(AV_PIX_FMT_VUYA, AV_PIX_FMT_YUV444P);137 TEST(AV_PIX_FMT_VUYA, AV_PIX_FMT_YUV444P);
138 TEST(AV_PIX_FMT_AYUV, AV_PIX_FMT_YUV444P);138 TEST(AV_PIX_FMT_AYUV, AV_PIX_FMT_YUV444P);
139 TEST(AV_PIX_FMT_UYVA, AV_PIX_FMT_YUV444P);
139 TEST(AV_PIX_FMT_AYUV64, AV_PIX_FMT_YUV444P16);140 TEST(AV_PIX_FMT_AYUV64, AV_PIX_FMT_YUV444P16);
140 TEST(AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB24);141 TEST(AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB24);
141 TEST(AV_PIX_FMT_ABGR, AV_PIX_FMT_RGB24);142 TEST(AV_PIX_FMT_ABGR, AV_PIX_FMT_RGB24);
tests/ref/fate/imgutils+2−0
@@ -270,6 +270,7 @@ p412le planes: 2, linesizes: 128 256 0 0, plane_sizes: 6144 12288 · 269 unmodified lines
270gbrap14be planes: 4, linesizes: 128 128 128 128, plane_sizes: 6144 6144 6144 6144, plane_offsets: 6144 6144 6144, total_size: 24576270gbrap14be planes: 4, linesizes: 128 128 128 128, plane_sizes: 6144 6144 6144 6144, plane_offsets: 6144 6144 6144, total_size: 24576
271gbrap14le planes: 4, linesizes: 128 128 128 128, plane_sizes: 6144 6144 6144 6144, plane_offsets: 6144 6144 6144, total_size: 24576271gbrap14le planes: 4, linesizes: 128 128 128 128, plane_sizes: 6144 6144 6144 6144, plane_offsets: 6144 6144 6144, total_size: 24576
272ayuv planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288272ayuv planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
273uyva planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
273 274
274image_fill_black tests275image_fill_black tests
275yuv420p total_size: 4608, black_unknown_crc: 0xd00f6cc6, black_tv_crc: 0xd00f6cc6, black_pc_crc: 0x234969af276yuv420p total_size: 4608, black_unknown_crc: 0xd00f6cc6, black_tv_crc: 0xd00f6cc6, black_pc_crc: 0x234969af
@@ -487,3 +488,4 @@ p412le total_size: 18432, black_unknown_crc: 0x4028ac30, black_tv_cr · 211 unmodified lines
487gbrap14be total_size: 24576, black_unknown_crc: 0x4ec0d987, black_tv_crc: 0x4ec0d987, black_pc_crc: 0x4ec0d987488gbrap14be total_size: 24576, black_unknown_crc: 0x4ec0d987, black_tv_crc: 0x4ec0d987, black_pc_crc: 0x4ec0d987
488gbrap14le total_size: 24576, black_unknown_crc: 0x13bde353, black_tv_crc: 0x13bde353, black_pc_crc: 0x13bde353489gbrap14le total_size: 24576, black_unknown_crc: 0x13bde353, black_tv_crc: 0x13bde353, black_pc_crc: 0x13bde353
489ayuv total_size: 12288, black_unknown_crc: 0xcc44368b, black_tv_crc: 0xcc44368b, black_pc_crc: 0x1e04c638490ayuv total_size: 12288, black_unknown_crc: 0xcc44368b, black_tv_crc: 0xcc44368b, black_pc_crc: 0x1e04c638
491uyva total_size: 12288, black_unknown_crc: 0xdd657297, black_tv_crc: 0xdd657297, black_pc_crc: 0x0f258224
tests/ref/fate/pixfmt_best+1−1
@@ -1 +1 @@
1107 tests passed, 0 tests failed.1108 tests passed, 0 tests failed.
tests/ref/fate/sws-pixdesc-query+3−0
@@ -246,6 +246,7 @@ isYUV: · 245 unmodified lines
246 p412le246 p412le
247 p416be247 p416be
248 p416le248 p416le
249 uyva
249 uyvy422250 uyvy422
250 uyyvyy411251 uyyvyy411
251 vuya252 vuya
@@ -730,6 +731,7 @@ ALPHA: · 478 unmodified lines
730 rgbaf16le731 rgbaf16le
731 rgbaf32be732 rgbaf32be
732 rgbaf32le733 rgbaf32le
734 uyva
733 vuya735 vuya
734 ya16be736 ya16be
735 ya16le737 ya16le
@@ -821,6 +823,7 @@ Packed: · 85 unmodified lines
821 rgbaf32le823 rgbaf32le
822 rgbf32be824 rgbf32be
823 rgbf32le825 rgbf32le
826 uyva
824 uyvy422827 uyvy422
825 uyyvyy411828 uyyvyy411
826 vuya829 vuya

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