]> git.sesse.net Git - x264/blobdiff - common/common.c
Merge speedcontrol.
[x264] / common / common.c
index 607aefdd160b9dc22eee9c1d13696bb54832a37f..645b1d31a16234e3303d39ea1c630cb405d10669 100644 (file)
@@ -122,6 +122,11 @@ void x264_param_default( x264_param_t *param )
     param->rc.i_zones = 0;
     param->rc.b_mb_tree = 1;
 
+    // speedcontrol
+    param->sc.f_speed = 0;
+    param->sc.i_buffer_size = 30;
+    param->sc.f_buffer_init = 0.75;
+
     /* Log */
     param->pf_log = x264_log_default;
     param->p_log_private = NULL;
@@ -1016,6 +1021,14 @@ int x264_param_parse( x264_param_t *p, const char *name, const char *value )
         p->rc.f_complexity_blur = atof(value);
     OPT("zones")
         p->rc.psz_zones = strdup(value);
+    OPT("speed")
+        p->sc.f_speed = atof(value);
+    OPT("speed-bufsize")
+        p->sc.i_buffer_size = atoi(value);
+    OPT("speed-init")
+        p->sc.f_buffer_init = atof(value);
+    OPT("speed-alt-timer")
+        p->sc.b_alt_timer = atobool(value);
     OPT("crop-rect")
         b_error |= sscanf( value, "%u,%u,%u,%u", &p->crop_rect.i_left, &p->crop_rect.i_top,
                                                  &p->crop_rect.i_right, &p->crop_rect.i_bottom ) != 4;
@@ -1333,6 +1346,9 @@ char *x264_param2string( x264_param_t *p, int b_res )
 
     if( p->b_opencl )
         s += sprintf( s, "opencl=%d ", p->b_opencl );
+
+    // FIXME speedcontrol stuff
+
     s += sprintf( s, "cabac=%d", p->b_cabac );
     s += sprintf( s, " ref=%d", p->i_frame_reference );
     s += sprintf( s, " deblock=%d:%d:%d", p->b_deblocking_filter,