1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 02:17:34 +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

@ -9,6 +9,7 @@
#include <AK/ByteBuffer.h>
#include <AK/Error.h>
#include <AK/Span.h>
#include <LibVideo/DecoderError.h>
#include "Parser.h"
@ -20,7 +21,9 @@ class Decoder {
public:
Decoder();
DecoderErrorOr<void> decode_frame(ByteBuffer const&);
/* (8.1) General */
DecoderErrorOr<void> decode(Span<const u8>);
DecoderErrorOr<void> decode(ByteBuffer const&);
void dump_frame_info();
// FIXME: These functions should be replaced by a struct that contains
@ -33,6 +36,8 @@ public:
private:
typedef i32 Intermediate;
DecoderErrorOr<void> decode_frame(Span<const u8>);
DecoderErrorOr<void> allocate_buffers();
Vector<Intermediate>& get_temp_buffer(u8 plane);
Vector<u16>& get_output_buffer(u8 plane);