]> granicus.if.org Git - libvpx/commitdiff
Adding temp variable q to vp9_cyclic_refresh_setup().
authorDmitry Kovalev <dkovalev@google.com>
Fri, 11 Apr 2014 17:31:54 +0000 (10:31 -0700)
committerDmitry Kovalev <dkovalev@google.com>
Fri, 11 Apr 2014 17:31:54 +0000 (10:31 -0700)
Change-Id: If0e9c811c8ae78c0914d615bad0067a5b57e4a71

vp9/encoder/vp9_aq_cyclicrefresh.c

index 7879091428e4e26d7d7135867d171aacdf06761b..e55881ffcc8089f97215a11f8b0a7c6457e326bb 100644 (file)
@@ -200,6 +200,7 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) {
 
     // Rate target ratio to set q delta.
     const float rate_ratio_qdelta = 2.0;
+    const double q = vp9_convert_qindex_to_q(cm->base_qindex);
     vp9_clear_system_state();
     // Some of these parameters may be set via codec-control function later.
     cr->max_sbs_perframe = 10;
@@ -209,14 +210,12 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) {
     // Set rate threshold to some fraction of target (and scaled by 256).
     cr->thresh_rate_sb = (rc->sb64_target_rate * 256) >> 2;
     // Distortion threshold, quadratic in Q, scale factor to be adjusted.
-    cr->thresh_dist_sb = 8 * (int)(vp9_convert_qindex_to_q(cm->base_qindex) *
-        vp9_convert_qindex_to_q(cm->base_qindex));
+    cr->thresh_dist_sb = 8 * (int)(q * q);
     if (cpi->sf.use_nonrd_pick_mode) {
       // May want to be more conservative with thresholds in non-rd mode for now
       // as rate/distortion are derived from model based on prediction residual.
       cr->thresh_rate_sb = (rc->sb64_target_rate * 256) >> 3;
-      cr->thresh_dist_sb = 4 * (int)(vp9_convert_qindex_to_q(cm->base_qindex) *
-          vp9_convert_qindex_to_q(cm->base_qindex));
+      cr->thresh_dist_sb = 4 * (int)(q * q);
     }
 
     cr->num_seg_blocks = 0;