[FFmpeg-cvslog] Start adding pixel definitions for planar rgb.

Themaister git at videolan.org
Sun Oct 9 02:06:25 CEST 2011


ffmpeg | branch: master | Themaister <maister at archlinux.us> | Sat Oct  8 21:54:20 2011 +0200| [a3e11fa43ce144fc1f4d1c9f81b7de8f18ff628f] | committer: Michael Niedermayer

Start adding pixel definitions for planar rgb.

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

 libavcodec/h264.c   |    4 ++++
 libavutil/pixdesc.c |    9 +++++++++
 libavutil/pixfmt.h  |    1 +
 3 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index df24bcf..05797f9 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2704,6 +2704,10 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
             default:
                 if (CHROMA444){
                     s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? PIX_FMT_YUVJ444P : PIX_FMT_YUV444P;
+                    if (s->avctx->colorspace == AVCOL_SPC_RGB) {
+                       s->avctx->pix_fmt = PIX_FMT_GBR24P;
+                       av_log(h->s.avctx, AV_LOG_DEBUG, "Detected GBR colorspace.\n");
+                    }
                 }else if (CHROMA422) {
                     s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? PIX_FMT_YUVJ422P : PIX_FMT_YUV422P;
                 }else{
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 1b97ab2..ba19afb 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -988,6 +988,15 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
             {0,1,2,0,7},        /* A */
         },
     },
+    [PIX_FMT_GBR24P] = {
+        .name = "gbr24p",
+        .nb_components= 3,
+        .comp = {
+            {0,1,1,0,7},        /* G */
+            {1,1,1,0,7},        /* B */
+            {2,1,1,0,7},        /* R */
+        },
+    },
 };
 
 static enum PixelFormat get_pix_fmt_internal(const char *name)
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 81cbd72..f23d0c5 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -154,6 +154,7 @@ enum PixelFormat {
     PIX_FMT_RGBA64LE,  ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
     PIX_FMT_BGRA64BE,  ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
     PIX_FMT_BGRA64LE,  ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
+    PIX_FMT_GBR24P,    ///< planar GBR, 24bpp, 8G, 8B, 8R.
     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
 };
 



More information about the ffmpeg-cvslog mailing list