# HG changeset patch # User michael # Date 1019425133 0 # Node ID f2586f1a3a967d577e65e53baa34a4d96e8f865c # Parent 578a4817454504f96f9eeac3777f4112ac4395cc support for new stuff (lavc internal 2pass, ...) diff -r 578a48174545 -r f2586f1a3a96 libmpcodecs/ve_lavc.c --- a/libmpcodecs/ve_lavc.c Sun Apr 21 21:18:28 2002 +0000 +++ b/libmpcodecs/ve_lavc.c Sun Apr 21 21:38:53 2002 +0000 @@ -33,6 +33,10 @@ #include "libavcodec/avcodec.h" #endif +#if LIBAVCODEC_BUILD < 4601 +#error your version of libavcodec is too old, get a newer one, and dont send a bugreport, THIS IS NO BUG +#endif + extern int avcodec_inited; /* video options */ @@ -48,8 +52,12 @@ static int lavc_param_vqdiff = 3; static float lavc_param_vqcompress = 0.5; static float lavc_param_vqblur = 0.5; +static float lavc_param_vb_qfactor = 2.0; static int lavc_param_vmax_b_frames = 0; static int lavc_param_keyint = -1; +static int lavc_param_vpass = 0; +static int lavc_param_vrc_strategy = 2; +static int lavc_param_vb_strategy = 0; #include "cfgparser.h" @@ -67,7 +75,11 @@ {"vqdiff", &lavc_param_vqdiff, CONF_TYPE_INT, CONF_RANGE, 1, 31, NULL}, {"vqcomp", &lavc_param_vqcompress, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 1.0, NULL}, {"vqblur", &lavc_param_vqblur, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 1.0, NULL}, + {"vb_qfactor", &lavc_param_vb_qfactor, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 31.0, NULL}, {"vmax_b_frames", &lavc_param_vmax_b_frames, CONF_TYPE_INT, CONF_RANGE, 0, FF_MAX_B_FRAMES, NULL}, + {"vpass", &lavc_param_vpass, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL}, + {"vrc_strategy", &lavc_param_vrc_strategy, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL}, + {"vb_strategy", &lavc_param_vb_strategy, CONF_TYPE_INT, CONF_RANGE, 0, 1, NULL}, {"keyint", &lavc_param_keyint, CONF_TYPE_INT, 0, 0, 0, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; @@ -112,6 +124,10 @@ lavc_venc_context.qcompress= lavc_param_vqcompress; lavc_venc_context.qblur= lavc_param_vqblur; lavc_venc_context.max_b_frames= lavc_param_vmax_b_frames; + lavc_venc_context.b_quant_factor= lavc_param_vb_qfactor; + lavc_venc_context.rc_strategy= lavc_param_vrc_strategy; + lavc_venc_context.b_frame_strategy= lavc_param_vb_strategy; + /* keyframe interval */ if (lavc_param_keyint >= 0) /* != -1 */ lavc_venc_context.gop_size = lavc_param_keyint; @@ -128,6 +144,12 @@ lavc_venc_context.flags|= lavc_param_v4mv ? CODEC_FLAG_4MV : 0; + /* lavc internal 2pass bitrate control */ + if(lavc_param_vpass==1) + lavc_venc_context.flags|= CODEC_FLAG_PASS1; + else if(lavc_param_vpass==2) + lavc_venc_context.flags|= CODEC_FLAG_PASS2; + #ifdef ME_ZERO // workaround Juanjo's stupid incompatible change: motion_estimation_method = lavc_param_vme;