diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-06-09 00:43:07 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-06-09 00:43:07 +0000 |
commit | febea2f2e13f7cdc7659f2b15281f06eb77eaf07 (patch) | |
tree | d80259ecb4435c11682c4508788e8ca8b2e1b06b /libavcodec/mpegvideo_enc.c | |
parent | 7080cbe2c828271fd75f9281b8b62020778db79a (diff) | |
download | ffmpeg-febea2f2e13f7cdc7659f2b15281f06eb77eaf07.tar.gz |
uniformize trellis quant option
Originally committed as revision 13722 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 12f87c44b7..d904afde6e 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -332,6 +332,11 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) 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 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) 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 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) 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) |