Coverage Report

Created: 2025-08-28 06:26

/src/serenity/Userland/Libraries/LibMedia/Video/VP9/Enums.h
Line
Count
Source
1
/*
2
 * Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
3
 *
4
 * SPDX-License-Identifier: BSD-2-Clause
5
 */
6
7
#pragma once
8
9
#include "Symbols.h"
10
#include <AK/Types.h>
11
12
namespace Media::Video::VP9 {
13
14
enum class FrameType {
15
    KeyFrame,
16
    IntraOnlyFrame,
17
    InterFrame
18
};
19
20
enum ColorSpace : u8 {
21
    Unknown = 0,
22
    Bt601 = 1,
23
    Bt709 = 2,
24
    Smpte170 = 3,
25
    Smpte240 = 4,
26
    Bt2020 = 5,
27
    Reserved = 6,
28
    RGB = 7
29
};
30
31
enum InterpolationFilter : u8 {
32
    EightTap = 0,
33
    EightTapSmooth = 1,
34
    EightTapSharp = 2,
35
    Bilinear = 3,
36
    Switchable = 4
37
};
38
39
enum ReferenceFrameType : u8 {
40
    // None represents both INTRA_FRAME and NONE in the spec. When the primary reference
41
    // frame type is None, that means that the frame/block is not inter-predicted.
42
    None = 0,
43
    LastFrame = 1,
44
    GoldenFrame = 2,
45
    AltRefFrame = 3,
46
};
47
48
enum class TransformMode : u8 {
49
    Only_4x4 = 0,
50
    Allow_8x8 = 1,
51
    Allow_16x16 = 2,
52
    Allow_32x32 = 3,
53
    Select = 4,
54
};
55
56
enum TransformSize : u8 {
57
    Transform_4x4 = 0,
58
    Transform_8x8 = 1,
59
    Transform_16x16 = 2,
60
    Transform_32x32 = 3,
61
};
62
63
enum class TransformType : u8 {
64
    DCT = 0,
65
    ADST = 1,
66
};
67
68
struct TransformSet {
69
    TransformType first_transform : 1;
70
    TransformType second_transform : 1;
71
72
    bool operator==(TransformSet const& other) const
73
24.0M
    {
74
24.0M
        return first_transform == other.first_transform && second_transform == other.second_transform;
75
24.0M
    }
76
};
77
78
enum ReferenceMode : u8 {
79
    SingleReference = 0,
80
    CompoundReference = 1,
81
    ReferenceModeSelect = 2,
82
};
83
84
enum class ReferenceIndex : u8 {
85
    Primary = 0,
86
    Secondary = 1,
87
};
88
89
enum BlockSubsize : u8 {
90
    Block_4x4 = 0,
91
    Block_4x8 = 1,
92
    Block_8x4 = 2,
93
    Block_8x8 = 3,
94
    Block_8x16 = 4,
95
    Block_16x8 = 5,
96
    Block_16x16 = 6,
97
    Block_16x32 = 7,
98
    Block_32x16 = 8,
99
    Block_32x32 = 9,
100
    Block_32x64 = 10,
101
    Block_64x32 = 11,
102
    Block_64x64 = 12,
103
    Block_Invalid = BLOCK_INVALID
104
};
105
106
enum Partition : u8 {
107
    PartitionNone = 0,
108
    PartitionHorizontal = 1,
109
    PartitionVertical = 2,
110
    PartitionSplit = 3,
111
};
112
113
enum class PredictionMode : u8 {
114
    DcPred = 0,
115
    VPred = 1,
116
    HPred = 2,
117
    D45Pred = 3,
118
    D135Pred = 4,
119
    D117Pred = 5,
120
    D153Pred = 6,
121
    D207Pred = 7,
122
    D63Pred = 8,
123
    TmPred = 9,
124
    NearestMv = 10,
125
    NearMv = 11,
126
    ZeroMv = 12,
127
    NewMv = 13,
128
};
129
130
enum MvJoint : u8 {
131
    MotionVectorAllZero = 0,
132
    MotionVectorNonZeroColumn = 1,
133
    MotionVectorNonZeroRow = 2,
134
};
135
136
enum MvClass : u8 {
137
    MvClass0 = 0,
138
    MvClass1 = 1,
139
    MvClass2 = 2,
140
    MvClass3 = 3,
141
    MvClass4 = 4,
142
    MvClass5 = 5,
143
    MvClass6 = 6,
144
    MvClass7 = 7,
145
    MvClass8 = 8,
146
    MvClass9 = 9,
147
    MvClass10 = 10,
148
};
149
150
enum Token : u8 {
151
    ZeroToken = 0,
152
    OneToken = 1,
153
    TwoToken = 2,
154
    ThreeToken = 3,
155
    FourToken = 4,
156
    DctValCat1 = 5,
157
    DctValCat2 = 6,
158
    DctValCat3 = 7,
159
    DctValCat4 = 8,
160
    DctValCat5 = 9,
161
    DctValCat6 = 10,
162
};
163
164
enum class SegmentFeature : u8 {
165
    // SEG_LVL_ALT_Q
166
    AlternativeQuantizerBase,
167
    // SEG_LVL_ALT_L
168
    AlternativeLoopFilterBase,
169
    // SEG_LVL_REF_FRAME
170
    ReferenceFrameOverride,
171
    // SEG_LVL_SKIP
172
    SkipResidualsOverride,
173
    // SEG_LVL_MAX
174
    Sentinel,
175
};
176
177
}