]> granicus.if.org Git - libvpx/commitdiff
Initalize mbmi->tx_size during rdopt.
authorGeza Lore <gezalore@gmail.com>
Mon, 25 Jan 2016 15:46:59 +0000 (15:46 +0000)
committerGeza Lore <gezalore@gmail.com>
Tue, 26 Jan 2016 01:18:56 +0000 (01:18 +0000)
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

index 11c1bdd1b420961b7a6236163826191e6cfa3fa2..a6e7b6582d62927ee59d63b3ca35c0062363430b 100644 (file)
@@ -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];