diff mpegvideo_enc.c @ 7034:130784da5595 libavcodec

uniformize trellis quant option
author bcoudurier
date Mon, 09 Jun 2008 00:43:07 +0000
parents e1302edb0f69
children e943e1409077
line wrap: on
line diff
--- a/mpegvideo_enc.c	Sun Jun 08 21:09:02 2008 +0000
+++ b/mpegvideo_enc.c	Mon Jun 09 00:43:07 2008 +0000
@@ -332,6 +332,11 @@
     s->intra_vlc_format= !!(s->flags2 & CODEC_FLAG2_INTRA_VLC);
     s->q_scale_type= !!(s->flags2 & CODEC_FLAG2_NON_LINEAR_QUANT);
 
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
+    if (s->flags & CODEC_FLAG_TRELLIS_QUANT)
+        avctx->trellis = 1;
+#endif
+
     if(avctx->rc_max_rate && !avctx->rc_buffer_size){
         av_log(avctx, AV_LOG_ERROR, "a vbv buffer size is needed, for encoding with a maximum bitrate\n");
         return -1;
@@ -414,7 +419,7 @@
         return -1;
     }
 
-    if((s->flags & CODEC_FLAG_CBP_RD) && !(s->flags & CODEC_FLAG_TRELLIS_QUANT)){
+    if((s->flags & CODEC_FLAG_CBP_RD) && !avctx->trellis){
         av_log(avctx, AV_LOG_ERROR, "CBP RD needs trellis quant\n");
         return -1;
     }
@@ -680,7 +685,7 @@
     if(!s->denoise_dct)
         s->denoise_dct = denoise_dct_c;
     s->fast_dct_quantize = s->dct_quantize;
-    if(s->flags & CODEC_FLAG_TRELLIS_QUANT)
+    if(avctx->trellis)
         s->dct_quantize = dct_quantize_trellis_c;
 
     if((ENABLE_H263P_ENCODER || ENABLE_RV20_ENCODER) && s->modified_quant)