[MPlayer-dev-eng] [PATCH] vrc_init_occupancy for ve_lavc
Tobias Diedrich
ranma at tdiedrich.de
Sun Jun 19 22:18:00 CEST 2005
The attached patch adds a vrc_init_occupancy knob to -lavcopts.
The old default was a vrc_init_occupancy of 0, the new default is
0.9 times vrc_buf_size, which rids the first few encoded
frames of their blockyness.
I first had it as a direct knob, but then I saw the similar
parameter for x264enc and changed it.
(And it does make more sense to make it dependend on buf_size)
--
Tobias PGP: http://9ac7e0bc.uguu.de
-------------- next part --------------
Index: DOCS/man/en/mplayer.1
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/man/en/mplayer.1,v
retrieving revision 1.1013
diff -u -r1.1013 mplayer.1
--- DOCS/man/en/mplayer.1 19 Jun 2005 09:12:43 -0000 1.1013
+++ DOCS/man/en/mplayer.1 19 Jun 2005 20:10:36 -0000
@@ -6602,6 +6602,10 @@
initial complexity (pass\ 1)
.
.TP
+.B vrc_init_occupancy=<0.0\-1.0>
+initial buffer occupancy, as a fraction of vrc_buf_size (default: 0.9)
+.
+.TP
.B vqsquish=<0|1>
Specify how to keep the quantizer between qmin and qmax (pass\ 1/\:2).
.PD 0
Index: DOCS/man/de/mplayer.1
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/man/de/mplayer.1,v
retrieving revision 1.160
diff -u -r1.160 mplayer.1
--- DOCS/man/de/mplayer.1 19 Jun 2005 09:12:43 -0000 1.160
+++ DOCS/man/de/mplayer.1 19 Jun 2005 20:10:38 -0000
@@ -6840,6 +6840,10 @@
anf?liche Komplexit?(Durchlauf 1)
.
.TP
+.B vrc_init_occupancy=<0.0\-1.0>
+initiale Pufferbelegung als Bruchteil von vrc_buf_size (Standard: 0.9)
+.
+.TP
.B vqsquish=<0|1>
Gibt an, wie die Quantisierungsparameter zwischen qmin und qmax gehalten werden
(Durchlauf 1/\:2):
Index: libmpcodecs/ve_lavc.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_lavc.c,v
retrieving revision 1.116
diff -u -r1.116 ve_lavc.c
--- libmpcodecs/ve_lavc.c 9 May 2005 20:04:12 -0000 1.116
+++ libmpcodecs/ve_lavc.c 19 Jun 2005 20:10:38 -0000
@@ -93,6 +93,7 @@
static int lavc_param_rc_max_rate=0;
static int lavc_param_rc_min_rate=0;
static float lavc_param_rc_initial_cplx=0;
+static int lavc_param_rc_initial_buffer_occupancy=0.9;
static int lavc_param_mpeg_quant=0;
static int lavc_param_fdct=0;
static int lavc_param_idct=0;
@@ -211,6 +212,7 @@
{"vrc_buf_size", &lavc_param_rc_buffer_size, CONF_TYPE_INT, CONF_RANGE, 4, 24000000, NULL},
{"vrc_buf_aggressivity", &lavc_param_rc_buffer_aggressivity, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 99.0, NULL},
{"vrc_init_cplx", &lavc_param_rc_initial_cplx, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 9999999.0, NULL},
+ {"vrc_init_occupancy", &lavc_param_rc_initial_buffer_occupancy, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 1.0, NULL},
{"vfdct", &lavc_param_fdct, CONF_TYPE_INT, CONF_RANGE, 0, 10, NULL},
{"aspect", &lavc_param_aspect, CONF_TYPE_STRING, 0, 0, 0, NULL},
{"autoaspect", &lavc_param_autoaspect, CONF_TYPE_FLAG, 0, 0, 1, NULL},
@@ -395,6 +397,9 @@
lavc_venc_context->rc_max_rate= lavc_param_rc_max_rate*1000;
lavc_venc_context->rc_min_rate= lavc_param_rc_min_rate*1000;
lavc_venc_context->rc_buffer_size= lavc_param_rc_buffer_size*1000;
+ lavc_venc_context->rc_initial_buffer_occupancy=
+ lavc_venc_context->rc_buffer_size *
+ lavc_param_rc_initial_buffer_occupancy;
lavc_venc_context->rc_buffer_aggressivity= lavc_param_rc_buffer_aggressivity;
lavc_venc_context->rc_initial_cplx= lavc_param_rc_initial_cplx;
#if LIBAVCODEC_BUILD >= 4642
More information about the MPlayer-dev-eng
mailing list