ffmpeg | branch: master | Lynne <d...@lynne.ee> | Mon Mar 10 16:40:04 2025 
+0000| [49af9746e8f6b65f0a3981c749af5a97194d6849] | committer: Lynne

pixfmt: add AV_PIX_FMT_GBRAP32

This commit adds a 32-bit *integer* planar RGBA format.
Vulkan FFv1 decoding is best performed on separate planes, rather than
packed RGBA (i.e. RGBA128), hence this is useful as an intermediate format.

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

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

diff --git a/doc/APIchanges b/doc/APIchanges
index 7da9297b01..c7127bf8ed 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07
 
 API changes, most recent first:
 
+2025-03-17 - xxxxxxxxxx - lavu 59.60.100 - pixfmt.h
+  Add AV_PIX_FMT_GBRAP32BE and AV_PIX_FMT_GBRAP32LE.
+
 2025-03-10 - xxxxxxxxxx - lavu 59.59.100 - pixfmt.h
   Add AV_PIX_FMT_YAF16BE, AV_PIX_FMT_YAF16LE, AV_PIX_FMT_YAF32BE,
   and AV_PIX_FMT_YAF32LE.
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 1917ae74d8..53adde5aba 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1991,6 +1991,34 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
         .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
                  AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
     },
+    [AV_PIX_FMT_GBRAP32LE] = {
+        .name = "gbrap32le",
+        .nb_components = 4,
+        .log2_chroma_w = 0,
+        .log2_chroma_h = 0,
+        .comp = {
+            { 2, 4, 0, 0, 32 },       /* R */
+            { 0, 4, 0, 0, 32 },       /* G */
+            { 1, 4, 0, 0, 32 },       /* B */
+            { 3, 4, 0, 0, 32 },       /* A */
+        },
+        .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB |
+                 AV_PIX_FMT_FLAG_ALPHA,
+    },
+    [AV_PIX_FMT_GBRAP32BE] = {
+        .name = "gbrap32be",
+        .nb_components = 4,
+        .log2_chroma_w = 0,
+        .log2_chroma_h = 0,
+        .comp = {
+            { 2, 4, 0, 0, 32 },       /* R */
+            { 0, 4, 0, 0, 32 },       /* G */
+            { 1, 4, 0, 0, 32 },       /* B */
+            { 3, 4, 0, 0, 32 },       /* A */
+        },
+        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
+                 AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
+    },
     [AV_PIX_FMT_VDPAU] = {
         .name = "vdpau",
         .log2_chroma_w = 1,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index e6d2b08c5c..bf1b8ed008 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -485,6 +485,9 @@ enum AVPixelFormat {
     AV_PIX_FMT_YAF16BE,  ///< IEEE-754 half precision packed YA, 16 bits gray, 
16 bits alpha, 32bpp, big-endian
     AV_PIX_FMT_YAF16LE,  ///< IEEE-754 half precision packed YA, 16 bits gray, 
16 bits alpha, 32bpp, little-endian
 
+    AV_PIX_FMT_GBRAP32BE,   ///< planar GBRA 4:4:4:4 128bpp, big-endian
+    AV_PIX_FMT_GBRAP32LE,   ///< planar GBRA 4:4:4:4 128bpp, 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
 };
 
@@ -546,6 +549,7 @@ enum AVPixelFormat {
 #define AV_PIX_FMT_GBRAP12   AV_PIX_FMT_NE(GBRAP12BE,   GBRAP12LE)
 #define AV_PIX_FMT_GBRAP14   AV_PIX_FMT_NE(GBRAP14BE,   GBRAP14LE)
 #define AV_PIX_FMT_GBRAP16   AV_PIX_FMT_NE(GBRAP16BE,   GBRAP16LE)
+#define AV_PIX_FMT_GBRAP32   AV_PIX_FMT_NE(GBRAP32BE,   GBRAP32LE)
 
 #define AV_PIX_FMT_BAYER_BGGR16 AV_PIX_FMT_NE(BAYER_BGGR16BE,    
BAYER_BGGR16LE)
 #define AV_PIX_FMT_BAYER_RGGB16 AV_PIX_FMT_NE(BAYER_RGGB16BE,    
BAYER_RGGB16LE)
diff --git a/libavutil/version.h b/libavutil/version.h
index b6467e2a6d..b937936032 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  59
-#define LIBAVUTIL_VERSION_MINOR  59
+#define LIBAVUTIL_VERSION_MINOR  60
 #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 79e31e80ac..c67ac35f44 100644
--- a/tests/ref/fate/imgutils
+++ b/tests/ref/fate/imgutils
@@ -296,6 +296,8 @@ yaf32be         planes: 1, linesizes: 512   0   0   0, 
plane_sizes: 24576     0
 yaf32le         planes: 1, linesizes: 512   0   0   0, plane_sizes: 24576     
0     0     0, plane_offsets:     0     0     0, total_size: 24576
 yaf16be         planes: 1, linesizes: 256   0   0   0, plane_sizes: 12288     
0     0     0, plane_offsets:     0     0     0, total_size: 12288
 yaf16le         planes: 1, linesizes: 256   0   0   0, plane_sizes: 12288     
0     0     0, plane_offsets:     0     0     0, total_size: 12288
+gbrap32be       planes: 4, linesizes: 256 256 256 256, plane_sizes: 12288 
12288 12288 12288, plane_offsets: 12288 12288 12288, total_size: 49152
+gbrap32le       planes: 4, linesizes: 256 256 256 256, plane_sizes: 12288 
12288 12288 12288, plane_offsets: 12288 12288 12288, total_size: 49152
 
 image_fill_black tests
 yuv420p         total_size:   4608,  black_unknown_crc: 0xd00f6cc6,  
black_tv_crc: 0xd00f6cc6,  black_pc_crc: 0x234969af
@@ -539,3 +541,5 @@ yaf32be         total_size:  24576,  black_unknown_crc: 
0xa3dc1529,  black_tv_cr
 yaf32le         total_size:  24576,  black_unknown_crc: 0xfd900236,  
black_tv_crc: 0xfd900236,  black_pc_crc: 0xdcaf0cb1
 yaf16be         total_size:  12288,  black_unknown_crc: 0x7afe9aae,  
black_tv_crc: 0x7afe9aae,  black_pc_crc: 0x0fc0a5d0
 yaf16le         total_size:  12288,  black_unknown_crc: 0x94c0068b,  
black_tv_crc: 0x94c0068b,  black_pc_crc: 0xc05ce449
+gbrap32be       total_size:  49152,  black_unknown_crc: 0x7bd30c95,  
black_tv_crc: 0x7bd30c95,  black_pc_crc: 0x7bd30c95
+gbrap32le       total_size:  49152,  black_unknown_crc: 0x7bd30c95,  
black_tv_crc: 0x7bd30c95,  black_pc_crc: 0x7bd30c95
diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query
index 426794b7f2..6b1a97ec00 100644
--- a/tests/ref/fate/sws-pixdesc-query
+++ b/tests/ref/fate/sws-pixdesc-query
@@ -165,6 +165,7 @@ isBE:
   gbrap12be
   gbrap14be
   gbrap16be
+  gbrap32be
   gbrapf16be
   gbrapf32be
   gbrp10be
@@ -541,6 +542,8 @@ isRGB:
   gbrap14le
   gbrap16be
   gbrap16le
+  gbrap32be
+  gbrap32le
   gbrapf16be
   gbrapf16le
   gbrapf32be
@@ -715,6 +718,8 @@ AnyRGB:
   gbrap14le
   gbrap16be
   gbrap16le
+  gbrap32be
+  gbrap32le
   gbrapf16be
   gbrapf16le
   gbrapf32be
@@ -787,6 +792,8 @@ ALPHA:
   gbrap14le
   gbrap16be
   gbrap16le
+  gbrap32be
+  gbrap32le
   gbrapf16be
   gbrapf16le
   gbrapf32be
@@ -950,6 +957,8 @@ Planar:
   gbrap14le
   gbrap16be
   gbrap16le
+  gbrap32be
+  gbrap32le
   gbrapf16be
   gbrapf16le
   gbrapf32be
@@ -1141,6 +1150,8 @@ PlanarRGB:
   gbrap14le
   gbrap16be
   gbrap16le
+  gbrap32be
+  gbrap32le
   gbrapf16be
   gbrapf16le
   gbrapf32be

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to