changeset 14307:2e35259a1558

change rc_init_buffer to be a fraction of total buffer size. disallow qp_step=0.
author lorenm
date Sun, 02 Jan 2005 22:35:37 +0000
parents 11a33796997c
children 32e8aa98601f
files libmpcodecs/ve_x264.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ve_x264.c	Sun Jan 02 21:20:24 2005 +0000
+++ b/libmpcodecs/ve_x264.c	Sun Jan 02 22:35:37 2005 +0000
@@ -80,7 +80,7 @@
 static float ip_factor = 1.4;
 static float pb_factor = 1.3;
 static int rc_buffer_size = -1;
-static int rc_init_buffer = -1;
+static float rc_init_buffer = 0.25;
 static int rc_sens = 4;
 static int qp_min = 10;
 static int qp_max = 51;
@@ -117,11 +117,11 @@
     {"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_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},
     {"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, 0, 50, NULL},
+    {"qp_step", &qp_step, CONF_TYPE_INT, CONF_RANGE, 1, 50, NULL},
     {"pass", &pass, CONF_TYPE_INT, CONF_RANGE, 1, 3, NULL},
     {"rc_eq", &rc_eq, CONF_TYPE_STRING, 0, 0, 0, NULL},
     {"qcomp", &qcomp, CONF_TYPE_FLOAT, CONF_RANGE, 0, 1, NULL},
@@ -195,12 +195,13 @@
     if(bitrate > 0) {
         if(rc_buffer_size <= 0)
             rc_buffer_size = bitrate;
-        if(rc_init_buffer < 0)
-            rc_init_buffer = rc_buffer_size/4;
         mod->param.rc.b_cbr = 1;
         mod->param.rc.i_bitrate = bitrate;
         mod->param.rc.i_rc_buffer_size = rc_buffer_size;
-        mod->param.rc.i_rc_init_buffer = rc_init_buffer;
+        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_ip_factor = ip_factor;