Commit 1c019f9e authored by Jingning Han's avatar Jingning Han

Fix out-of-bound read in token_costs array

This resolves the unit test failure case at
AV1/AVxEncoderThreadTestLarge.EncoderResultTest/1

Change-Id: I9f3aaaf5498177cb3623cb8806a40f812e20609d
parent 9c4f895c
......@@ -3265,6 +3265,7 @@ static void select_tx_block(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row,
int tmp_eob = 0;
int zero_blk_rate;
RD_STATS sum_rd_stats;
const int tx_size_ctx = txsize_sqr_map[tx_size];
av1_init_rd_stats(&sum_rd_stats);
#if CONFIG_EXT_TX
......@@ -3282,8 +3283,8 @@ static void select_tx_block(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row,
if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;
zero_blk_rate =
x->token_costs[tx_size][pd->plane_type][1][0][0][coeff_ctx][EOB_TOKEN];
zero_blk_rate = x->token_costs[tx_size_ctx][pd->plane_type][1][0][0]
[coeff_ctx][EOB_TOKEN];
if (cpi->common.tx_mode == TX_MODE_SELECT || tx_size == TX_4X4) {
inter_tx_size[0][0] = tx_size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment