]> granicus.if.org Git - libvpx/commitdiff
Update to vpx_temporal_svc_encoder command line.
authorMarco <marpan@google.com>
Mon, 3 Oct 2016 16:47:21 +0000 (09:47 -0700)
committerMarco <marpan@google.com>
Mon, 3 Oct 2016 16:49:15 +0000 (09:49 -0700)
Set the  #threads at command line.

Change-Id: Id0daa2393880c3da2d903c11a793072d3008b34b

examples/vpx_temporal_svc_encoder.c

index 309a2fe2e2b23b9b3fa406f1ec0207f853bec6ea..752c1baead16ca78de0e36fedd061e94deaff969 100644 (file)
@@ -514,7 +514,7 @@ int main(int argc, char **argv) {
   FILE *infile = NULL;
   struct RateControlMetrics rc;
   int64_t cx_time = 0;
-  const int min_args_base = 11;
+  const int min_args_base = 12;
 #if CONFIG_VP9_HIGHBITDEPTH
   vpx_bit_depth_t bit_depth = VPX_BITS_8;
   int input_bit_depth = 8;
@@ -531,12 +531,12 @@ int main(int argc, char **argv) {
   if (argc < min_args) {
 #if CONFIG_VP9_HIGHBITDEPTH
     die("Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
-        "<rate_num> <rate_den> <speed> <frame_drop_threshold> <mode> "
+        "<rate_num> <rate_den> <speed> <frame_drop_threshold> <threads> <mode> "
         "<Rate_0> ... <Rate_nlayers-1> <bit-depth> \n",
         argv[0]);
 #else
     die("Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
-        "<rate_num> <rate_den> <speed> <frame_drop_threshold> <mode> "
+        "<rate_num> <rate_den> <speed> <frame_drop_threshold> <threads> <mode> "
         "<Rate_0> ... <Rate_nlayers-1> \n",
         argv[0]);
 #endif  // CONFIG_VP9_HIGHBITDEPTH
@@ -553,9 +553,9 @@ int main(int argc, char **argv) {
     die("Invalid resolution: %d x %d", width, height);
   }
 
-  layering_mode = (int)strtol(argv[10], NULL, 0);
+  layering_mode = (int)strtol(argv[11], NULL, 0);
   if (layering_mode < 0 || layering_mode > 13) {
-    die("Invalid layering mode (0..12) %s", argv[10]);
+    die("Invalid layering mode (0..12) %s", argv[11]);
   }
 
   if (argc != min_args + mode_to_num_layers[layering_mode]) {
@@ -619,11 +619,11 @@ int main(int argc, char **argv) {
 
   for (i = min_args_base;
        (int)i < min_args_base + mode_to_num_layers[layering_mode]; ++i) {
-    rc.layer_target_bitrate[i - 11] = (int)strtol(argv[i], NULL, 0);
+    rc.layer_target_bitrate[i - 12] = (int)strtol(argv[i], NULL, 0);
     if (strncmp(encoder->name, "vp8", 3) == 0)
-      cfg.ts_target_bitrate[i - 11] = rc.layer_target_bitrate[i - 11];
+      cfg.ts_target_bitrate[i - 12] = rc.layer_target_bitrate[i - 12];
     else if (strncmp(encoder->name, "vp9", 3) == 0)
-      cfg.layer_target_bitrate[i - 11] = rc.layer_target_bitrate[i - 11];
+      cfg.layer_target_bitrate[i - 12] = rc.layer_target_bitrate[i - 12];
   }
 
   // Real time parameters.
@@ -642,7 +642,7 @@ int main(int argc, char **argv) {
   cfg.rc_resize_allowed = 0;
 
   // Use 1 thread as default.
-  cfg.g_threads = 1;
+  cfg.g_threads = (unsigned int)strtoul(argv[10], NULL, 0);
 
   // Enable error resilient mode.
   cfg.g_error_resilient = 1;