From c94dacc23171366b3abd83850963c05debe8277b Mon Sep 17 00:00:00 2001 From: Sergey Silkin Date: Thu, 28 Jun 2018 11:00:00 +0200 Subject: [PATCH] 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= Temporal resampling threshold (buf %) --tune-content= Tune content type default, screen, film --inter-layer-pred= 0 - 3: On, Off, Key-frames, Constrained Change-Id: I653d1924fb6e525edb2d1e84739be0b88e773e1c --- examples/vp9_spatial_svc_encoder.c | 29 +++++++++++++++++++++++++++-- vpx/src/svc_encodeframe.c | 1 - 2 files changed, 27 insertions(+), 3 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) diff --git a/vpx/src/svc_encodeframe.c b/vpx/src/svc_encodeframe.c index 7641a191e..4e9f1a40e 100644 --- a/vpx/src/svc_encodeframe.c +++ b/vpx/src/svc_encodeframe.c @@ -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) -- 2.40.0