Commit 7a3f4b35 authored by Fergus Simpson's avatar Fergus Simpson

scaling: Fix scaling numerator arguments for KFs

0835e7b80 left out the required changes to aomenc.c for the KF numerator
arguments for resize and superres to work. This patch adds them.

Change-Id: I350b01c8b187188de5313fffaa15c1ec9f052469
parent 9c6f8547
...@@ -275,17 +275,22 @@ static const arg_def_t resize_mode = ...@@ -275,17 +275,22 @@ static const arg_def_t resize_mode =
ARG_DEF(NULL, "resize-mode", 1, "Frame resize mode"); ARG_DEF(NULL, "resize-mode", 1, "Frame resize mode");
static const arg_def_t resize_numerator = static const arg_def_t resize_numerator =
ARG_DEF(NULL, "resize-numerator", 1, "Frame resize numerator"); ARG_DEF(NULL, "resize-numerator", 1, "Frame resize numerator");
static const struct arg_enum_list end_usage_enum[] = { { "vbr", AOM_VBR }, static const arg_def_t resize_kf_numerator =
{ "cbr", AOM_CBR }, ARG_DEF(NULL, "resize-kf-numerator", 1, "Frame resize keyframe numerator");
{ "cq", AOM_CQ },
{ "q", AOM_Q },
{ NULL, 0 } };
#if CONFIG_FRAME_SUPERRES #if CONFIG_FRAME_SUPERRES
static const arg_def_t superres_mode = static const arg_def_t superres_mode =
ARG_DEF(NULL, "superres-mode", 1, "Frame super-resolution mode"); ARG_DEF(NULL, "superres-mode", 1, "Frame super-resolution mode");
static const arg_def_t superres_numerator = static const arg_def_t superres_numerator =
ARG_DEF(NULL, "superres-numerator", 1, "Frame super-resolution numerator"); ARG_DEF(NULL, "superres-numerator", 1, "Frame super-resolution numerator");
static const arg_def_t superres_kf_numerator =
ARG_DEF(NULL, "superres-kf-numerator", 1,
"Frame super-resolution keyframe numerator");
#endif // CONFIG_FRAME_SUPERRES #endif // CONFIG_FRAME_SUPERRES
static const struct arg_enum_list end_usage_enum[] = { { "vbr", AOM_VBR },
{ "cbr", AOM_CBR },
{ "cq", AOM_CQ },
{ "q", AOM_Q },
{ NULL, 0 } };
static const arg_def_t end_usage = static const arg_def_t end_usage =
ARG_DEF_ENUM(NULL, "end-usage", 1, "Rate control mode", end_usage_enum); ARG_DEF_ENUM(NULL, "end-usage", 1, "Rate control mode", end_usage_enum);
static const arg_def_t target_bitrate = static const arg_def_t target_bitrate =
...@@ -304,16 +309,25 @@ static const arg_def_t buf_initial_sz = ...@@ -304,16 +309,25 @@ static const arg_def_t buf_initial_sz =
ARG_DEF(NULL, "buf-initial-sz", 1, "Client initial buffer size (ms)"); ARG_DEF(NULL, "buf-initial-sz", 1, "Client initial buffer size (ms)");
static const arg_def_t buf_optimal_sz = static const arg_def_t buf_optimal_sz =
ARG_DEF(NULL, "buf-optimal-sz", 1, "Client optimal buffer size (ms)"); ARG_DEF(NULL, "buf-optimal-sz", 1, "Client optimal buffer size (ms)");
static const arg_def_t *rc_args[] = { &dropframe_thresh, &resize_mode, static const arg_def_t *rc_args[] = { &dropframe_thresh,
&resize_mode,
&resize_numerator, &resize_numerator,
&resize_kf_numerator,
#if CONFIG_FRAME_SUPERRES #if CONFIG_FRAME_SUPERRES
&superres_mode, &superres_numerator, &superres_mode,
&superres_numerator,
&superres_kf_numerator,
#endif // CONFIG_FRAME_SUPERRES #endif // CONFIG_FRAME_SUPERRES
&end_usage, &target_bitrate, &end_usage,
&min_quantizer, &max_quantizer, &target_bitrate,
&undershoot_pct, &overshoot_pct, &min_quantizer,
&buf_sz, &buf_initial_sz, &max_quantizer,
&buf_optimal_sz, NULL }; &undershoot_pct,
&overshoot_pct,
&buf_sz,
&buf_initial_sz,
&buf_optimal_sz,
NULL };
static const arg_def_t bias_pct = static const arg_def_t bias_pct =
ARG_DEF(NULL, "bias-pct", 1, "CBR/VBR bias (0=CBR, 100=VBR)"); ARG_DEF(NULL, "bias-pct", 1, "CBR/VBR bias (0=CBR, 100=VBR)");
...@@ -1009,11 +1023,15 @@ static int parse_stream_params(struct AvxEncoderConfig *global, ...@@ -1009,11 +1023,15 @@ static int parse_stream_params(struct AvxEncoderConfig *global,
config->cfg.rc_resize_mode = arg_parse_uint(&arg); config->cfg.rc_resize_mode = arg_parse_uint(&arg);
} else if (arg_match(&arg, &resize_numerator, argi)) { } else if (arg_match(&arg, &resize_numerator, argi)) {
config->cfg.rc_resize_numerator = arg_parse_uint(&arg); config->cfg.rc_resize_numerator = arg_parse_uint(&arg);
} else if (arg_match(&arg, &resize_kf_numerator, argi)) {
config->cfg.rc_resize_kf_numerator = arg_parse_uint(&arg);
#if CONFIG_FRAME_SUPERRES #if CONFIG_FRAME_SUPERRES
} else if (arg_match(&arg, &superres_mode, argi)) { } else if (arg_match(&arg, &superres_mode, argi)) {
config->cfg.rc_superres_mode = arg_parse_uint(&arg); config->cfg.rc_superres_mode = arg_parse_uint(&arg);
} else if (arg_match(&arg, &superres_numerator, argi)) { } else if (arg_match(&arg, &superres_numerator, argi)) {
config->cfg.rc_superres_numerator = arg_parse_uint(&arg); config->cfg.rc_superres_numerator = arg_parse_uint(&arg);
} else if (arg_match(&arg, &superres_kf_numerator, argi)) {
config->cfg.rc_superres_kf_numerator = arg_parse_uint(&arg);
#endif // CONFIG_FRAME_SUPERRES #endif // CONFIG_FRAME_SUPERRES
} else if (arg_match(&arg, &end_usage, argi)) { } else if (arg_match(&arg, &end_usage, argi)) {
config->cfg.rc_end_usage = arg_parse_enum_or_int(&arg); config->cfg.rc_end_usage = arg_parse_enum_or_int(&arg);
...@@ -1218,9 +1236,11 @@ static void show_stream_config(struct stream_state *stream, ...@@ -1218,9 +1236,11 @@ static void show_stream_config(struct stream_state *stream,
SHOW(rc_dropframe_thresh); SHOW(rc_dropframe_thresh);
SHOW(rc_resize_mode); SHOW(rc_resize_mode);
SHOW(rc_resize_numerator); SHOW(rc_resize_numerator);
SHOW(rc_resize_kf_numerator);
#if CONFIG_FRAME_SUPERRES #if CONFIG_FRAME_SUPERRES
SHOW(rc_superres_mode); SHOW(rc_superres_mode);
SHOW(rc_superres_numerator); SHOW(rc_superres_numerator);
SHOW(rc_superres_kf_numerator);
#endif // CONFIG_FRAME_SUPERRES #endif // CONFIG_FRAME_SUPERRES
SHOW(rc_end_usage); SHOW(rc_end_usage);
SHOW(rc_target_bitrate); SHOW(rc_target_bitrate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment