]> granicus.if.org Git - libvpx/commitdiff
Fix resetting of cyclic refresh on dynamic resize change.
authorMarco <marpan@chromium.org>
Thu, 15 Oct 2015 16:01:47 +0000 (09:01 -0700)
committerMarco <marpan@chromium.org>
Thu, 15 Oct 2015 16:03:51 +0000 (09:03 -0700)
Put the reset at the right place, during the setup and prior
to updating the map.

Change-Id: I75e550ae9d8cc15081330b8857edc04c23947875

vp9/encoder/vp9_aq_cyclicrefresh.c
vp9/encoder/vp9_ratectrl.c

index 04fa8f6fd305eb3c6e5461d51518d1dde70c4f5f..e4b76dbc61ad396d594faa9be7746f4648b34897 100644 (file)
@@ -571,6 +571,10 @@ 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);
   }
index 5f308e11726a128de593b5a682e3db7511ade473..be31bd348434cb4ab5b83f2d56c4c3c4cda0e726 100644 (file)
@@ -1905,9 +1905,6 @@ int vp9_resize_one_pass_cbr(VP9_COMP *cpi) {
     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) ?