ref: d6bbda4bc20db9091aa5d17589cfc2676c63a632
parent: 15cc8bc72f978c5dd1605f59f9dca0932e1c47f6
author: Marco <[email protected]>
date: Thu Oct 15 05:01:47 EDT 2015
Fix resetting of cyclic refresh on dynamic resize change. Put the reset at the right place, during the setup and prior to updating the map. Change-Id: I75e550ae9d8cc15081330b8857edc04c23947875
--- a/vp9/encoder/vp9_aq_cyclicrefresh.c
+++ b/vp9/encoder/vp9_aq_cyclicrefresh.c
@@ -571,6 +571,10 @@
cr->qindex_delta[2] = qindex_delta;
vp9_set_segdata(seg, CR_SEGMENT_ID_BOOST2, SEG_LVL_ALT_Q, qindex_delta);
+ // Reset if resoluton change has occurred.
+ if (cpi->resize_pending != 0)
+ vp9_cyclic_refresh_reset_resize(cpi);
+
// Update the segmentation and refresh map.
cyclic_refresh_update_map(cpi);
}
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -1905,9 +1905,6 @@
rc->buffer_level = rc->optimal_buffer_level;
rc->bits_off_target = rc->optimal_buffer_level;
rc->this_frame_target = calc_pframe_target_size_one_pass_cbr(cpi);
- // Reset cyclic refresh parameters.
- if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled)
- vp9_cyclic_refresh_reset_resize(cpi);
// Get the projected qindex, based on the scaled target frame size (scaled
// so target_bits_per_mb in vp9_rc_regulate_q will be correct target).
target_bits_per_frame = (resize_action >= 0) ?