summaryrefslogtreecommitdiff
path: root/vp9/vp9_cx_iface.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/vp9_cx_iface.c')
-rw-r--r--vp9/vp9_cx_iface.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c
index 0623ad132..967431c0f 100644
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -168,6 +168,11 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
RANGE_CHECK_HI(cfg, rc_resize_down_thresh, 100);
RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_LAST_PASS);
+ if (cfg->rc_resize_allowed == 1) {
+ RANGE_CHECK(cfg, rc_scaled_width, 1, cfg->g_w);
+ RANGE_CHECK(cfg, rc_scaled_height, 1, cfg->g_h);
+ }
+
RANGE_CHECK(cfg, ss_number_layers, 1, VPX_SS_MAX_LAYERS);
RANGE_CHECK(cfg, ts_number_layers, 1, VPX_TS_MAX_LAYERS);
if (cfg->ts_number_layers > 1) {
@@ -332,6 +337,10 @@ static vpx_codec_err_t set_encoder_config(
oxcf->under_shoot_pct = cfg->rc_undershoot_pct;
oxcf->over_shoot_pct = cfg->rc_overshoot_pct;
+ oxcf->allow_spatial_resampling = cfg->rc_resize_allowed;
+ oxcf->scaled_frame_width = cfg->rc_scaled_width;
+ oxcf->scaled_frame_height = cfg->rc_scaled_height;
+
oxcf->maximum_buffer_size = cfg->rc_buf_sz;
oxcf->starting_buffer_level = cfg->rc_buf_initial_sz;
oxcf->optimal_buffer_level = cfg->rc_buf_optimal_sz;
@@ -410,6 +419,9 @@ static vpx_codec_err_t set_encoder_config(
printf("fixed_q: %d\n", oxcf->fixed_q);
printf("worst_allowed_q: %d\n", oxcf->worst_allowed_q);
printf("best_allowed_q: %d\n", oxcf->best_allowed_q);
+ printf("allow_spatial_resampling: %d\n", oxcf->allow_spatial_resampling);
+ printf("scaled_frame_width: %d\n", oxcf->scaled_frame_width);
+ printf("scaled_frame_height: %d\n", oxcf->scaled_frame_height);
printf("two_pass_vbrbias: %d\n", oxcf->two_pass_vbrbias);
printf("two_pass_vbrmin_section: %d\n", oxcf->two_pass_vbrmin_section);
printf("two_pass_vbrmax_section: %d\n", oxcf->two_pass_vbrmax_section);
@@ -1128,6 +1140,8 @@ static vpx_codec_enc_cfg_map_t encoder_usage_cfg_map[] = {
0, // rc_dropframe_thresh
0, // rc_resize_allowed
+ 1, // rc_scaled_width
+ 1, // rc_scaled_height
60, // rc_resize_down_thresold
30, // rc_resize_up_thresold