changeset 9604:b8357dc014b0 libavcodec

Extract colorspace fields from MPEG1/2.
author michael
date Tue, 05 May 2009 19:53:49 +0000
parents 875cd15dfd74
children 93029f1a4c14
files mpeg12.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mpeg12.c	Tue May 05 18:44:13 2009 +0000
+++ b/mpeg12.c	Tue May 05 19:53:49 2009 +0000
@@ -1188,6 +1188,7 @@
     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 @@
     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