diff options
author | gpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-09-19 09:59:05 +0000 |
---|---|---|
committer | gpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-09-19 09:59:05 +0000 |
commit | 7fa1bf6c592b9d4c4ac76da436193a8bfeaf1df5 (patch) | |
tree | c75cc444acc3033ae48acf5cbac702c1f5b63785 /libmpcodecs/ve_lavc.c | |
parent | a33c90828ea8b6f59ed3c7396088a7bc0bc9ff6a (diff) | |
download | mpv-7fa1bf6c592b9d4c4ac76da436193a8bfeaf1df5.tar.bz2 mpv-7fa1bf6c592b9d4c4ac76da436193a8bfeaf1df5.tar.xz |
New lavc flag: "turbo" mode which is supposed to speed up 2-pass encoding
while preserving quality as much as possible.
Inspired by XviD "turbo" mode.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13387 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/ve_lavc.c')
-rw-r--r-- | libmpcodecs/ve_lavc.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c index 86dd0dc774..75e2f9e671 100644 --- a/libmpcodecs/ve_lavc.c +++ b/libmpcodecs/ve_lavc.c @@ -153,6 +153,7 @@ static int lavc_param_nssew= 8; static int lavc_param_closed_gop = 0; static int lavc_param_dc_precision = 8; static int lavc_param_threads= 1; +static int lavc_param_turbo = 0; char *lavc_param_acodec = "mp2"; @@ -302,6 +303,7 @@ m_option_t lavcopts_conf[]={ {"qns", &lavc_param_qns, CONF_TYPE_INT, CONF_RANGE, 0, 1000000, NULL}, {"nssew", &lavc_param_nssew, CONF_TYPE_INT, CONF_RANGE, 0, 1000000, NULL}, {"threads", &lavc_param_threads, CONF_TYPE_INT, CONF_RANGE, 1, 8, NULL}, + {"turbo", &lavc_param_turbo, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; #endif @@ -666,6 +668,30 @@ static int config(struct vf_instance_s* vf, mp_msg(MSGT_MENCODER,MSGL_ERR,"2pass failed: filename=%s\n", passtmpfile); return 0; } + if(lavc_param_turbo) { + /* uses SAD comparison functions instead of other hungrier */ + lavc_venc_context->me_pre_cmp = 0; + lavc_venc_context->me_cmp = 0; + lavc_venc_context->me_sub_cmp = 0; + lavc_venc_context->mb_cmp = 2; + + /* Disables diamond motion estimation */ + lavc_venc_context->pre_dia_size = 0; + lavc_venc_context->dia_size = 0; + + lavc_venc_context->quantizer_noise_shaping = 0; // qns=0 + lavc_venc_context->noise_reduction = 0; // nr=0 + + if (lavc_param_mb_decision) { + lavc_venc_context->mb_decision = 1; // mbd=0 ("realtime" encoding) + } + lavc_venc_context->flags &= ~CODEC_FLAG_QPEL; + lavc_venc_context->flags &= ~CODEC_FLAG_4MV; + lavc_venc_context->flags &= ~CODEC_FLAG_TRELLIS_QUANT; + lavc_venc_context->flags &= ~CODEC_FLAG_CBP_RD; + lavc_venc_context->flags &= ~CODEC_FLAG_QP_RD; + lavc_venc_context->flags &= ~CODEC_FLAG_MV0; + } break; } } |