[libav-devel] [PATCH 1/4] pixfmt: add planar RGB formats.

Ronald S. Bultje rsbultje at gmail.com
Thu Nov 24 17:28:44 CET 2011


---
 libavutil/pixdesc.c |   80 +++++++++++++++++++++++++++++++++++++++++++++++++++
 libavutil/pixfmt.h  |   11 +++++++
 2 files changed, 91 insertions(+), 0 deletions(-)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index e0616df..5864cdb 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -967,6 +967,86 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
             {0,1,2,0,7},        /* A */
         },
     },
+    [PIX_FMT_GBRP] = {
+        .name = "gbrp",
+        .nb_components= 3,
+        .log2_chroma_w= 0,
+        .log2_chroma_h= 0,
+        .comp = {
+            {0,0,1,0,7},        /* G */
+            {1,0,1,0,7},        /* B */
+            {2,0,1,0,7},        /* R */
+        },
+    },
+    [PIX_FMT_GBRP9LE] = {
+        .name = "gbrp9le",
+        .nb_components= 3,
+        .log2_chroma_w= 0,
+        .log2_chroma_h= 0,
+        .comp = {
+            {0,1,1,0,8},        /* G */
+            {1,1,1,0,8},        /* B */
+            {2,1,1,0,8},        /* R */
+        },
+    },
+    [PIX_FMT_GBRP9BE] = {
+        .name = "gbrp9be",
+        .nb_components= 3,
+        .log2_chroma_w= 0,
+        .log2_chroma_h= 0,
+        .comp = {
+            {0,1,1,0,8},        /* G */
+            {1,1,1,0,8},        /* B */
+            {2,1,1,0,8},        /* R */
+        },
+        .flags = PIX_FMT_BE,
+    },
+    [PIX_FMT_GBRP10LE] = {
+        .name = "gbrp10le",
+        .nb_components= 3,
+        .log2_chroma_w= 0,
+        .log2_chroma_h= 0,
+        .comp = {
+            {0,1,1,0,9},        /* G */
+            {1,1,1,0,9},        /* B */
+            {2,1,1,0,9},        /* R */
+        },
+    },
+    [PIX_FMT_GBRP10BE] = {
+        .name = "gbrp10be",
+        .nb_components= 3,
+        .log2_chroma_w= 0,
+        .log2_chroma_h= 0,
+        .comp = {
+            {0,1,1,0,9},        /* G */
+            {1,1,1,0,9},        /* B */
+            {2,1,1,0,9},        /* R */
+        },
+        .flags = PIX_FMT_BE,
+    },
+    [PIX_FMT_GBRP16LE] = {
+        .name = "gbrp16le",
+        .nb_components= 3,
+        .log2_chroma_w= 0,
+        .log2_chroma_h= 0,
+        .comp = {
+            {0,1,1,0,15},       /* G */
+            {1,1,1,0,15},       /* B */
+            {2,1,1,0,15},       /* R */
+        },
+    },
+    [PIX_FMT_GBRP16BE] = {
+        .name = "gbrp16be",
+        .nb_components= 3,
+        .log2_chroma_w= 0,
+        .log2_chroma_h= 0,
+        .comp = {
+            {0,1,1,0,15},       /* G */
+            {1,1,1,0,15},       /* B */
+            {2,1,1,0,15},       /* R */
+        },
+        .flags = PIX_FMT_BE,
+    },
 };
 
 static enum PixelFormat get_pix_fmt_internal(const char *name)
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 39c608d..bd898bd 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -150,6 +150,13 @@ enum PixelFormat {
     PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
     PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
     PIX_FMT_VDA_VLD,    ///< hardware decoding through VDA
+    PIX_FMT_GBRP,      ///< planar GBR 4:4:4 24bpp
+    PIX_FMT_GBRP9BE,   ///< planar GBR 4:4:4 27bpp, big endian
+    PIX_FMT_GBRP9LE,   ///< planar GBR 4:4:4 27bpp, little endian
+    PIX_FMT_GBRP10BE,  ///< planar GBR 4:4:4 30bpp, big endian
+    PIX_FMT_GBRP10LE,  ///< planar GBR 4:4:4 30bpp, little endian
+    PIX_FMT_GBRP16BE,  ///< planar GBR 4:4:4 48bpp, big endian
+    PIX_FMT_GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little endian
     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
 };
 
@@ -184,4 +191,8 @@ enum PixelFormat {
 #define PIX_FMT_YUV422P16 PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
 #define PIX_FMT_YUV444P16 PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
 
+#define PIX_FMT_GBRP9     PIX_FMT_NE(GBRP9BE ,    GBRP9LE)
+#define PIX_FMT_GBRP10    PIX_FMT_NE(GBRP10BE,    GBRP10LE)
+#define PIX_FMT_GBRP16    PIX_FMT_NE(GBRP16BE,    GBRP16LE)
+
 #endif /* AVUTIL_PIXFMT_H */
-- 
1.7.2.1



More information about the libav-devel mailing list