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

LibVideo/VP9: Retain adjacent block contexts storage between frames

Re-allocating the storage is unnecessary, since the size will rarely
change during playback.
This commit is contained in:
Zaggy1024 2022-11-24 21:53:24 -06:00 committed by Andreas Kling
parent ea7a6f343b
commit 396972bb69
3 changed files with 11 additions and 2 deletions

View file

@ -147,7 +147,10 @@ DecoderErrorOr<ColorRange> Parser::read_color_range()
/* (6.2) */
DecoderErrorOr<FrameContext> Parser::uncompressed_header()
{
FrameContext frame_context;
// NOTE: m_reusable_frame_block_contexts does not need to retain any data between frame decodes.
// This is only stored so that we don't need to allocate a frame's block contexts on each
// call to this function, since it will rarely change sizes.
FrameContext frame_context { m_reusable_frame_block_contexts };
frame_context.color_config = m_previous_color_config;
auto frame_marker = TRY_READ(m_bit_stream->read_bits(2));