summaryrefslogtreecommitdiff
path: root/examples/vp9_spatial_svc_encoder.c
diff options
context:
space:
mode:
authorSergey Silkin <ssilkin@google.com>2018-06-28 11:00:00 +0200
committerSergey Silkin <ssilkin@google.com>2018-07-04 08:03:54 +0000
commitc94dacc23171366b3abd83850963c05debe8277b (patch)
tree60fdbc0fac601911061f2608ecbb732cb63f1f96 /examples/vp9_spatial_svc_encoder.c
parent2f8a126f0ad62ddc94d75d02cdc65407e7da1d2f (diff)
downloadlibvpx-c94dacc23171366b3abd83850963c05debe8277b.tar
libvpx-c94dacc23171366b3abd83850963c05debe8277b.tar.gz
libvpx-c94dacc23171366b3abd83850963c05debe8277b.tar.bz2
libvpx-c94dacc23171366b3abd83850963c05debe8277b.zip
vp9-svc: add more command line options to test app.
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
Diffstat (limited to 'examples/vp9_spatial_svc_encoder.c')
-rw-r--r--examples/vp9_spatial_svc_encoder.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/examples/vp9_spatial_svc_encoder.c b/examples/vp9_spatial_svc_encoder.c
index 053ba4f2a..f22eb4e6f 100644
--- a/examples/vp9_spatial_svc_encoder.c
+++ b/examples/vp9_spatial_svc_encoder.c
@@ -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)