aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2024-10-06 23:58:46 -0300
committerJames Almer <jamrial@gmail.com>2024-10-08 14:10:07 -0300
commit1f9424e0b1d17257186d0a3b68a750b9bd341f23 (patch)
treeee3fb63bf1301ef7a2fed6e9cdbe0e90033d65e2
parentdc3ef53819dc8cc2e9732b70d69b029738bad266 (diff)
downloadffmpeg-1f9424e0b1d17257186d0a3b68a750b9bd341f23.tar.gz
avutil/pixfmt: add VYU444 pixel format
This maps to the 444YpCbCr8 pixel format as defined by Apple, which is ordered Cr Y' Cb. Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavutil/pixdesc.c11
-rw-r--r--libavutil/pixfmt.h2
-rw-r--r--libavutil/tests/pixfmt_best.c1
-rw-r--r--tests/ref/fate/imgutils2
-rw-r--r--tests/ref/fate/pixfmt_best2
-rw-r--r--tests/ref/fate/sws-pixdesc-query3
6 files changed, 20 insertions, 1 deletions
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index ab336433da..deff74d8a6 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2119,6 +2119,17 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
.name = "cuda",
.flags = AV_PIX_FMT_FLAG_HWACCEL,
},
+ [AV_PIX_FMT_VYU444] = {
+ .name = "vyu444",
+ .nb_components = 3,
+ .log2_chroma_w = 0,
+ .log2_chroma_h = 0,
+ .comp = {
+ { 0, 3, 1, 0, 8 }, /* Y */
+ { 0, 3, 2, 0, 8 }, /* U */
+ { 0, 3, 0, 0, 8 }, /* V */
+ },
+ },
[AV_PIX_FMT_UYVA] = {
.name = "uyva",
.nb_components = 4,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index bae344b535..6296ec3562 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -443,6 +443,8 @@ enum AVPixelFormat {
AV_PIX_FMT_UYVA, ///< packed UYVA 4:4:4:4, 32bpp (1 Cr & Cb sample per 1x1 Y & A samples), UYVAUYVA...
+ AV_PIX_FMT_VYU444, ///< packed VYU 4:4:4, 24bpp (1 Cr & Cb sample per 1x1 Y), VYUVYU...
+
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
};
diff --git a/libavutil/tests/pixfmt_best.c b/libavutil/tests/pixfmt_best.c
index 94666740d9..fe04e26689 100644
--- a/libavutil/tests/pixfmt_best.c
+++ b/libavutil/tests/pixfmt_best.c
@@ -121,6 +121,7 @@ int main(void)
TEST(AV_PIX_FMT_NV24, AV_PIX_FMT_YUV444P);
TEST(AV_PIX_FMT_YUYV422, AV_PIX_FMT_YUV422P);
TEST(AV_PIX_FMT_UYVY422, AV_PIX_FMT_YUV422P);
+ TEST(AV_PIX_FMT_VYU444, AV_PIX_FMT_YUV444P);
TEST(AV_PIX_FMT_BGR565, AV_PIX_FMT_RGB565);
TEST(AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24);
TEST(AV_PIX_FMT_GBRP, AV_PIX_FMT_RGB24);
diff --git a/tests/ref/fate/imgutils b/tests/ref/fate/imgutils
index 03121e45fe..4197005a3f 100644
--- a/tests/ref/fate/imgutils
+++ b/tests/ref/fate/imgutils
@@ -271,6 +271,7 @@ gbrap14be planes: 4, linesizes: 128 128 128 128, plane_sizes: 6144 6144
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
+vyu444 planes: 1, linesizes: 192 0 0 0, plane_sizes: 9216 0 0 0, plane_offsets: 0 0 0, total_size: 9216
image_fill_black tests
yuv420p total_size: 4608, black_unknown_crc: 0xd00f6cc6, black_tv_crc: 0xd00f6cc6, black_pc_crc: 0x234969af
@@ -489,3 +490,4 @@ gbrap14be total_size: 24576, black_unknown_crc: 0x4ec0d987, black_tv_cr
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
+vyu444 total_size: 9216, black_unknown_crc: 0x575e6fb1, black_tv_crc: 0x575e6fb1, black_pc_crc: 0x16564599
diff --git a/tests/ref/fate/pixfmt_best b/tests/ref/fate/pixfmt_best
index 3a2ba35238..72486587c6 100644
--- a/tests/ref/fate/pixfmt_best
+++ b/tests/ref/fate/pixfmt_best
@@ -1 +1 @@
-108 tests passed, 0 tests failed.
+109 tests passed, 0 tests failed.
diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query
index 8b7f7875f4..e1b2ac999a 100644
--- a/tests/ref/fate/sws-pixdesc-query
+++ b/tests/ref/fate/sws-pixdesc-query
@@ -251,6 +251,7 @@ isYUV:
uyyvyy411
vuya
vuyx
+ vyu444
xv30be
xv30le
xv36be
@@ -828,6 +829,7 @@ Packed:
uyyvyy411
vuya
vuyx
+ vyu444
x2bgr10be
x2bgr10le
x2rgb10be
@@ -1090,5 +1092,6 @@ SwappedChroma:
nv42
vuya
vuyx
+ vyu444
yvyu422