summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_aq_cyclicrefresh.c
diff options
context:
space:
mode:
authorMarco <marpan@google.com>2016-02-12 10:29:26 -0800
committerMarco <marpan@google.com>2016-02-22 17:44:20 -0800
commita0278cad3f352e4d878f59ecf414f0af2badae8b (patch)
tree8c0a1e16cca1350965fa24d33b0e2e420b91f791 /vp9/encoder/vp9_aq_cyclicrefresh.c
parent034031d4aae9947d760309cf701c6f33b954e055 (diff)
downloadlibvpx-a0278cad3f352e4d878f59ecf414f0af2badae8b.tar
libvpx-a0278cad3f352e4d878f59ecf414f0af2badae8b.tar.gz
libvpx-a0278cad3f352e4d878f59ecf414f0af2badae8b.tar.bz2
libvpx-a0278cad3f352e4d878f59ecf414f0af2badae8b.zip
vp9 aq-mode=3: Allow it to be used for 1 pass VBR mode.
Change-Id: I630b8e33106c78382545d49da5fb4c75b1b0b528
Diffstat (limited to 'vp9/encoder/vp9_aq_cyclicrefresh.c')
-rw-r--r--vp9/encoder/vp9_aq_cyclicrefresh.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_aq_cyclicrefresh.c b/vp9/encoder/vp9_aq_cyclicrefresh.c
index 0a02bde99..c2ba27608 100644
--- a/vp9/encoder/vp9_aq_cyclicrefresh.c
+++ b/vp9/encoder/vp9_aq_cyclicrefresh.c
@@ -198,6 +198,9 @@ void vp9_cyclic_refresh_update_segment(VP9_COMP *const cpi,
refresh_this_block = 1;
}
+ if (cpi->oxcf.rc_mode == VPX_VBR && mi->ref_frame[0] == GOLDEN_FRAME)
+ refresh_this_block = 0;
+
// If this block is labeled for refresh, check if we should reset the
// segment_id.
if (cyclic_refresh_segment_id_boosted(mi->segment_id)) {
@@ -305,6 +308,8 @@ void vp9_cyclic_refresh_set_golden_update(VP9_COMP *const cpi) {
rc->baseline_gf_interval = VPXMIN(4 * (100 / cr->percent_refresh), 40);
else
rc->baseline_gf_interval = 40;
+ if (cpi->oxcf.rc_mode == VPX_VBR)
+ rc->baseline_gf_interval = 20;
}
// Update some encoding stats (from the just encoded frame). If this frame's
@@ -504,6 +509,18 @@ void vp9_cyclic_refresh_update_parameters(VP9_COMP *const cpi) {
cr->motion_thresh = 4;
cr->rate_boost_fac = 12;
}
+ if (cpi->oxcf.rc_mode == VPX_VBR) {
+ // To be adjusted for VBR mode, e.g., based on gf period and boost.
+ // For now use smaller qp-delta (than CBR), no second boosted seg, and
+ // turn-off (no refresh) on golden refresh (since it's already boosted).
+ cr->percent_refresh = 10;
+ cr->rate_ratio_qdelta = 1.5;
+ cr->rate_boost_fac = 10;
+ if (cpi->refresh_golden_frame == 1) {
+ cr->percent_refresh = 0;
+ cr->rate_ratio_qdelta = 1.0;
+ }
+ }
}
// Setup cyclic background refresh: set delta q and segmentation map.