ref: fcaedc56813eb173a46f0d547896d0e03342f298
parent: 8b47c2662a740b8ecc9da8bc804a9e24631233e6
parent: 6c0dd11f29a56b285d61976dac7d1c5118891be8
author: Alex Converse <[email protected]>
date: Wed Mar 2 12:21:08 EST 2016
Merge "Simplify the inner loop of duplicate_mode_info_in_sb."
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -243,14 +243,16 @@
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,