]> granicus.if.org Git - libvpx/commitdiff
Add a few "const"
authorYaowu Xu <yaowu@google.com>
Thu, 10 Apr 2014 23:22:52 +0000 (16:22 -0700)
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>
Fri, 11 Apr 2014 22:50:16 +0000 (15:50 -0700)
Change-Id: I258351fc1fff70ff2e9fa4845e575b0bb6a423d1

vp9/encoder/vp9_encodeframe.c

index d1db1d1316112986d3f3722405784b6f86b2870e..795765d15610b4642598cebb22f488c8c2caad22 100644 (file)
@@ -1456,11 +1456,10 @@ static void set_source_var_based_partition(VP9_COMP *cpi,
                                            MODE_INFO **mi_8x8,
                                            int mi_row, int mi_col) {
   VP9_COMMON *const cm = &cpi->common;
-  MACROBLOCK *x = &cpi->mb;
+  MACROBLOCK *const x = &cpi->mb;
   const int mis = cm->mi_stride;
-  int row8x8_remaining = tile->mi_row_end - mi_row;
-  int col8x8_remaining = tile->mi_col_end - mi_col;
-  int r, c;
+  const int row8x8_remaining = tile->mi_row_end - mi_row;
+  const int col8x8_remaining = tile->mi_col_end - mi_col;
   MODE_INFO *mi_upper_left = cm->mi + mi_row * mis + mi_col;
 
   vp9_setup_src_planes(x, cpi->Source, mi_row, mi_col);
@@ -1543,16 +1542,13 @@ static void set_source_var_based_partition(VP9_COMP *cpi,
     BLOCK_SIZE bsize = BLOCK_16X16;
     int bh = num_8x8_blocks_high_lookup[bsize];
     int bw = num_8x8_blocks_wide_lookup[bsize];
-
+    int r, c;
     for (r = 0; r < MI_BLOCK_SIZE; r += bh) {
       for (c = 0; c < MI_BLOCK_SIZE; c += bw) {
-        int index = r * mis + c;
-        // Find a partition size that fits
-        bsize = find_partition_size(bsize,
-                                    (row8x8_remaining - r),
-                                    (col8x8_remaining - c), &bh, &bw);
+        const int index = r * mis + c;
         mi_8x8[index] = mi_upper_left + index;
-        mi_8x8[index]->mbmi.sb_type = bsize;
+        mi_8x8[index]->mbmi.sb_type = find_partition_size(bsize,
+            row8x8_remaining - r, col8x8_remaining - c, &bh, &bw);
       }
     }
   }