support for new stuff (lavc internal 2pass, ...)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5779 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
michael 2002-04-21 21:38:53 +00:00
parent e1a3e103b8
commit f017c820ac
1 changed files with 22 additions and 0 deletions

View File

@ -33,6 +33,10 @@ extern char* passtmpfile;
#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_vqmax = 15;
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 @@ struct config lavcopts_conf[]={
{"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 @@ static int config(struct vf_instance_s* vf,
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 @@ static int config(struct vf_instance_s* vf,
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;