Localize variable definitions in update_stats

Change-Id: I2faf5d43db1e5726a08b24a19d8fb7ae1b86ad0a
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 459242a..f10a5c6 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -591,8 +591,6 @@
   const struct segmentation *const seg = &cm->seg;
   const int bw = mi_size_wide[mi->mbmi.sb_type];
   const int bh = mi_size_high[mi->mbmi.sb_type];
-  int x_mis = AOMMIN(bw, cm->mi_cols - mi_col);
-  int y_mis = AOMMIN(bh, cm->mi_rows - mi_row);
   int w, h;
 
   const int mis = cm->mi_stride;
@@ -758,6 +756,8 @@
 
   MV_REF *const frame_mvs =
       cm->cur_frame->mvs + (mi_row & 0xfffe) * cm->mi_cols + (mi_col & 0xfffe);
+  int x_mis = AOMMIN(bw, cm->mi_cols - mi_col);
+  int y_mis = AOMMIN(bh, cm->mi_rows - mi_row);
   x_mis = AOMMAX(2, x_mis);
   y_mis = AOMMAX(2, y_mis);
   for (h = 0; h < y_mis; ++h) {