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

LibVideo: Combine VP9's Intra- and InterMode enums into PredictionMode

The two different mode sets are stored in single fields, and the
underlying values didn't overlap, so there was no reason to keep them
separate.

The enum is now an enum class as well, to enforce that almost all uses
of the enum are named. The only case where underlying values are used
is in lookup tables, but it may be worth abstracting that as well to
make array bounds more clear.
This commit is contained in:
Zaggy1024 2022-11-05 17:45:53 -05:00 committed by Andrew Kaster
parent 1c6d0a9777
commit 981997c039
6 changed files with 61 additions and 65 deletions

View file

@ -236,13 +236,13 @@ private:
ReferenceFrameType m_ref_frame[2];
bool m_is_inter { false };
bool m_is_compound { false };
IntraMode m_default_intra_mode { DcPred };
u8 m_y_mode { 0 };
u8 m_block_sub_modes[4];
PredictionMode m_default_intra_mode { PredictionMode::DcPred };
PredictionMode m_y_mode { 0 };
PredictionMode m_block_sub_modes[4];
u8 m_num_4x4_w { 0 };
u8 m_num_4x4_h { 0 };
u8 m_uv_mode { 0 }; // FIXME: Is u8 the right size?
Vector<Array<IntraMode, 4>> m_sub_modes;
PredictionMode m_uv_mode { 0 }; // FIXME: Is u8 the right size?
Vector<Array<PredictionMode, 4>> m_sub_modes;
ReferenceFrameType m_left_ref_frame[2];
ReferenceFrameType m_above_ref_frame[2];
bool m_left_intra { false };
@ -278,7 +278,7 @@ private:
Vector<bool> m_skips;
Vector<TXSize> m_tx_sizes;
Vector<u32> m_mi_sizes;
Vector<u8> m_y_modes;
Vector<PredictionMode> m_y_modes;
Vector<u8> m_segment_ids;
Vector<Array<ReferenceFrameType, 2>> m_ref_frames;
Vector<Array<ReferenceFrameType, 2>> m_prev_ref_frames;