Enums.h 3.1 KB

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