summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorJerome Jiang <jianj@google.com>2018-06-05 15:21:29 -0700
committerMarco Paniconi <marpan@google.com>2018-06-05 22:31:16 -0700
commit87386826a95fda953162050a27f2506d8c1f3db5 (patch)
tree22606883de3db4f4b9df56667b7961962b431405 /vp9/encoder
parentd5bd2809f1eaf93203f8bad385f2b02fd03b01e7 (diff)
downloadlibvpx-87386826a95fda953162050a27f2506d8c1f3db5.tar
libvpx-87386826a95fda953162050a27f2506d8c1f3db5.tar.gz
libvpx-87386826a95fda953162050a27f2506d8c1f3db5.tar.bz2
libvpx-87386826a95fda953162050a27f2506d8c1f3db5.zip
vp9: Move up reset of cyclic refresh under dynamic resize.
When resize happens and cyclic refresh is not applied on the current (resized) frame, the sb_index is not reset and then might be out of boundary on future frames when the cyclic refresh is applied. Change-Id: I05282fc4bc2323522d60e019ed0790d69221a2f7
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_aq_cyclicrefresh.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/vp9/encoder/vp9_aq_cyclicrefresh.c b/vp9/encoder/vp9_aq_cyclicrefresh.c
index 3b4fee7cf..95daadfe2 100644
--- a/vp9/encoder/vp9_aq_cyclicrefresh.c
+++ b/vp9/encoder/vp9_aq_cyclicrefresh.c
@@ -512,6 +512,8 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) {
CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
struct segmentation *const seg = &cm->seg;
if (cm->current_video_frame == 0) cr->low_content_avg = 0.0;
+ // Reset if resoluton change has occurred.
+ if (cpi->resize_pending != 0) vp9_cyclic_refresh_reset_resize(cpi);
if (!cr->apply_cyclic_refresh || (cpi->force_update_segmentation)) {
// Set segmentation map to 0 and disable.
unsigned char *const seg_map = cpi->segmentation_map;
@@ -577,9 +579,6 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) {
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);
}