]> granicus.if.org Git - libvpx/commitdiff
change to save rdmult value correctly
authorYaowu Xu <yaowu@google.com>
Fri, 14 Mar 2014 18:03:58 +0000 (11:03 -0700)
committerYaowu Xu <yaowu@google.com>
Fri, 14 Mar 2014 18:18:27 +0000 (11:18 -0700)
This commit moves the position where rdmult is saved to make sure it
is the correct value. Prior, an uninitialized value may be saved and
restored.

This addresses issue:
https://code.google.com/p/webm/issues/detail?id=733

Change-Id: I436407f289169bc63da3c5a6bf609bed16cb71b5

vp9/encoder/vp9_encodeframe.c

index 0a723d7857cb055fea7335434e0c29b7a0faf3f5..4c4bf332d6b8484965495e083cdb6e2baf5434e9 100644 (file)
@@ -694,7 +694,7 @@ static void rd_pick_sb_modes(VP9_COMP *cpi, const TileInfo *const tile,
   struct macroblock_plane *const p = x->plane;
   struct macroblockd_plane *const pd = xd->plane;
   const AQ_MODE aq_mode = cpi->oxcf.aq_mode;
-  int i, orig_rdmult = x->rdmult;
+  int i, orig_rdmult;
   double rdmult_ratio;
 
   vp9_clear_system_state();
@@ -749,6 +749,8 @@ static void rd_pick_sb_modes(VP9_COMP *cpi, const TileInfo *const tile,
     vp9_init_plane_quantizers(cpi, x);
   }
 
+  // Save rdmult before it might be changed, so it can be restored later.
+  orig_rdmult = x->rdmult;
   if (cpi->oxcf.tuning == VP8_TUNE_SSIM)
     activity_masking(cpi, x);