Fix uninitialized blk_skip for VAR TX.

x->blk_skip used to be uninitialized (leftover from encoding the
previous block), if cm->tx_mode != TX_MODE_SELECT (which is used with
higher --cpu-used or --rt options). This resulted in degraded coding
performance when using cm->tx_mode != TX_MODE_SELECT.

This fixes the VP10/EndToEndTestLarge.EndtoEndPSNRTest/40 unit test.

Also fixed an edge effect where encode_block in encodemb.c used the
formal width of the block (without cropping at the right edge), to
look up blk_skip, while select_tx_block in rdopt.c used the cropped
width to set blk_skip.

Change-Id: I76d0f49ac5ab3ab54203573e0d7fcfcc1c6aa10d
This commit is contained in:
Geza Lore
2016-04-19 14:22:48 +01:00
parent 8d64b53dc8
commit 7aa95be980
3 changed files with 19 additions and 5 deletions

View File

@@ -3339,6 +3339,15 @@ static void rd_pick_partition(VP10_COMP *cpi, ThreadData *td,
bsize >= BLOCK_8X8;
(void) *tp_orig;
#if CONFIG_VAR_TX
#ifndef NDEBUG
// Nothing should rely on the default value of this array (which is just
// leftover from encoding the previous block. Setting it to magic number
// when debugging.
memset(x->blk_skip[0], 234, sizeof(x->blk_skip[0]));
#endif // NDEBUG
#endif // CONFIG_VAR_TX
assert(num_8x8_blocks_wide_lookup[bsize] ==
num_8x8_blocks_high_lookup[bsize]);
@@ -4433,7 +4442,6 @@ static void encode_frame_internal(VP10_COMP *cpi) {
x->quant_fp = cpi->sf.use_quant_fp;
vp10_zero(x->skip_txfm);
#if CONFIG_VAR_TX
vp10_zero(x->blk_skip);
#if CONFIG_REF_MV
vp10_zero(x->blk_skip_drl);
#endif