changeset 13965:b825bd2efe14

sync to x264 r61 (improved 2pass ratecontrol) rename option 'fullinter' to '4x4mv'
author lorenm
date Thu, 18 Nov 2004 07:16:02 +0000
parents 1df275df47d5
children 739103434927
files DOCS/man/en/mplayer.1 libmpcodecs/ve_x264.c
diffstat 2 files changed, 34 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Wed Nov 17 19:58:47 2004 +0000
+++ b/DOCS/man/en/mplayer.1	Thu Nov 18 07:16:02 2004 +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,18 +7147,29 @@
 more constant.
 .
 .TP
-.B qblur=<0\-99>
-Temporal blur of the quantization parameter (default: 0.5).
+.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.
-.
-.TP
-.B (no)fullinter
+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, 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)4x4mv
 Use all available interframe macroblock types (i16x16, i4x4, p16x16,
-p16x8, p8x16, p8x8, p8x4, p4x8, p4x4, pskip)
+p16x8, p8x16, p8x8, p8x4, p4x8, p4x4, skip)
 The idea is to find the type and size that best describe a certain area
 of the picture, i.e.\& very effective for Anime, which usually contains
-large areas of the same color (default: i16x16, i4x4, p16x16-8x8).
+large areas of the same color (default: i16x16, i4x4, p16x16-8x8, skip).
 Depending on the source material, it can improve or degrade quality, use
 it with care.
 .
--- a/libmpcodecs/ve_x264.c	Wed Nov 17 19:58:47 2004 +0000
+++ b/libmpcodecs/ve_x264.c	Thu Nov 18 07:16:02 2004 +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;