]> granicus.if.org Git - libvpx/commitdiff
vp9-svc: add more command line options to test app.
authorSergey Silkin <ssilkin@google.com>
Thu, 28 Jun 2018 09:00:00 +0000 (11:00 +0200)
committerSergey Silkin <ssilkin@google.com>
Wed, 4 Jul 2018 08:03:54 +0000 (08:03 +0000)
This adds the following command line options to
vp9_spatial_svc_encoder test app:
--drop-frame=<arg>        Temporal resampling threshold (buf %)
--tune-content=<arg>      Tune content type default, screen, film
--inter-layer-pred=<arg>  0 - 3: On, Off, Key-frames, Constrained

Change-Id: I653d1924fb6e525edb2d1e84739be0b88e773e1c

examples/vp9_spatial_svc_encoder.c
vpx/src/svc_encodeframe.c

index 053ba4f2ae58c89c8f05c3349e8cef66ce4bf444..f22eb4e6fe9e7e307681207980d89226e01bfca0 100644 (file)
@@ -86,6 +86,19 @@ static const arg_def_t aqmode_arg =
     ARG_DEF("aq", "aqmode", 1, "aq-mode off/on");
 static const arg_def_t bitrates_arg =
     ARG_DEF("bl", "bitrates", 1, "bitrates[sl * num_tl + tl]");
+static const arg_def_t dropframe_thresh_arg =
+    ARG_DEF(NULL, "drop-frame", 1, "Temporal resampling threshold (buf %)");
+static const struct arg_enum_list tune_content_enum[] = {
+  { "default", VP9E_CONTENT_DEFAULT },
+  { "screen", VP9E_CONTENT_SCREEN },
+  { "film", VP9E_CONTENT_FILM },
+  { NULL, 0 }
+};
+
+static const arg_def_t tune_content_arg = ARG_DEF_ENUM(
+    NULL, "tune-content", 1, "Tune content type", tune_content_enum);
+static const arg_def_t inter_layer_pred_arg = ARG_DEF(
+    NULL, "inter-layer-pred", 1, "0 - 3: On, Off, Key-frames, Constrained");
 
 #if CONFIG_VP9_HIGHBITDEPTH
 static const struct arg_enum_list bitdepth_enum[] = {
@@ -127,6 +140,9 @@ static const arg_def_t *svc_args[] = { &frames_arg,
                                        &speed_arg,
                                        &rc_end_usage_arg,
                                        &bitrates_arg,
+                                       &dropframe_thresh_arg,
+                                       &tune_content_arg,
+                                       &inter_layer_pred_arg,
                                        NULL };
 
 static const uint32_t default_frames_to_skip = 0;
@@ -153,6 +169,8 @@ typedef struct {
   stats_io_t rc_stats;
   int passes;
   int pass;
+  int tune_content;
+  int inter_layer_pred;
 } AppInput;
 
 static const char *exec_name;
@@ -311,6 +329,12 @@ static void parse_command_line(int argc, const char **argv_,
           break;
       }
 #endif  // CONFIG_VP9_HIGHBITDEPTH
+    } else if (arg_match(&arg, &dropframe_thresh_arg, argi)) {
+      enc_cfg->rc_dropframe_thresh = arg_parse_uint(&arg);
+    } else if (arg_match(&arg, &tune_content_arg, argi)) {
+      app_input->tune_content = arg_parse_uint(&arg);
+    } else if (arg_match(&arg, &inter_layer_pred_arg, argi)) {
+      app_input->inter_layer_pred = arg_parse_uint(&arg);
     } else {
       ++argj;
     }
@@ -735,11 +759,12 @@ int main(int argc, const char **argv) {
     vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1);
   vpx_codec_control(&codec, VP8E_SET_MAX_INTRA_BITRATE_PCT, 900);
 
-  vpx_codec_control(&codec, VP9E_SET_SVC_INTER_LAYER_PRED, 0);
+  vpx_codec_control(&codec, VP9E_SET_SVC_INTER_LAYER_PRED,
+                    app_input.inter_layer_pred);
 
   vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, 0);
 
-  vpx_codec_control(&codec, VP9E_SET_TUNE_CONTENT, 0);
+  vpx_codec_control(&codec, VP9E_SET_TUNE_CONTENT, app_input.tune_content);
 
   svc_drop_frame.framedrop_mode = FULL_SUPERFRAME_DROP;
   for (sl = 0; sl < (unsigned int)svc_ctx.spatial_layers; ++sl)
index 7641a191e334ea89a717f06c824c6f09fbfa6d79..4e9f1a40ec6dad630171e5208e52cca93c048c72 100644 (file)
@@ -495,7 +495,6 @@ vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
     enc_cfg->rc_buf_initial_sz = 500;
     enc_cfg->rc_buf_optimal_sz = 600;
     enc_cfg->rc_buf_sz = 1000;
-    enc_cfg->rc_dropframe_thresh = 0;
   }
 
   if (enc_cfg->g_error_resilient == 0 && si->use_multiple_frame_contexts == 0)