From 9168f18069ae4e1481639bf2f435feec39701bde Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Thu, 10 Apr 2014 16:22:52 -0700 Subject: [PATCH] Add a few "const" Change-Id: I258351fc1fff70ff2e9fa4845e575b0bb6a423d1 --- vp9/encoder/vp9_encodeframe.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index d1db1d131..795765d15 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -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); } } } -- 2.40.0