Mercurial > mplayer.hg
comparison libmpcodecs/ve_lavc.c @ 13386:d8ba5b72fc6c
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.
author | gpoirier |
---|---|
date | Sun, 19 Sep 2004 09:59:05 +0000 |
parents | e488b3c628db |
children | 2f69854dfbe4 |
comparison
equal
deleted
inserted
replaced
13385:e488b3c628db | 13386:d8ba5b72fc6c |
---|---|
151 static int lavc_param_ilme= 0; | 151 static int lavc_param_ilme= 0; |
152 static int lavc_param_nssew= 8; | 152 static int lavc_param_nssew= 8; |
153 static int lavc_param_closed_gop = 0; | 153 static int lavc_param_closed_gop = 0; |
154 static int lavc_param_dc_precision = 8; | 154 static int lavc_param_dc_precision = 8; |
155 static int lavc_param_threads= 1; | 155 static int lavc_param_threads= 1; |
156 static int lavc_param_turbo = 0; | |
156 | 157 |
157 | 158 |
158 char *lavc_param_acodec = "mp2"; | 159 char *lavc_param_acodec = "mp2"; |
159 int lavc_param_atag = 0; | 160 int lavc_param_atag = 0; |
160 int lavc_param_abitrate = 224; | 161 int lavc_param_abitrate = 224; |
300 {"sc_threshold", &lavc_param_sc_threshold, CONF_TYPE_INT, CONF_RANGE, -1000000, 1000000, NULL}, | 301 {"sc_threshold", &lavc_param_sc_threshold, CONF_TYPE_INT, CONF_RANGE, -1000000, 1000000, NULL}, |
301 {"top", &lavc_param_top, CONF_TYPE_INT, CONF_RANGE, -1, 1, NULL}, | 302 {"top", &lavc_param_top, CONF_TYPE_INT, CONF_RANGE, -1, 1, NULL}, |
302 {"qns", &lavc_param_qns, CONF_TYPE_INT, CONF_RANGE, 0, 1000000, NULL}, | 303 {"qns", &lavc_param_qns, CONF_TYPE_INT, CONF_RANGE, 0, 1000000, NULL}, |
303 {"nssew", &lavc_param_nssew, CONF_TYPE_INT, CONF_RANGE, 0, 1000000, NULL}, | 304 {"nssew", &lavc_param_nssew, CONF_TYPE_INT, CONF_RANGE, 0, 1000000, NULL}, |
304 {"threads", &lavc_param_threads, CONF_TYPE_INT, CONF_RANGE, 1, 8, NULL}, | 305 {"threads", &lavc_param_threads, CONF_TYPE_INT, CONF_RANGE, 1, 8, NULL}, |
306 {"turbo", &lavc_param_turbo, CONF_TYPE_FLAG, 0, 0, 1, NULL}, | |
305 {NULL, NULL, 0, 0, 0, 0, NULL} | 307 {NULL, NULL, 0, 0, 0, 0, NULL} |
306 }; | 308 }; |
307 #endif | 309 #endif |
308 | 310 |
309 struct vf_priv_s { | 311 struct vf_priv_s { |
663 lavc_venc_context->flags|= CODEC_FLAG_PASS1; | 665 lavc_venc_context->flags|= CODEC_FLAG_PASS1; |
664 stats_file= fopen(passtmpfile, "wb"); | 666 stats_file= fopen(passtmpfile, "wb"); |
665 if(stats_file==NULL){ | 667 if(stats_file==NULL){ |
666 mp_msg(MSGT_MENCODER,MSGL_ERR,"2pass failed: filename=%s\n", passtmpfile); | 668 mp_msg(MSGT_MENCODER,MSGL_ERR,"2pass failed: filename=%s\n", passtmpfile); |
667 return 0; | 669 return 0; |
670 } | |
671 if(lavc_param_turbo) { | |
672 /* uses SAD comparison functions instead of other hungrier */ | |
673 lavc_venc_context->me_pre_cmp = 0; | |
674 lavc_venc_context->me_cmp = 0; | |
675 lavc_venc_context->me_sub_cmp = 0; | |
676 lavc_venc_context->mb_cmp = 2; | |
677 | |
678 /* Disables diamond motion estimation */ | |
679 lavc_venc_context->pre_dia_size = 0; | |
680 lavc_venc_context->dia_size = 0; | |
681 | |
682 lavc_venc_context->quantizer_noise_shaping = 0; // qns=0 | |
683 lavc_venc_context->noise_reduction = 0; // nr=0 | |
684 | |
685 if (lavc_param_mb_decision) { | |
686 lavc_venc_context->mb_decision = 1; // mbd=0 ("realtime" encoding) | |
687 } | |
688 lavc_venc_context->flags &= ~CODEC_FLAG_QPEL; | |
689 lavc_venc_context->flags &= ~CODEC_FLAG_4MV; | |
690 lavc_venc_context->flags &= ~CODEC_FLAG_TRELLIS_QUANT; | |
691 lavc_venc_context->flags &= ~CODEC_FLAG_CBP_RD; | |
692 lavc_venc_context->flags &= ~CODEC_FLAG_QP_RD; | |
693 lavc_venc_context->flags &= ~CODEC_FLAG_MV0; | |
668 } | 694 } |
669 break; | 695 break; |
670 } | 696 } |
671 } | 697 } |
672 | 698 |