mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:57:35 +00:00
LibVideo/VP9: Begin reference frame update process (8.10)
This was required for correctly parsing more than one frame's height/width data properly. Additionally, start handling failure a little more gracefully. Since we don't fully parse a tile before starting to parse the next tile, we will now no longer make it past the first tile mark, meaning we should not handle that scenario well.
This commit is contained in:
parent
514559f074
commit
cf6b3d0ce9
6 changed files with 54 additions and 10 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "Decoder.h"
|
||||
#include "Utilities.h"
|
||||
|
||||
namespace Video::VP9 {
|
||||
|
||||
|
@ -15,7 +16,13 @@ Decoder::Decoder()
|
|||
|
||||
bool Decoder::decode_frame(ByteBuffer const& frame_data)
|
||||
{
|
||||
return m_parser->parse_frame(frame_data);
|
||||
SAFE_CALL(m_parser->parse_frame(frame_data));
|
||||
// TODO:
|
||||
// - #2
|
||||
// - #3
|
||||
// - #4
|
||||
SAFE_CALL(update_reference_frames());
|
||||
return true;
|
||||
}
|
||||
|
||||
void Decoder::dump_frame_info()
|
||||
|
@ -41,4 +48,18 @@ bool Decoder::reconstruct(size_t, u32, u32, TXSize)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Decoder::update_reference_frames()
|
||||
{
|
||||
for (auto i = 0; i < NUM_REF_FRAMES; i++) {
|
||||
dbgln("updating frame {}? {}", i, (m_parser->m_refresh_frame_flags & (1 << i)) == 1);
|
||||
if ((m_parser->m_refresh_frame_flags & (1 << i)) != 1)
|
||||
continue;
|
||||
m_parser->m_ref_frame_width[i] = m_parser->m_frame_width;
|
||||
m_parser->m_ref_frame_height[i] = m_parser->m_frame_height;
|
||||
// TODO: 1.3-1.7
|
||||
}
|
||||
// TODO: 2.1-2.2
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue