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
21192119 .name = "cuda",
21202120 .flags = AV_PIX_FMT_FLAG_HWACCEL,
21212121 },
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+ },
21222135 [AV_PIX_FMT_AYUV] = {
21232136 .name = "ayuv",
21242137 .nb_components = 4,
libavutil/pixfmt.h+2−0
@@ -441,6 +441,8 @@ enum AVPixelFormat { · 440 unmodified lines
441441
442442 AV_PIX_FMT_AYUV, ///< packed AYUV 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), AYUVAYUV...
443443
444+ AV_PIX_FMT_UYVA, ///< packed UYVA 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), UYVAUYVA...
445+
444446 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
445447 };
446448
libavutil/tests/pixfmt_best.c+1−0
@@ -136,6 +136,7 @@ int main(void) · 135 unmodified lines
136136 TEST(AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P);
137137 TEST(AV_PIX_FMT_VUYA, AV_PIX_FMT_YUV444P);
138138 TEST(AV_PIX_FMT_AYUV, AV_PIX_FMT_YUV444P);
139+ TEST(AV_PIX_FMT_UYVA, AV_PIX_FMT_YUV444P);
139140 TEST(AV_PIX_FMT_AYUV64, AV_PIX_FMT_YUV444P16);
140141 TEST(AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB24);
141142 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
270270 gbrap14be planes: 4, linesizes: 128 128 128 128, plane_sizes: 6144 6144 6144 6144, plane_offsets: 6144 6144 6144, total_size: 24576
271271 gbrap14le planes: 4, linesizes: 128 128 128 128, plane_sizes: 6144 6144 6144 6144, plane_offsets: 6144 6144 6144, total_size: 24576
272272 ayuv planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
273+uyva planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
273274
274275 image_fill_black tests
275276 yuv420p 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
487488 gbrap14be total_size: 24576, black_unknown_crc: 0x4ec0d987, black_tv_crc: 0x4ec0d987, black_pc_crc: 0x4ec0d987
488489 gbrap14le total_size: 24576, black_unknown_crc: 0x13bde353, black_tv_crc: 0x13bde353, black_pc_crc: 0x13bde353
489490 ayuv total_size: 12288, black_unknown_crc: 0xcc44368b, black_tv_crc: 0xcc44368b, black_pc_crc: 0x1e04c638
491+uyva total_size: 12288, black_unknown_crc: 0xdd657297, black_tv_crc: 0xdd657297, black_pc_crc: 0x0f258224
tests/ref/fate/pixfmt_best+1−1
@@ -1 +1 @@
1−107 tests passed, 0 tests failed.
1+108 tests passed, 0 tests failed.
tests/ref/fate/sws-pixdesc-query+3−0
@@ -246,6 +246,7 @@ isYUV: · 245 unmodified lines
246246 p412le
247247 p416be
248248 p416le
249+ uyva
249250 uyvy422
250251 uyyvyy411
251252 vuya
@@ -730,6 +731,7 @@ ALPHA: · 478 unmodified lines
730731 rgbaf16le
731732 rgbaf32be
732733 rgbaf32le
734+ uyva
733735 vuya
734736 ya16be
735737 ya16le
@@ -821,6 +823,7 @@ Packed: · 85 unmodified lines
821823 rgbaf32le
822824 rgbf32be
823825 rgbf32le
826+ uyva
824827 uyvy422
825828 uyyvyy411
826829 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