mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:08:13 +00:00

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.
36 lines
847 B
C++
36 lines
847 B
C++
/*
|
|
* Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "Parser.h"
|
|
#include <AK/ByteBuffer.h>
|
|
|
|
namespace Video::VP9 {
|
|
|
|
class Decoder {
|
|
friend class Parser;
|
|
|
|
public:
|
|
Decoder();
|
|
bool decode_frame(ByteBuffer const&);
|
|
void dump_frame_info();
|
|
|
|
private:
|
|
/* (8.5) Prediction Processes */
|
|
bool predict_intra(size_t plane, u32 x, u32 y, bool have_left, bool have_above, bool not_on_right, TXSize tx_size, u32 block_index);
|
|
bool predict_inter(size_t plane, u32 x, u32 y, u32 w, u32 h, u32 block_index);
|
|
|
|
/* (8.6) Reconstruction and Dequantization */
|
|
bool reconstruct(size_t plane, u32 x, u32 y, TXSize size);
|
|
|
|
/* (8.10) Reference Frame Update Process */
|
|
bool update_reference_frames();
|
|
|
|
NonnullOwnPtr<Parser> m_parser;
|
|
};
|
|
|
|
}
|