From 56686b4514c6eaa72e7dcd635f7abf8409839b97 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Mon, 25 Jan 2016 15:46:59 +0000 Subject: [PATCH] Initalize mbmi->tx_size during rdopt. This is necessary when using SUPERTX, as the bitstream packer relies on tx_size being set correctly to decide whether to output the block using supertx or not. Change-Id: I79e776b3b810f4a15b9dbc6afdd6fc90c73c8934 --- vp10/encoder/encodeframe.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vp10/encoder/encodeframe.c b/vp10/encoder/encodeframe.c index 11c1bdd1b..a6e7b6582 100644 --- a/vp10/encoder/encodeframe.c +++ b/vp10/encoder/encodeframe.c @@ -1527,6 +1527,14 @@ static void rd_pick_sb_modes(VP10_COMP *cpi, set_offsets(cpi, tile_info, x, mi_row, mi_col, bsize); mbmi = &xd->mi[0]->mbmi; mbmi->sb_type = bsize; +#if CONFIG_SUPERTX + // We set tx_size here as skip blocks would otherwise not set it. + // tx_size needs to be set at this point as supertx_enable in + // write_modes_sb is computed based on this, and if the garbage in memory + // just happens to be the supertx_size, then the packer will code this + // block as a supertx block, even if rdopt did not pick it as such. + mbmi->tx_size = max_txsize_lookup[bsize]; +#endif for (i = 0; i < MAX_MB_PLANE; ++i) { p[i].coeff = ctx->coeff_pbuf[i][0]; -- 2.40.0