avutil/pixfmt: add UYVA pixel format

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

Signed-off-by: James Almer <jamrial@gmail.com>
pull/153/merge
James Almer 1 month ago
parent 263108a504
commit dc3ef53819
  1. 13
      libavutil/pixdesc.c
  2. 2
      libavutil/pixfmt.h
  3. 1
      libavutil/tests/pixfmt_best.c
  4. 2
      tests/ref/fate/imgutils
  5. 2
      tests/ref/fate/pixfmt_best
  6. 3
      tests/ref/fate/sws-pixdesc-query

@ -2119,6 +2119,19 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.name = "cuda",
.flags = AV_PIX_FMT_FLAG_HWACCEL,
},
[AV_PIX_FMT_UYVA] = {
.name = "uyva",
.nb_components = 4,
.log2_chroma_w = 0,
.log2_chroma_h = 0,
.comp = {
{ 0, 4, 1, 0, 8 }, /* Y */
{ 0, 4, 0, 0, 8 }, /* U */
{ 0, 4, 2, 0, 8 }, /* V */
{ 0, 4, 3, 0, 8 }, /* A */
},
.flags = AV_PIX_FMT_FLAG_ALPHA,
},
[AV_PIX_FMT_AYUV] = {
.name = "ayuv",
.nb_components = 4,

@ -441,6 +441,8 @@ enum AVPixelFormat {
AV_PIX_FMT_AYUV, ///< packed AYUV 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), AYUVAYUV...
AV_PIX_FMT_UYVA, ///< packed UYVA 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), UYVAUYVA...
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
};

@ -136,6 +136,7 @@ int main(void)
TEST(AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV444P);
TEST(AV_PIX_FMT_VUYA, AV_PIX_FMT_YUV444P);
TEST(AV_PIX_FMT_AYUV, AV_PIX_FMT_YUV444P);
TEST(AV_PIX_FMT_UYVA, AV_PIX_FMT_YUV444P);
TEST(AV_PIX_FMT_AYUV64, AV_PIX_FMT_YUV444P16);
TEST(AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB24);
TEST(AV_PIX_FMT_ABGR, AV_PIX_FMT_RGB24);

@ -270,6 +270,7 @@ p412le planes: 2, linesizes: 128 256 0 0, plane_sizes: 6144 12288
gbrap14be planes: 4, linesizes: 128 128 128 128, plane_sizes: 6144 6144 6144 6144, plane_offsets: 6144 6144 6144, total_size: 24576
gbrap14le planes: 4, linesizes: 128 128 128 128, plane_sizes: 6144 6144 6144 6144, plane_offsets: 6144 6144 6144, total_size: 24576
ayuv planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
uyva planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
image_fill_black tests
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
gbrap14be total_size: 24576, black_unknown_crc: 0x4ec0d987, black_tv_crc: 0x4ec0d987, black_pc_crc: 0x4ec0d987
gbrap14le total_size: 24576, black_unknown_crc: 0x13bde353, black_tv_crc: 0x13bde353, black_pc_crc: 0x13bde353
ayuv total_size: 12288, black_unknown_crc: 0xcc44368b, black_tv_crc: 0xcc44368b, black_pc_crc: 0x1e04c638
uyva total_size: 12288, black_unknown_crc: 0xdd657297, black_tv_crc: 0xdd657297, black_pc_crc: 0x0f258224

@ -1 +1 @@
107 tests passed, 0 tests failed.
108 tests passed, 0 tests failed.

@ -246,6 +246,7 @@ isYUV:
p412le
p416be
p416le
uyva
uyvy422
uyyvyy411
vuya
@ -730,6 +731,7 @@ ALPHA:
rgbaf16le
rgbaf32be
rgbaf32le
uyva
vuya
ya16be
ya16le
@ -821,6 +823,7 @@ Packed:
rgbaf32le
rgbf32be
rgbf32le
uyva
uyvy422
uyyvyy411
vuya

Loading…
Cancel
Save