# HG changeset patch # User corey # Date 1149489449 0 # Node ID c1d5652c1654fe6a265c9980817d0f0deacc8cc5 # Parent 25c95219c33d82f57393c1bf05cbba835e89a87b Support and document lavc b_sensitivity option. diff -r 25c95219c33d -r c1d5652c1654 DOCS/man/en/mplayer.1 --- a/DOCS/man/en/mplayer.1 Mon Jun 05 06:36:21 2006 +0000 +++ b/DOCS/man/en/mplayer.1 Mon Jun 05 06:37:29 2006 +0000 @@ -7005,6 +7005,7 @@ Always use the maximum number of B-frames (default). .IPs 1 Avoid B-frames in high motion scenes. +See the b_sensitivity option to tune this strategy. .IPs 2 Places B-frames more or less optimally to yield maximum quality (slower). You may want to reduce the speed impact of this option by tuning the @@ -7013,6 +7014,17 @@ .PD 1 . .TP +.B b_sensitivity= +Adjusts how sensitively vb_strategy=1 detects motion and avoids using +B-frames (default: 40). +Lower sensitivities will result in more B-frames. +Using more B-frames usually improves PSNR, but too many B-frames can +hurt quality in high-motion scenes. +Unless there is an extremely high amount of motion, b_sensitivity can +safely be lowered below the default; 10 is a reasonable value in most +cases. +. +.TP .B brd_scale=<0\-10> Downscales frames for dynamic B-frame decision (default: 0). Each time brd_scale is increased by one, the frame dimensions are diff -r 25c95219c33d -r c1d5652c1654 libmpcodecs/ve_lavc.c --- a/libmpcodecs/ve_lavc.c Mon Jun 05 06:36:21 2006 +0000 +++ b/libmpcodecs/ve_lavc.c Mon Jun 05 06:37:29 2006 +0000 @@ -162,6 +162,7 @@ static int lavc_param_video_global_header= 0; static int lavc_param_mv0_threshold = 256; static int lavc_param_refs = 1; +static int lavc_param_b_sensitivity = 40; char *lavc_param_acodec = "mp2"; int lavc_param_atag = 0; @@ -323,6 +324,7 @@ {"aglobal", &lavc_param_audio_global_header, CONF_TYPE_INT, CONF_RANGE, 0, INT_MAX, NULL}, {"mv0_threshold", &lavc_param_mv0_threshold, CONF_TYPE_INT, CONF_RANGE, 0, INT_MAX, NULL}, {"refs", &lavc_param_refs, CONF_TYPE_INT, CONF_RANGE, 1, 16, NULL}, + {"b_sensitivity", &lavc_param_b_sensitivity, CONF_TYPE_INT, CONF_RANGE, 1, INT_MAX, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; #endif @@ -655,6 +657,7 @@ } lavc_venc_context->mv0_threshold = lavc_param_mv0_threshold; lavc_venc_context->refs = lavc_param_refs; + lavc_venc_context->b_sensitivity = lavc_param_b_sensitivity; switch(lavc_param_format) {