[FFmpeg-cvslog] avutil/pixfmt: add V30X pixel format

James Almer git at videolan.org
Wed Oct 9 01:49:14 EEST 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon Oct  7 13:29:25 2024 -0300| [29ea34728f1064877a0ab9b8dee0f3de69a2d750] | committer: James Almer

avutil/pixfmt: add V30X pixel format

This maps to the 444YpCbCr10 pixel format as defined by Apple.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=29ea34728f1064877a0ab9b8dee0f3de69a2d750
---

 doc/APIchanges                   |  4 ++++
 libavutil/pixdesc.c              | 23 +++++++++++++++++++++++
 libavutil/pixfmt.h               |  4 ++++
 libavutil/version.h              |  2 +-
 tests/ref/fate/imgutils          |  4 ++++
 tests/ref/fate/sws-pixdesc-query |  7 +++++++
 6 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index d132dfab81..5bfb52c09a 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2024-03-07
 
 API changes, most recent first:
 
+2024-10-08 - xxxxxxxxxx - lavu 59.42.100 - pixfmt.h
+  Add AV_PIX_FMT_AYUV, AV_PIX_FMT_UYVA, AV_PIX_FMT_VYU444,
+  and AV_PIX_FMT_V30X.
+
 2024-10-xx - xxxxxxxxxx - lavu 59.41.100 - log.h
   Add AVClass.state_flags_offset and AV_CLASS_STATE_INITIALIZED.
 
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index deff74d8a6..f8d6055084 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2727,6 +2727,29 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
         },
         .flags = AV_PIX_FMT_FLAG_BE,
     },
+    [AV_PIX_FMT_V30XLE] = {
+        .name = "v30xle",
+        .nb_components = 3,
+        .log2_chroma_w = 0,
+        .log2_chroma_h = 0,
+        .comp = {
+            { 0, 4, 1, 4, 10 },       /* Y */
+            { 0, 4, 0, 2, 10 },       /* U */
+            { 0, 4, 2, 6, 10 },       /* V */
+        },
+    },
+    [AV_PIX_FMT_V30XBE] = {
+        .name = "v30xbe",
+        .nb_components= 3,
+        .log2_chroma_w= 0,
+        .log2_chroma_h= 0,
+        .comp = {
+            { 0, 32, 12, 0, 10 },     /* Y */
+            { 0, 32,  2, 0, 10 },     /* U */
+            { 0, 32, 22, 0, 10 },     /* V */
+        },
+        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_BITSTREAM,
+    },
     [AV_PIX_FMT_RGBF32BE] = {
         .name = "rgbf32be",
         .nb_components = 3,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 6296ec3562..3caa183ba0 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -445,6 +445,9 @@ enum AVPixelFormat {
 
     AV_PIX_FMT_VYU444,      ///< packed VYU 4:4:4, 24bpp (1 Cr & Cb sample per 1x1 Y), VYUVYU...
 
+    AV_PIX_FMT_V30XBE,      ///< packed VYUX 4:4:4 like XV30, 32bpp, (msb)10V 10Y 10U 2X(lsb), big-endian
+    AV_PIX_FMT_V30XLE,      ///< packed VYUX 4:4:4 like XV30, 32bpp, (msb)10V 10Y 10U 2X(lsb), little-endian
+
     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
 };
 
@@ -539,6 +542,7 @@ enum AVPixelFormat {
 #define AV_PIX_FMT_Y212       AV_PIX_FMT_NE(Y212BE,  Y212LE)
 #define AV_PIX_FMT_XV30       AV_PIX_FMT_NE(XV30BE,  XV30LE)
 #define AV_PIX_FMT_XV36       AV_PIX_FMT_NE(XV36BE,  XV36LE)
+#define AV_PIX_FMT_V30X       AV_PIX_FMT_NE(V30XBE,  V30XLE)
 #define AV_PIX_FMT_X2RGB10    AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE)
 #define AV_PIX_FMT_X2BGR10    AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE)
 
diff --git a/libavutil/version.h b/libavutil/version.h
index 18f1d00145..7eca46cfe4 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  59
-#define LIBAVUTIL_VERSION_MINOR  41
+#define LIBAVUTIL_VERSION_MINOR  42
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
diff --git a/tests/ref/fate/imgutils b/tests/ref/fate/imgutils
index 4197005a3f..fd5a510530 100644
--- a/tests/ref/fate/imgutils
+++ b/tests/ref/fate/imgutils
@@ -272,6 +272,8 @@ gbrap14le       planes: 4, linesizes: 128 128 128 128, plane_sizes:  6144  6144
 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
+v30xbe          planes: 1, linesizes: 256   0   0   0, plane_sizes: 12288     0     0     0, plane_offsets:     0     0     0, total_size: 12288
+v30xle          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
@@ -491,3 +493,5 @@ gbrap14le       total_size:  24576,  black_unknown_crc: 0x13bde353,  black_tv_cr
 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
+v30xbe          total_size:  12288,  black_unknown_crc: 0x7108457c,  black_tv_crc: 0x7108457c,  black_pc_crc: 0xdefcbbe0
+v30xle          total_size:  12288,  black_unknown_crc: 0xf5b3c795,  black_tv_crc: 0xf5b3c795,  black_pc_crc: 0x0b56173c
diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query
index e1b2ac999a..f153ed3169 100644
--- a/tests/ref/fate/sws-pixdesc-query
+++ b/tests/ref/fate/sws-pixdesc-query
@@ -75,6 +75,8 @@ isNBPS:
   p410le
   p412be
   p412le
+  v30xbe
+  v30xle
   x2bgr10be
   x2bgr10le
   x2rgb10be
@@ -180,6 +182,7 @@ isBE:
   rgbaf16be
   rgbaf32be
   rgbf32be
+  v30xbe
   x2bgr10be
   x2rgb10be
   xv30be
@@ -249,6 +252,8 @@ isYUV:
   uyva
   uyvy422
   uyyvyy411
+  v30xbe
+  v30xle
   vuya
   vuyx
   vyu444
@@ -827,6 +832,8 @@ Packed:
   uyva
   uyvy422
   uyyvyy411
+  v30xbe
+  v30xle
   vuya
   vuyx
   vyu444



More information about the ffmpeg-cvslog mailing list