From d693439beda46732410ecc7b3945132e4ab01511 Mon Sep 17 00:00:00 2001 From: angiebird Date: Thu, 24 Oct 2019 13:59:00 -0700 Subject: [PATCH] Add rate_ctrl flag BDRate Changes (negative means improvement) lowres: 0.565% midres: 0.361% lowres: 0.233% ugc360: -0.242% Make gop size independent from coding results Change-Id: I1f54c48b12dc45ee5162ca2527a877c1610528bd --- configure | 1 + vp9/encoder/vp9_firstpass.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/configure b/configure index 4f58161..79a1b33 100755 --- a/configure +++ b/configure @@ -272,6 +272,7 @@ EXPERIMENT_LIST=" fp_mb_stats emulate_hardware non_greedy_mv + rate_ctrl " CONFIG_LIST=" dependency_tracking diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 3554f48..f026160 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -2580,6 +2580,21 @@ static RANGE get_active_gf_inverval_range( const FRAME_INFO *frame_info, const RATE_CONTROL *rc, int arf_active_or_kf, int gf_start_show_idx, int active_worst_quality, int last_boosted_qindex) { RANGE active_gf_interval; +#if CONFIG_RATE_CTRL + (void)frame_info; + (void)gf_start_show_idx; + (void)active_worst_quality; + (void)last_boosted_qindex; + active_gf_interval.min = rc->min_gf_interval + arf_active_or_kf + 2; + + active_gf_interval.max = 16 + arf_active_or_kf; + + if ((active_gf_interval.max <= rc->frames_to_key) && + (active_gf_interval.max >= (rc->frames_to_key - rc->min_gf_interval))) { + active_gf_interval.min = rc->frames_to_key / 2; + active_gf_interval.max = rc->frames_to_key / 2; + } +#else int int_max_q = (int)(vp9_convert_qindex_to_q(active_worst_quality, frame_info->bit_depth)); int q_term = (gf_start_show_idx == 0) @@ -2617,6 +2632,7 @@ static RANGE get_active_gf_inverval_range( } active_gf_interval.max = VPXMAX(active_gf_interval.max, active_gf_interval.min); +#endif return active_gf_interval; } -- 2.7.4