Fix 4k encoding error
Fix a 4k encoding error where the wrong mi stride is used on the
boundary blocks.
BUG=aomedia:2546
Change-Id: I3ced4b2d702ae63aa4871e39c25c3fdb612cd49c
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 54aea3e..5ef2260 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -1784,9 +1784,10 @@
for (r = 0; r < cm->seq_params.mib_size; r += bh) {
int bw = bw_in;
for (c = 0; c < cm->seq_params.mib_size; c += bw) {
- const int index = r * cm->mi_stride + c;
- mib[index] = mi + index;
- mib[index]->sb_type = find_partition_size(
+ const int grid_index = get_mi_grid_idx(cm, r, c);
+ const int mi_index = get_alloc_mi_idx(cm, r, c);
+ mib[grid_index] = mi + mi_index;
+ mib[grid_index]->sb_type = find_partition_size(
bsize, mi_rows_remaining - r, mi_cols_remaining - c, &bh, &bw);
}
}