[FFmpeg-cvslog] avutil: add RGBA single-float precision packed formats

Paul B Mahol git at videolan.org
Sun Sep 25 19:33:13 EEST 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Sep 14 14:13:06 2022 +0200| [7bb0afc245d093b065b849461a5e0361050df512] | committer: Paul B Mahol

avutil: add RGBA single-float precision packed formats

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

 libavutil/pixdesc.c              | 28 ++++++++++++++++++++++++++++
 libavutil/pixfmt.h               |  3 +++
 tests/ref/fate/imgutils          |  2 ++
 tests/ref/fate/sws-pixdesc-query | 11 +++++++++++
 4 files changed, 44 insertions(+)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 248d5f29cd..bfba414167 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2661,6 +2661,34 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
         },
         .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT,
     },
+    [AV_PIX_FMT_RGBAF32BE] = {
+        .name = "rgbaf32be",
+        .nb_components = 4,
+        .log2_chroma_w = 0,
+        .log2_chroma_h = 0,
+        .comp = {
+            { 0, 16,  0, 0, 32 },      /* R */
+            { 0, 16,  4, 0, 32 },      /* G */
+            { 0, 16,  8, 0, 32 },      /* B */
+            { 0, 16, 12, 0, 32 },      /* A */
+        },
+        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB |
+                 AV_PIX_FMT_FLAG_FLOAT | AV_PIX_FMT_FLAG_ALPHA,
+    },
+    [AV_PIX_FMT_RGBAF32LE] = {
+        .name = "rgbaf32le",
+        .nb_components = 4,
+        .log2_chroma_w = 0,
+        .log2_chroma_h = 0,
+        .comp = {
+            { 0, 16,  0, 0, 32 },      /* R */
+            { 0, 16,  4, 0, 32 },      /* G */
+            { 0, 16,  8, 0, 32 },      /* B */
+            { 0, 16, 12, 0, 32 },      /* A */
+        },
+        .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT |
+                 AV_PIX_FMT_FLAG_ALPHA,
+    },
 };
 
 static const char * const color_range_names[] = {
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 3c34d73e2c..f8b3c0514f 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -389,6 +389,9 @@ enum AVPixelFormat {
     AV_PIX_FMT_RGBF32BE,    ///< IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., big-endian
     AV_PIX_FMT_RGBF32LE,    ///< IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., little-endian
 
+    AV_PIX_FMT_RGBAF32BE,   ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., big-endian
+    AV_PIX_FMT_RGBAF32LE,   ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., 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
 };
 
diff --git a/tests/ref/fate/imgutils b/tests/ref/fate/imgutils
index 8ad5615ed8..e79ec7e4b3 100644
--- a/tests/ref/fate/imgutils
+++ b/tests/ref/fate/imgutils
@@ -260,3 +260,5 @@ xv36be          planes: 1, linesizes: 512   0   0   0, plane_sizes: 24576     0
 xv36le          planes: 1, linesizes: 512   0   0   0, plane_sizes: 24576     0     0     0, plane_offsets:     0     0     0, total_size: 24576
 rgbf32be        planes: 1, linesizes: 768   0   0   0, plane_sizes: 36864     0     0     0, plane_offsets:     0     0     0, total_size: 36864
 rgbf32le        planes: 1, linesizes: 768   0   0   0, plane_sizes: 36864     0     0     0, plane_offsets:     0     0     0, total_size: 36864
+rgbaf32be       planes: 1, linesizes: 1024   0   0   0, plane_sizes: 49152     0     0     0, plane_offsets:     0     0     0, total_size: 49152
+rgbaf32le       planes: 1, linesizes: 1024   0   0   0, plane_sizes: 49152     0     0     0, plane_offsets:     0     0     0, total_size: 49152
diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query
index e850d52d12..14156a383c 100644
--- a/tests/ref/fate/sws-pixdesc-query
+++ b/tests/ref/fate/sws-pixdesc-query
@@ -169,6 +169,7 @@ isBE:
   rgb565be
   rgba64be
   rgbaf16be
+  rgbaf32be
   rgbf32be
   x2bgr10be
   x2rgb10be
@@ -510,6 +511,8 @@ isRGB:
   rgba64le
   rgbaf16be
   rgbaf16le
+  rgbaf32be
+  rgbaf32le
   rgbf32be
   rgbf32le
   x2bgr10be
@@ -664,6 +667,8 @@ AnyRGB:
   rgba64le
   rgbaf16be
   rgbaf16le
+  rgbaf32be
+  rgbaf32le
   rgbf32be
   rgbf32le
   x2bgr10be
@@ -694,6 +699,8 @@ ALPHA:
   rgba64le
   rgbaf16be
   rgbaf16le
+  rgbaf32be
+  rgbaf32le
   vuya
   ya16be
   ya16le
@@ -780,6 +787,8 @@ Packed:
   rgba64le
   rgbaf16be
   rgbaf16le
+  rgbaf32be
+  rgbaf32le
   rgbf32be
   rgbf32le
   uyvy422
@@ -972,6 +981,8 @@ PackedRGB:
   rgba64le
   rgbaf16be
   rgbaf16le
+  rgbaf32be
+  rgbaf32le
   rgbf32be
   rgbf32le
   x2bgr10be



More information about the ffmpeg-cvslog mailing list