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 | |
parent | 7080cbe2c828271fd75f9281b8b62020778db79a (diff) | |
download | ffmpeg-febea2f2e13f7cdc7659f2b15281f06eb77eaf07.tar.gz |
uniformize trellis quant option
Originally committed as revision 13722 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/avcodec.h | 2 | ||||
-rw-r--r-- | libavcodec/libxvidff.c | 6 | ||||
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 9 | ||||
-rw-r--r-- | libavcodec/utils.c | 4 |
4 files changed, 17 insertions, 4 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 8b6340029f..d7dbe15868 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -427,7 +427,9 @@ typedef struct RcOverride{ #define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT. #define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay. #define CODEC_FLAG_ALT_SCAN 0x00100000 ///< Use alternate scan. +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) #define CODEC_FLAG_TRELLIS_QUANT 0x00200000 ///< Use trellis quantization. +#endif #define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe. #define CODEC_FLAG_BITEXACT 0x00800000 ///< Use only bitexact stuff (except (I)DCT). /* Fx : Flag for h263+ extra options */ diff --git a/libavcodec/libxvidff.c b/libavcodec/libxvidff.c index fa5b118d00..bc4359a5b9 100644 --- a/libavcodec/libxvidff.c +++ b/libavcodec/libxvidff.c @@ -99,7 +99,11 @@ av_cold int ff_xvid_encode_init(AVCodecContext *avctx) { x->vop_flags = XVID_VOP_HALFPEL; /* Bare minimum quality */ if( xvid_flags & CODEC_FLAG_4MV ) x->vop_flags |= XVID_VOP_INTER4V; /* Level 3 */ - if( xvid_flags & CODEC_FLAG_TRELLIS_QUANT) + if( avctx->trellis +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) + || xvid_flags & CODEC_FLAG_TRELLIS_QUANT +#endif + ) x->vop_flags |= XVID_VOP_TRELLISQUANT; /* Level 5 */ if( xvid_flags & CODEC_FLAG_AC_PRED ) x->vop_flags |= XVID_VOP_HQACPRED; /* Level 6 */ 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) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 1a2dca3ac7..14b2eb5e11 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -400,8 +400,10 @@ static const AVOption options[]={ {"ildct", "use interlaced dct", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_INTERLACED_DCT, INT_MIN, INT_MAX, V|E, "flags"}, {"low_delay", "force low delay", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_LOW_DELAY, INT_MIN, INT_MAX, V|D|E, "flags"}, {"alt", "enable alternate scantable (mpeg2/mpeg4)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_ALT_SCAN, INT_MIN, INT_MAX, V|E, "flags"}, +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) {"trell", "use trellis quantization", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_TRELLIS_QUANT, INT_MIN, INT_MAX, V|E, "flags"}, -{"global_header", "place global headers in extradata instead of every keyframe", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_GLOBAL_HEADER, INT_MIN, INT_MAX, 0, "flags"}, +#endif +{"global_header", "place global headers in extradata instead of every keyframe", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_GLOBAL_HEADER, INT_MIN, INT_MAX, A|V|E, "flags"}, {"bitexact", "use only bitexact stuff (except (i)dct)", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_BITEXACT, INT_MIN, INT_MAX, A|V|S|D|E, "flags"}, {"aic", "h263 advanced intra coding / mpeg4 ac prediction", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_AC_PRED, INT_MIN, INT_MAX, V|E, "flags"}, {"umv", "use unlimited motion vectors", 0, FF_OPT_TYPE_CONST, CODEC_FLAG_H263P_UMV, INT_MIN, INT_MAX, V|E, "flags"}, |