Browse code

Start adding pixel definitions for planar rgb.

Themaister authored on 2011/10/09 04:54:20
Showing 3 changed files
... ...
@@ -2704,6 +2704,10 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2704 2704
             default:
2705 2705
                 if (CHROMA444){
2706 2706
                     s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? PIX_FMT_YUVJ444P : PIX_FMT_YUV444P;
2707
+                    if (s->avctx->colorspace == AVCOL_SPC_RGB) {
2708
+                       s->avctx->pix_fmt = PIX_FMT_GBR24P;
2709
+                       av_log(h->s.avctx, AV_LOG_DEBUG, "Detected GBR colorspace.\n");
2710
+                    }
2707 2711
                 }else if (CHROMA422) {
2708 2712
                     s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? PIX_FMT_YUVJ422P : PIX_FMT_YUV422P;
2709 2713
                 }else{
... ...
@@ -988,6 +988,15 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = {
988 988
             {0,1,2,0,7},        /* A */
989 989
         },
990 990
     },
991
+    [PIX_FMT_GBR24P] = {
992
+        .name = "gbr24p",
993
+        .nb_components= 3,
994
+        .comp = {
995
+            {0,1,1,0,7},        /* G */
996
+            {1,1,1,0,7},        /* B */
997
+            {2,1,1,0,7},        /* R */
998
+        },
999
+    },
991 1000
 };
992 1001
 
993 1002
 static enum PixelFormat get_pix_fmt_internal(const char *name)
... ...
@@ -154,6 +154,7 @@ enum PixelFormat {
154 154
     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
155 155
     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
156 156
     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
157
+    PIX_FMT_GBR24P,    ///< planar GBR, 24bpp, 8G, 8B, 8R.
157 158
     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
158 159
 };
159 160