1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 06:37:35 +00:00

LibVideo/VP9: Store color config in the frame context

The color config is reused for most inter predicted frames, so we use a
struct ColorConfig to store the config from intra frames, and put it in
a field in Parser to copy from when an inter frame without color config
is encountered.
This commit is contained in:
Zaggy1024 2022-11-22 19:15:38 -06:00 committed by Andreas Kling
parent 9f573264ea
commit 40bc987fe3
5 changed files with 232 additions and 226 deletions

View file

@ -243,6 +243,14 @@ enum class FrameShowMode {
DoNotShowFrame,
};
struct ColorConfig {
u8 bit_depth { 8 };
ColorSpace color_space { ColorSpace::Bt601 };
ColorRange color_range { ColorRange::Studio };
bool subsampling_x { true };
bool subsampling_y { true };
};
struct FrameContext {
public:
u8 profile { 0 };
@ -258,6 +266,8 @@ public:
}
u8 existing_frame_index() const { return m_existing_frame_index; }
ColorConfig color_config {};
Gfx::Size<u32> size() const { return m_size; }
ErrorOr<void> set_size(Gfx::Size<u32> size)
{