From d8b8d87eb77571abe5c7643f368b6deddec2c837 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Tue, 1 Apr 2014 15:52:38 -0700 Subject: [PATCH] Make frame level quantization change a parameter Parameterize the frame level quantization index used in non-RD coding flow with cbr. Change-Id: I79cfbd9c32c0d0fc33ad720d2180432e910baf7a --- vp9/encoder/vp9_ratectrl.c | 2 +- vp9/encoder/vp9_speed_features.c | 2 ++ vp9/encoder/vp9_speed_features.h | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index e39c18cd6..768f3682f 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -986,7 +986,7 @@ int vp9_rc_pick_q_and_bounds(const VP9_COMP *cpi, if (q == 0) q++; if (cpi->sf.force_ref_frame == 1) - q -= 15; + q -= cpi->sf.max_delta_qindex; if (q < *bottom_index) *bottom_index = q; diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c index 6a5c4e998..3629f76ce 100644 --- a/vp9/encoder/vp9_speed_features.c +++ b/vp9/encoder/vp9_speed_features.c @@ -254,6 +254,7 @@ static void set_rt_speed_feature(VP9_COMMON *cm, sf->force_ref_frame = (cm->current_video_frame % (sf->last_partitioning_redo_frequency << 1) == 1); + sf->max_delta_qindex = 15; sf->partition_search_type = REFERENCE_PARTITION; sf->use_nonrd_pick_mode = 1; sf->search_method = FAST_DIAMOND; @@ -307,6 +308,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) { sf->disable_split_mask = 0; sf->mode_search_skip_flags = 0; sf->force_ref_frame = 0; + sf->max_delta_qindex = 0; sf->disable_split_var_thresh = 0; sf->disable_filter_search_var_thresh = 0; for (i = 0; i < TX_SIZES; i++) { diff --git a/vp9/encoder/vp9_speed_features.h b/vp9/encoder/vp9_speed_features.h index 78bf40f45..ed0eb3d46 100644 --- a/vp9/encoder/vp9_speed_features.h +++ b/vp9/encoder/vp9_speed_features.h @@ -256,6 +256,9 @@ typedef struct { // partition type search. int force_ref_frame; + // Maximally allowed base quantization index fluctuation. + int max_delta_qindex; + // Implements various heuristics to skip searching modes // The heuristics selected are based on flags // defined in the MODE_SEARCH_SKIP_HEURISTICS enum -- 2.40.0