[FFmpeg-cvslog] r18747 - trunk/libavcodec/mpeg12.c

michael subversion
Tue May 5 21:53:50 CEST 2009


Author: michael
Date: Tue May  5 21:53:49 2009
New Revision: 18747

Log:
Extract colorspace fields from MPEG1/2.

Modified:
   trunk/libavcodec/mpeg12.c

Modified: trunk/libavcodec/mpeg12.c
==============================================================================
--- trunk/libavcodec/mpeg12.c	Tue May  5 20:44:13 2009	(r18746)
+++ trunk/libavcodec/mpeg12.c	Tue May  5 21:53:49 2009	(r18747)
@@ -1188,6 +1188,7 @@ static av_cold int mpeg_decode_init(AVCo
     s->mpeg_enc_ctx.picture_number = 0;
     s->repeat_field = 0;
     s->mpeg_enc_ctx.codec_id= avctx->codec->id;
+    avctx->color_range= AVCOL_RANGE_MPEG;
     return 0;
 }
 
@@ -1420,9 +1421,9 @@ static void mpeg_decode_sequence_display
     skip_bits(&s->gb, 3); /* video format */
     color_description= get_bits1(&s->gb);
     if(color_description){
-        skip_bits(&s->gb, 8); /* color primaries */
-        skip_bits(&s->gb, 8); /* transfer_characteristics */
-        skip_bits(&s->gb, 8); /* matrix_coefficients */
+        s->avctx->color_primaries= get_bits(&s->gb, 8);
+        s->avctx->color_trc      = get_bits(&s->gb, 8);
+        s->avctx->colorspace     = get_bits(&s->gb, 8);
     }
     w= get_bits(&s->gb, 14);
     skip_bits(&s->gb, 1); //marker



More information about the ffmpeg-cvslog mailing list