[MPlayer-dev-eng] [PATCH] sync to x264 r61
Loren Merritt
lorenm at u.washington.edu
Wed Nov 17 19:50:45 CET 2004
Improved ratecontrol.
Renamed "fullinter" to "4x4mv", because the previous name said nothing
about what it did.
Any comments (probably on the documentation)?
--Loren Merritt
-------------- next part --------------
Index: DOCS/man/en/mplayer.1
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/man/en/mplayer.1,v
retrieving revision 1.806
diff -u -r1.806 mplayer.1
--- DOCS/man/en/mplayer.1 17 Nov 2004 02:08:24 -0000 1.806
+++ DOCS/man/en/mplayer.1 17 Nov 2004 18:28:36 -0000
@@ -7091,11 +7091,11 @@
.
.TP
.B ip_factor=<value>
-quantizer factor between I- and P-frames (default: 2.0)
+quantizer factor between I- and P-frames (default: 1.4)
.
.TP
.B pb_factor=<value>
-quantizer factor between P- and B-frames (default: 2.0)
+quantizer factor between P- and B-frames (default: 1.4)
.
.TP
.B pass=<1\-3>
@@ -7147,13 +7147,24 @@
more constant.
.
.TP
+.B cplx_blur=<0\-999>
+Temporal blur of the estimated frame complexity, before curve compression
+(default: 20).
+Lower values allow the quantizer value to jump around more,
+higher values force it to vary more smoothly.
+cplx_blur ensures that each I-frame has quality comparable to the following
+P-frames, and ensures that alternating high and low complexity frames
+(e.g. low fps animation) do not waste bits on fluctuating quantizer.
+.
+.TP
.B qblur=<0\-99>
-Temporal blur of the quantization parameter (default: 0.5).
+Temporal blur of the quantization parameter, after curve compression
+(default: 0.5).
Lower values allow the quantizer value to jump around more,
higher values force it to vary more smoothly.
.
.TP
-.B (no)fullinter
+.B (no)4x4mv
Use all available interframe macroblock types (i16x16, i4x4, p16x16,
p16x8, p8x16, p8x8, p8x4, p4x8, p4x4, pskip)
The idea is to find the type and size that best describe a certain area
Index: libmpcodecs/ve_x264.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_x264.c,v
retrieving revision 1.8
diff -u -r1.8 ve_x264.c
--- libmpcodecs/ve_x264.c 17 Oct 2004 17:59:38 -0000 1.8
+++ libmpcodecs/ve_x264.c 17 Nov 2004 18:28:36 -0000
@@ -49,6 +49,10 @@
#include <x264.h>
+#if X264_BUILD < 0x000c
+#error We do not support old versions of x264. Get the latest from SVN.
+#endif
+
typedef struct _h264_module_t {
muxer_stream_t *mux;
x264_param_t param;
@@ -70,9 +74,9 @@
static int deblockbeta = 0;
static int cabac = 1;
static int cabacidc = -1;
-static int fullinter = 0;
-static float ip_factor = 2.0;
-static float pb_factor = 2.0;
+static int p4x4mv = 0;
+static float ip_factor = 1.4;
+static float pb_factor = 1.4;
static int rc_buffer_size = -1;
static int rc_init_buffer = -1;
static int rc_sens = 4;
@@ -82,7 +86,8 @@
static int pass = 0;
static float qcomp = 0.6;
static float qblur = 0.5;
-static char *rc_eq = "(tex^qComp)*(avgTex^(1-qComp))";
+static float complexity_blur = 20;
+static char *rc_eq = "tex*blurTex^(qComp-1)";
static int subq = 1;
static int psnr = 0;
static int log_level = 2;
@@ -102,8 +107,8 @@
{"cabac", &cabac, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"nocabac", &cabac, CONF_TYPE_FLAG, 0, 1, 0, NULL},
{"cabacidc", &cabacidc, CONF_TYPE_INT, CONF_RANGE, -1, 2, NULL},
- {"fullinter", &fullinter, CONF_TYPE_FLAG, 0, 0, 1, NULL},
- {"nofullinter", &fullinter, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+ {"4x4mv", &p4x4mv, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+ {"no4x4mv", &p4x4mv, CONF_TYPE_FLAG, 0, 1, 0, NULL},
{"ip_factor", &ip_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL},
{"pb_factor", &pb_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL},
{"rc_buffer_size", &rc_buffer_size, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL},
@@ -116,6 +121,7 @@
{"rc_eq", &rc_eq, CONF_TYPE_STRING, 0, 0, 0, NULL},
{"qcomp", &qcomp, CONF_TYPE_FLOAT, CONF_RANGE, 0, 1, NULL},
{"qblur", &qblur, CONF_TYPE_FLOAT, CONF_RANGE, 0, 99, NULL},
+ {"cplx_blur", &complexity_blur, CONF_TYPE_FLOAT, CONF_RANGE, 0, 999, NULL},
{"subq", &subq, CONF_TYPE_INT, CONF_RANGE, 0, 5, NULL},
{"psnr", &psnr, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"nopsnr", &psnr, CONF_TYPE_FLAG, 0, 1, 0, NULL},
@@ -153,6 +159,7 @@
mod->param.rc.psz_rc_eq = rc_eq;
mod->param.rc.f_qcompress = qcomp;
mod->param.rc.f_qblur = qblur;
+ mod->param.rc.f_complexity_blur = complexity_blur;
mod->param.analyse.i_subpel_refine = subq;
mod->param.rc.psz_stat_out = passtmpfile;
mod->param.rc.psz_stat_in = passtmpfile;
@@ -191,7 +198,7 @@
mod->param.rc.i_rc_init_buffer = rc_init_buffer;
mod->param.rc.i_rc_sens = rc_sens;
}
- if(fullinter)
+ if(p4x4mv)
mod->param.analyse.inter = X264_ANALYSE_I4x4 | X264_ANALYSE_PSUB16x16 | X264_ANALYSE_PSUB8x8;
mod->param.rc.f_ip_factor = ip_factor;
mod->param.rc.f_pb_factor = pb_factor;
More information about the MPlayer-dev-eng
mailing list