[FFmpeg-soc] [soc]: r3812 - in dirac/libavcodec: dirac.c diracdec.c

conrad subversion at mplayerhq.hu
Tue Nov 11 09:38:09 CET 2008


Author: conrad
Date: Tue Nov 11 09:38:09 2008
New Revision: 3812

Log:
Set pix_fmt correctly


Modified:
   dirac/libavcodec/dirac.c
   dirac/libavcodec/diracdec.c

Modified: dirac/libavcodec/dirac.c
==============================================================================
--- dirac/libavcodec/dirac.c	(original)
+++ dirac/libavcodec/dirac.c	Tue Nov 11 09:38:09 2008
@@ -96,6 +96,12 @@ static const color_specification dirac_c
 static const float dirac_preset_kr[] = { 0.2126, 0.299, 0 /* XXX */ };
 static const float dirac_preset_kb[] = { 0.0722, 0.114, 0 /* XXX */ };
 
+static const enum PixelFormat dirac_pix_fmt[] = {
+    PIX_FMT_YUV444P,
+    PIX_FMT_YUV422P,
+    PIX_FMT_YUV420P,
+};
+
 /* Quarter pixel interpolation. */
 static const uint8_t qpel_weights[][4] = {
     {  4,  0,  0,  0 }, /* rx=0, ry=0 */
@@ -185,6 +191,12 @@ static int parse_source_parameters(AVCod
     /* Override the chroma format. */
     if (get_bits1(gb))
         s->source.chroma_format = svq3_get_ue_golomb(gb);
+    if (s->source.chroma_format > 2) {
+        av_log(avctx, AV_LOG_ERROR, "Unknown chroma format %d\n",
+               s->source.chroma_format);
+        return -1;
+    }
+    avctx->pix_fmt = dirac_pix_fmt[s->source.chroma_format];
 
     /* Calculate the chroma dimensions. */
     s->chroma_hshift = s->source.chroma_format > 0;

Modified: dirac/libavcodec/diracdec.c
==============================================================================
--- dirac/libavcodec/diracdec.c	(original)
+++ dirac/libavcodec/diracdec.c	Tue Nov 11 09:38:09 2008
@@ -882,8 +882,6 @@ int dirac_decode_frame(AVCodecContext *a
     if (parse_frame(s) < 0)
         return -1;
 
-    avctx->pix_fmt = PIX_FMT_YUV420P; /* XXX */
-
     if (avcodec_check_dimensions(avctx, s->source.luma_width,
                                  s->source.luma_height))
         return -1;



More information about the FFmpeg-soc mailing list