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

LibVideo: Add support for VP9 superframes

This allows the second shown frame of the VP9 test video to be decoded,
as the second chunk uses a superframe to encode a reference frame and
a second to inter predict between the keyframe and the reference frame.
This commit is contained in:
Zaggy1024 2022-09-22 21:49:10 -05:00 committed by Andrew Kaster
parent b0187dfc27
commit be0760871e
5 changed files with 119 additions and 17 deletions

View file

@ -8,8 +8,8 @@
#pragma once
#include <AK/Array.h>
#include <AK/ByteBuffer.h>
#include <AK/OwnPtr.h>
#include <AK/Span.h>
#include <AK/Vector.h>
#include <LibGfx/Forward.h>
#include <LibVideo/DecoderError.h>
@ -32,10 +32,14 @@ class Parser {
public:
explicit Parser(Decoder&);
~Parser();
DecoderErrorOr<void> parse_frame(ByteBuffer const&);
DecoderErrorOr<void> parse_frame(Span<const u8>);
void dump_info();
private:
/* Annex B: Superframes are a method of storing multiple coded frames into a single chunk
* See also section 5.26. */
Vector<size_t> parse_superframe_sizes(Span<const u8>);
DecoderErrorOr<FrameType> read_frame_type();
DecoderErrorOr<ColorRange> read_color_range();