Add vpx_clear_system_state() in SSIM based rdmult adjustments

Change-Id: I2a0cdec3bfce864e975aaa408cfdcb855db8680f
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index 8d35ac3..a5d59b6 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -270,6 +270,7 @@
   const int index = row * num_cols + col;
 
   assert(cpi->oxcf.tuning == VP8_TUNE_SSIM);
+  vpx_clear_system_state();
   return cpi->mi_ssim_rdmult_scaling_factors[index];
 }
 
@@ -312,6 +313,7 @@
     const double ssim_factor =
         get_ssim_rdmult_scaling_factor(cpi, mi_row, mi_col);
     x->rdmult = (int)(ssim_factor * x->rdmult);
+    vpx_clear_system_state();
   }
 
   // required by vp9_append_sub8x8_mvs_for_idx() and vp9_find_best_ref_mvs()
@@ -1963,6 +1965,7 @@
     const double ssim_factor =
         get_ssim_rdmult_scaling_factor(cpi, mi_row, mi_col);
     x->rdmult = (int)(ssim_factor * x->rdmult);
+    vpx_clear_system_state();
   }
 }
 
@@ -2208,6 +2211,7 @@
       const double ssim_factor =
           get_ssim_rdmult_scaling_factor(cpi, mi_row, mi_col);
       x->rdmult = (int)(ssim_factor * x->rdmult);
+      vpx_clear_system_state();
     }
   }
 
@@ -3823,6 +3827,7 @@
     const double ssim_factor =
         get_ssim_rdmult_scaling_factor(cpi, mi_row, mi_col);
     partition_mul = (int)(ssim_factor * partition_mul);
+    vpx_clear_system_state();
   }
 
   (void)*tp_orig;