avcodec/mpegvideo_enc: workaround applications specifying intra dc level based on...
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 15 Jul 2014 17:12:00 +0000 (19:12 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 15 Jul 2014 17:56:22 +0000 (19:56 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mpegvideo_enc.c

index 9c4f2a5..e88b4f3 100644 (file)
@@ -335,6 +335,13 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
     s->mpeg_quant         = avctx->mpeg_quant;
     s->rtp_mode           = !!avctx->rtp_payload_size;
     s->intra_dc_precision = avctx->intra_dc_precision;
+
+    // workaround some differences between how applications specify dc precission
+    if (s->intra_dc_precision < 0) {
+        s->intra_dc_precision += 8;
+    } else if (s->intra_dc_precision >= 8)
+        s->intra_dc_precision -= 8;
+
     s->user_specified_pts = AV_NOPTS_VALUE;
 
     if (s->gop_size <= 1) {