[MPlayer-cvslog] CVS: main/libmpcodecs ve_x264.c,1.25,1.26

Loren Merritt CVS syncmail at mplayerhq.hu
Wed May 11 18:00:15 CEST 2005


CVS change done by Loren Merritt CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv14638/libmpcodecs

Modified Files:
	ve_x264.c 
Log Message:
sync to x264 rev223 (options: ratetol, vbv_*)


Index: ve_x264.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_x264.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- ve_x264.c	5 May 2005 17:10:16 -0000	1.25
+++ ve_x264.c	11 May 2005 16:00:12 -0000	1.26
@@ -62,7 +62,7 @@
 static int qp_constant = 26;
 static int frame_ref = 1;
 static int keyint_max = 250;
-static int keyint_min = -1;
+static int keyint_min = 25;
 static int scenecut_threshold = 40;
 static int bframe = 0;
 static int bframe_adaptive = 1;
@@ -81,12 +81,13 @@
 static int chroma_qp_offset = 0;
 static float ip_factor = 1.4;
 static float pb_factor = 1.3;
-static int rc_buffer_size = -1;
-static float rc_init_buffer = 0.25;
-static int rc_sens = 4;
+static float ratetol = 1.0;
+static int vbv_maxrate = 0;
+static int vbv_bufsize = 0;
+static float vbv_init = 0.9;
 static int qp_min = 10;
 static int qp_max = 51;
-static int qp_step = 1;
+static int qp_step = 2;
 static int pass = 0;
 static float qcomp = 0.6;
 static float qblur = 0.5;
@@ -132,9 +133,10 @@
     {"chroma_qp_offset", &chroma_qp_offset, CONF_TYPE_INT, CONF_RANGE, -12, 12, 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},
-    {"rc_init_buffer", &rc_init_buffer, CONF_TYPE_FLOAT, CONF_RANGE, 0, 24000000, NULL},
-    {"rc_sens", &rc_sens, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL},
+    {"ratetol", &ratetol, CONF_TYPE_FLOAT, CONF_RANGE, 0.1, 100.0, NULL},
+    {"vbv_maxrate", &vbv_maxrate, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL},
+    {"vbv_bufsize", &vbv_bufsize, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL},
+    {"vbv_init", &vbv_init, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 1.0, NULL},
     {"qp_min", &qp_min, CONF_TYPE_INT, CONF_RANGE, 1, 51, NULL},
     {"qp_max", &qp_max, CONF_TYPE_INT, CONF_RANGE, 1, 51, NULL},
     {"qp_step", &qp_step, CONF_TYPE_INT, CONF_RANGE, 1, 50, NULL},
@@ -165,7 +167,7 @@
     x264_param_default(&mod->param);
     mod->param.i_frame_reference = frame_ref;
     mod->param.i_keyint_max = keyint_max;
-    mod->param.i_keyint_min = keyint_min > 0 ? keyint_min : keyint_max * 2 / 5;
+    mod->param.i_keyint_min = keyint_min;
     mod->param.i_scenecut_threshold = scenecut_threshold;
     mod->param.i_bframe = bframe;
     mod->param.b_bframe_adaptive = bframe_adaptive;
@@ -189,6 +191,7 @@
     mod->param.rc.f_qblur = qblur;
     mod->param.rc.f_complexity_blur = complexity_blur;
     mod->param.analyse.i_subpel_refine = subq;
+    mod->param.analyse.i_me_method = subq==1 ? X264_ME_DIA : X264_ME_HEX;
     mod->param.rc.psz_stat_out = passtmpfile;
     mod->param.rc.psz_stat_in = passtmpfile;
     if((pass & 2) && bitrate <= 0)
@@ -216,16 +219,17 @@
         break;
     }
     if(bitrate > 0) {
-        if(rc_buffer_size <= 0)
-            rc_buffer_size = bitrate;
+        if((vbv_maxrate > 0) != (vbv_bufsize > 0)) {
+            mp_msg(MSGT_MENCODER, MSGL_ERR,
+                   "VBV requires both vbv_maxrate and vbv_bufsize.\n");
+            return 0;
+        }
         mod->param.rc.b_cbr = 1;
         mod->param.rc.i_bitrate = bitrate;
-        mod->param.rc.i_rc_buffer_size = rc_buffer_size;
-        if(rc_init_buffer > 1)
-            mod->param.rc.i_rc_init_buffer = rc_init_buffer;
-        else
-            mod->param.rc.i_rc_init_buffer = rc_buffer_size * rc_init_buffer;
-        mod->param.rc.i_rc_sens = rc_sens;
+        mod->param.rc.f_rate_tolerance = ratetol;
+        mod->param.rc.i_vbv_max_bitrate = vbv_maxrate;
+        mod->param.rc.i_vbv_buffer_size = vbv_bufsize;
+        mod->param.rc.f_vbv_buffer_init = vbv_init;
     }
     mod->param.rc.f_ip_factor = ip_factor;
     mod->param.rc.f_pb_factor = pb_factor;




More information about the MPlayer-cvslog mailing list