mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 04:17:34 +00:00
LibVideo/VP9: Implement syntax element counter
This commit is contained in:
parent
8dd9d1bbdb
commit
18759ff56d
3 changed files with 112 additions and 0 deletions
74
Userland/Libraries/LibVideo/VP9/SyntaxElementCounter.h
Normal file
74
Userland/Libraries/LibVideo/VP9/SyntaxElementCounter.h
Normal file
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Symbols.h"
|
||||
#include <AK/Types.h>
|
||||
|
||||
namespace Video::VP9 {
|
||||
|
||||
enum class SyntaxElementType {
|
||||
Partition,
|
||||
DefaultIntraMode,
|
||||
DefaultUVMode,
|
||||
IntraMode,
|
||||
SubIntraMode,
|
||||
UVMode,
|
||||
SegmentID,
|
||||
Skip,
|
||||
SegIDPredicted,
|
||||
IsInter,
|
||||
CompMode,
|
||||
CompRef,
|
||||
SingleRefP1,
|
||||
SingleRefP2,
|
||||
MVSign,
|
||||
MVClass0Bit,
|
||||
MVBit,
|
||||
TXSize,
|
||||
InterMode,
|
||||
InterpFilter,
|
||||
MVJoint,
|
||||
MVClass,
|
||||
MVClass0FR,
|
||||
MVClass0HP,
|
||||
MVFR,
|
||||
MVHP,
|
||||
Token,
|
||||
MoreCoefs,
|
||||
};
|
||||
|
||||
class SyntaxElementCounter final {
|
||||
public:
|
||||
void clear_counts();
|
||||
|
||||
private:
|
||||
u8 counts_intra_mode[BLOCK_SIZE_GROUPS][INTRA_MODES];
|
||||
u8 counts_uv_mode[INTRA_MODES][INTRA_MODES];
|
||||
u8 counts_partition[PARTITION_CONTEXTS][PARTITION_TYPES];
|
||||
u8 counts_interp_filter[INTERP_FILTER_CONTEXTS][SWITCHABLE_FILTERS];
|
||||
u8 counts_inter_mode[INTER_MODE_CONTEXTS][INTER_MODES];
|
||||
u8 counts_tx_size[TX_SIZES][TX_SIZE_CONTEXTS][TX_SIZES];
|
||||
u8 counts_is_inter[IS_INTER_CONTEXTS][2];
|
||||
u8 counts_comp_mode[COMP_MODE_CONTEXTS][2];
|
||||
u8 counts_single_ref[REF_CONTEXTS][2][2];
|
||||
u8 counts_comp_ref[REF_CONTEXTS][2];
|
||||
u8 counts_skip[SKIP_CONTEXTS][2];
|
||||
u8 counts_mv_joint[MV_JOINTS];
|
||||
u8 counts_mv_sign[2][2];
|
||||
u8 counts_mv_class[2][MV_CLASSES];
|
||||
u8 counts_mv_class0_bit[2][CLASS0_SIZE];
|
||||
u8 counts_mv_class0_fr[2][CLASS0_SIZE][MV_FR_SIZE];
|
||||
u8 counts_mv_class0_hp[2][2];
|
||||
u8 counts_mv_bits[2][MV_OFFSET_BITS][2];
|
||||
u8 counts_mv_fr[2][MV_FR_SIZE];
|
||||
u8 counts_mv_hp[2][2];
|
||||
u8 counts_token[TX_SIZES][BLOCK_TYPES][REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS][UNCONSTRAINED_NODES];
|
||||
u8 counts_more_coefs[TX_SIZES][BLOCK_TYPES][REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS][2];
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue