LibVideo/VP9: Remove m_tokens and m_token_cache from Parser

Only the residual tokens array needs to be kept for the transforms to
use after all the tokens have been parsed. The token cache is able to
be kept in the stack only for the duration of the token parsing loop.
This commit is contained in:
Zaggy1024 2022-11-27 00:41:09 -06:00 committed by Andreas Kling
commit 316dad7bf7
Notes: sideshowbarker 2024-07-17 21:16:31 +09:00
6 changed files with 32 additions and 27 deletions

View file

@ -1087,12 +1087,12 @@ DecoderErrorOr<void> Decoder::reconstruct(u8 plane, BlockContext const& block_co
auto index = index_from_row_and_column(i, j, block_size);
if (index == 0)
continue;
dequantized[index] = (m_parser->m_tokens[index] * ac_quant) / dq_denominator;
dequantized[index] = (block_context.residual_tokens[index] * ac_quant) / dq_denominator;
}
}
// 2. Dequant[ 0 ][ 0 ] is set equal to ( Tokens[ 0 ] * get_dc_quant( plane ) ) / dqDenom
dequantized[0] = (m_parser->m_tokens[0] * get_dc_quantizer(block_context, plane)) / dq_denominator;
dequantized[0] = (block_context.residual_tokens[0] * get_dc_quantizer(block_context, plane)) / dq_denominator;
// It is a requirement of bitstream conformance that the values written into the Dequant array in steps 1 and 2
// are representable by a signed integer with 8 + BitDepth bits.