diff mpeg12.c @ 9626:bd3e11b60ccd libavcodec

Add a chroma_sample_location field to define positioning of chroma samples
author conrad
date Mon, 11 May 2009 04:34:23 +0000
parents b8357dc014b0
children 15660ad4c641
line wrap: on
line diff
--- a/mpeg12.c	Mon May 11 02:41:50 2009 +0000
+++ b/mpeg12.c	Mon May 11 04:34:23 2009 +0000
@@ -1189,6 +1189,10 @@
     s->repeat_field = 0;
     s->mpeg_enc_ctx.codec_id= avctx->codec->id;
     avctx->color_range= AVCOL_RANGE_MPEG;
+    if (avctx->codec->id == CODEC_ID_MPEG1VIDEO)
+        avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
+    else
+        avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
     return 0;
 }