1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:57:44 +00:00

LibVideo/VP9: Implement sections 6.1.2 and 8.4.1-8.4.4

These section implement the behavior to refresh the probability
tables after parsing a frame.
This commit is contained in:
FalseHonesty 2021-06-26 23:23:22 -04:00 committed by Andreas Kling
parent cf6b3d0ce9
commit d79c9c262f
8 changed files with 188 additions and 9 deletions

View file

@ -45,11 +45,34 @@ bool Parser::parse_frame(ByteBuffer const& frame_data)
SAFE_CALL(m_bit_stream->exit_bool());
SAFE_CALL(decode_tiles());
SAFE_CALL(refresh_probs());
dbgln("Finished reading frame!");
return true;
}
bool Parser::trailing_bits()
{
while (m_bit_stream->get_position() & 7u)
RESERVED_ZERO;
return true;
}
bool Parser::refresh_probs()
{
if (!m_error_resilient_mode && !m_frame_parallel_decoding_mode) {
m_probability_tables->load_probs(m_frame_context_idx);
SAFE_CALL(m_decoder.adapt_coef_probs());
if (!m_frame_is_intra) {
m_probability_tables->load_probs2(m_frame_context_idx);
SAFE_CALL(m_decoder.adapt_non_coef_probs());
}
}
if (m_refresh_frame_context)
m_probability_tables->save_probs(m_frame_context_idx);
return true;
}
/* (6.2) */
bool Parser::uncompressed_header()
{
@ -397,13 +420,6 @@ bool Parser::setup_past_independence()
return true;
}
bool Parser::trailing_bits()
{
while (m_bit_stream->get_position() & 7u)
RESERVED_ZERO;
return true;
}
bool Parser::compressed_header()
{
SAFE_CALL(read_tx_mode());