Simplify the inner loop of duplicate_mode_info_in_sb.

Change-Id: I8ba9164c3550379fb998d4d074846e90fb2c6f8c
This commit is contained in:
Alex Converse 2016-03-01 17:43:02 -08:00
parent dbaf5f64e2
commit 6c0dd11f29

View File

@ -243,14 +243,16 @@ static void set_offsets(VP9_COMP *cpi, const TileInfo *const tile,
static void duplicate_mode_info_in_sb(VP9_COMMON *cm, MACROBLOCKD *xd,
int mi_row, int mi_col,
BLOCK_SIZE bsize) {
const int block_width = num_8x8_blocks_wide_lookup[bsize];
const int block_height = num_8x8_blocks_high_lookup[bsize];
const int block_width = VPXMIN(num_8x8_blocks_wide_lookup[bsize],
cm->mi_cols - mi_col);
const int block_height = VPXMIN(num_8x8_blocks_high_lookup[bsize],
cm->mi_rows - mi_row);
const int mi_stride = xd->mi_stride;
MODE_INFO *const src_mi = xd->mi[0];
int i, j;
for (j = 0; j < block_height; ++j)
for (i = 0; i < block_width; ++i) {
if (mi_row + j < cm->mi_rows && mi_col + i < cm->mi_cols)
xd->mi[j * xd->mi_stride + i] = xd->mi[0];
}
for (i = 0; i < block_width; ++i)
xd->mi[j * mi_stride + i] = src_mi;
}
static void set_block_size(VP9_COMP * const cpi,