Fix enc/dec mismatch when supertx and vartx are both turned on
BUG=aomedia:90
Change-Id: I66239b54017141929987eb49796b3b97081d3943
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 67322e7..3e1f060 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -2299,10 +2299,12 @@
#if CONFIG_SUPERTX
if (partition != PARTITION_NONE && supertx_enabled && pack_token) {
int skip;
+ const int bsw = num_8x8_blocks_wide_lookup[bsize];
+ const int bsh = num_8x8_blocks_high_lookup[bsize];
xd->mi = cm->mi_grid_visible + mi_offset;
supertx_size = mbmi->tx_size;
- set_mi_row_col(xd, tile, mi_row, num_8x8_blocks_high_lookup[bsize], mi_col,
- num_8x8_blocks_wide_lookup[bsize], cm->mi_rows, cm->mi_cols);
+ set_mi_row_col(xd, tile, mi_row, bsh, mi_col, bsw, cm->mi_rows,
+ cm->mi_cols);
assert(IMPLIES(!cm->seg.enabled, mbmi->segment_id_supertx == 0));
assert(mbmi->segment_id_supertx < MAX_SEGMENTS);
@@ -2346,6 +2348,12 @@
(*tok)++;
}
}
+#if CONFIG_VAR_TX
+ xd->above_txfm_context = cm->above_txfm_context + mi_col;
+ xd->left_txfm_context =
+ xd->left_txfm_context_buffer + (mi_row & MAX_MIB_MASK);
+ set_txfm_ctxs(xd->mi[0]->mbmi.tx_size, bsw, bsh, skip, xd);
+#endif
}
#endif // CONFIG_SUPERTX