[FFmpeg-devel] [PATCH 2/7] lavu/pixfmt: add AV_PIX_FMT_RGB32

Lynne dev at lynne.ee
Thu Oct 10 08:32:46 EEST 2024


---
 libavutil/pixdesc.c | 24 ++++++++++++++++++++++++
 libavutil/pixfmt.h  |  4 ++++
 2 files changed, 28 insertions(+)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 7174989072..a741d9bcb7 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2775,6 +2775,30 @@ 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_RGB32BE] = {
+        .name = "rgb32be",
+        .nb_components = 3,
+        .log2_chroma_w = 0,
+        .log2_chroma_h = 0,
+        .comp = {
+            { 0, 12, 0, 0, 32 },       /* R */
+            { 0, 12, 4, 0, 32 },       /* G */
+            { 0, 12, 8, 0, 32 },       /* B */
+        },
+        .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB,
+    },
+    [AV_PIX_FMT_RGB32LE] = {
+        .name = "rgb32le",
+        .nb_components = 3,
+        .log2_chroma_w = 0,
+        .log2_chroma_h = 0,
+        .comp = {
+            { 0, 12, 0, 0, 32 },       /* R */
+            { 0, 12, 4, 0, 32 },       /* G */
+            { 0, 12, 8, 0, 32 },       /* B */
+        },
+        .flags = AV_PIX_FMT_FLAG_RGB,
+    },
     [AV_PIX_FMT_RGBAF32BE] = {
         .name = "rgbaf32be",
         .nb_components = 4,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index af06d8dcac..99a78304bf 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -451,6 +451,9 @@ enum AVPixelFormat {
     AV_PIX_FMT_RGBA32BE,    ///< packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., big-endian
     AV_PIX_FMT_RGBA32LE,    ///< packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., little-endian
 
+    AV_PIX_FMT_RGB32BE,     ///< packed RGBA 32:32:32, 96bpp, RGBRGB..., big-endian
+    AV_PIX_FMT_RGB32LE,     ///< packed RGBA 32:32:32, 96bpp, RGBRGB..., 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
 };
 
@@ -560,6 +563,7 @@ enum AVPixelFormat {
 
 #define AV_PIX_FMT_RGBF32     AV_PIX_FMT_NE(RGBF32BE, RGBF32LE)
 #define AV_PIX_FMT_RGBAF32    AV_PIX_FMT_NE(RGBAF32BE, RGBAF32LE)
+#define AV_PIX_FMT_RGB32      AV_PIX_FMT_NE(RGB32BE, RGB32LE)
 #define AV_PIX_FMT_RGBA32     AV_PIX_FMT_NE(RGBA32BE, RGBA32LE)
 
 /**
-- 
2.45.2.753.g447d99e1c3b


More information about the ffmpeg-devel mailing list