[FFmpeg-cvslog] r13722 - in trunk/libavcodec: avcodec.h libxvidff.c mpegvideo_enc.c utils.c
bcoudurier
subversion
Mon Jun 9 02:43:07 CEST 2008
Author: bcoudurier
Date: Mon Jun 9 02:43:07 2008
New Revision: 13722
Log:
uniformize trellis quant option
Modified:
trunk/libavcodec/avcodec.h
trunk/libavcodec/libxvidff.c
trunk/libavcodec/mpegvideo_enc.c
trunk/libavcodec/utils.c
Modified: trunk/libavcodec/avcodec.h
==============================================================================
--- trunk/libavcodec/avcodec.h (original)
+++ trunk/libavcodec/avcodec.h Mon Jun 9 02:43:07 2008
@@ -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 */
Modified: trunk/libavcodec/libxvidff.c
==============================================================================
--- trunk/libavcodec/libxvidff.c (original)
+++ trunk/libavcodec/libxvidff.c Mon Jun 9 02:43:07 2008
@@ -99,7 +99,11 @@ av_cold int ff_xvid_encode_init(AVCodecC
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 */
Modified: trunk/libavcodec/mpegvideo_enc.c
==============================================================================
--- trunk/libavcodec/mpegvideo_enc.c (original)
+++ trunk/libavcodec/mpegvideo_enc.c Mon Jun 9 02:43:07 2008
@@ -332,6 +332,11 @@ av_cold int MPV_encode_init(AVCodecConte
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(AVCodecConte
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(AVCodecConte
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)
Modified: trunk/libavcodec/utils.c
==============================================================================
--- trunk/libavcodec/utils.c (original)
+++ trunk/libavcodec/utils.c Mon Jun 9 02:43:07 2008
@@ -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"},
More information about the ffmpeg-cvslog
mailing list