]> granicus.if.org Git - libvpx/commitdiff
vp9: Move up reset of cyclic refresh under dynamic resize.
authorJerome Jiang <jianj@google.com>
Tue, 5 Jun 2018 22:21:29 +0000 (15:21 -0700)
committerMarco Paniconi <marpan@google.com>
Wed, 6 Jun 2018 05:31:16 +0000 (22:31 -0700)
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

vp9/encoder/vp9_aq_cyclicrefresh.c

index 3b4fee7cfb1188545b118b18336b64efac7794b8..95daadfe224281951add0246de990db752748532 100644 (file)
@@ -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);
   }