From 91fc730d831a46751fe5adb96f4897085b483313 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 9 Jan 2017 16:38:49 -0800 Subject: [PATCH] vp9: 1 pass cbr: Adjustments to usage of gf_cbr_boost and aq=3 mode. When aq=3 mode is on and the gf_cbr_boost is set: make sure golden frame is always refreshed, and don't incorporate segement cost in qp setting on the boosted golden frame. Better performance on RTC set with gf_cbr_boost on, for example with gf_cbr_boost=50, gains from ~0.5-3%. Change-Id: Ie811f5e4d444ff3320bd6e2c1745b2c4c09a8460 --- vp9/encoder/vp9_encoder.c | 3 ++- vp9/encoder/vp9_ratectrl.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c index 432eac8da..37cf8257a 100644 --- a/vp9/encoder/vp9_encoder.c +++ b/vp9/encoder/vp9_encoder.c @@ -3247,7 +3247,8 @@ static void encode_without_recode_loop(VP9_COMP *cpi, size_t *size, // golden reference, for non-SVC 1 pass CBR. if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->frame_type != KEY_FRAME && !cpi->use_svc && cpi->ext_refresh_frame_flags_pending == 0 && - (cpi->oxcf.pass == 0 && cpi->oxcf.rc_mode == VPX_CBR)) + (cpi->oxcf.pass == 0 && cpi->oxcf.rc_mode == VPX_CBR && + !cpi->oxcf.gf_cbr_boost_pct)) vp9_cyclic_refresh_check_golden_update(cpi); // Update the skip mb flag probabilities based on the distribution diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 02059a705..3a5abfa20 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -537,7 +537,8 @@ int vp9_rc_regulate_q(const VP9_COMP *cpi, int target_bits_per_frame, do { if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled && - cpi->svc.temporal_layer_id == 0) { + cpi->svc.temporal_layer_id == 0 && + (!cpi->oxcf.gf_cbr_boost_pct || !cpi->refresh_golden_frame)) { bits_per_mb_at_this_q = (int)vp9_cyclic_refresh_rc_bits_per_mb(cpi, i, correction_factor); } else { -- 2.40.0