av1.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. * This file is part of FFmpeg.
  3. *
  4. * FFmpeg is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * FFmpeg is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with FFmpeg; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. /**
  19. * @file
  20. * AV1 common definitions
  21. */
  22. #ifndef AVCODEC_AV1_H
  23. #define AVCODEC_AV1_H
  24. // OBU types (section 6.2.2).
  25. typedef enum {
  26. // 0 reserved.
  27. AV1_OBU_SEQUENCE_HEADER = 1,
  28. AV1_OBU_TEMPORAL_DELIMITER = 2,
  29. AV1_OBU_FRAME_HEADER = 3,
  30. AV1_OBU_TILE_GROUP = 4,
  31. AV1_OBU_METADATA = 5,
  32. AV1_OBU_FRAME = 6,
  33. AV1_OBU_REDUNDANT_FRAME_HEADER = 7,
  34. AV1_OBU_TILE_LIST = 8,
  35. // 9-14 reserved.
  36. AV1_OBU_PADDING = 15,
  37. } AV1_OBU_Type;
  38. // Metadata types (section 6.7.1).
  39. enum {
  40. AV1_METADATA_TYPE_HDR_CLL = 1,
  41. AV1_METADATA_TYPE_HDR_MDCV = 2,
  42. AV1_METADATA_TYPE_SCALABILITY = 3,
  43. AV1_METADATA_TYPE_ITUT_T35 = 4,
  44. AV1_METADATA_TYPE_TIMECODE = 5,
  45. };
  46. // Frame types (section 6.8.2).
  47. enum {
  48. AV1_FRAME_KEY = 0,
  49. AV1_FRAME_INTER = 1,
  50. AV1_FRAME_INTRA_ONLY = 2,
  51. AV1_FRAME_SWITCH = 3,
  52. };
  53. // Reference frames (section 6.10.24).
  54. enum {
  55. AV1_REF_FRAME_INTRA = 0,
  56. AV1_REF_FRAME_LAST = 1,
  57. AV1_REF_FRAME_LAST2 = 2,
  58. AV1_REF_FRAME_LAST3 = 3,
  59. AV1_REF_FRAME_GOLDEN = 4,
  60. AV1_REF_FRAME_BWDREF = 5,
  61. AV1_REF_FRAME_ALTREF2 = 6,
  62. AV1_REF_FRAME_ALTREF = 7,
  63. };
  64. // Constants (section 3).
  65. enum {
  66. AV1_MAX_OPERATING_POINTS = 32,
  67. AV1_MAX_SB_SIZE = 128,
  68. AV1_MI_SIZE = 4,
  69. AV1_MAX_TILE_WIDTH = 4096,
  70. AV1_MAX_TILE_AREA = 4096 * 2304,
  71. AV1_MAX_TILE_ROWS = 64,
  72. AV1_MAX_TILE_COLS = 64,
  73. AV1_NUM_REF_FRAMES = 8,
  74. AV1_REFS_PER_FRAME = 7,
  75. AV1_TOTAL_REFS_PER_FRAME = 8,
  76. AV1_PRIMARY_REF_NONE = 7,
  77. AV1_MAX_SEGMENTS = 8,
  78. AV1_SEG_LVL_MAX = 8,
  79. AV1_SEG_LVL_ALT_Q = 0,
  80. AV1_SEG_LVL_ALT_LF_Y_V = 1,
  81. AV1_SEG_LVL_REF_FRAME = 5,
  82. AV1_SEG_LVL_SKIP = 6,
  83. AV1_SEG_LVL_GLOBAL_MV = 7,
  84. AV1_SELECT_SCREEN_CONTENT_TOOLS = 2,
  85. AV1_SELECT_INTEGER_MV = 2,
  86. AV1_SUPERRES_NUM = 8,
  87. AV1_SUPERRES_DENOM_MIN = 9,
  88. AV1_INTERPOLATION_FILTER_SWITCHABLE = 4,
  89. AV1_GM_ABS_ALPHA_BITS = 12,
  90. AV1_GM_ALPHA_PREC_BITS = 15,
  91. AV1_GM_ABS_TRANS_ONLY_BITS = 9,
  92. AV1_GM_TRANS_ONLY_PREC_BITS = 3,
  93. AV1_GM_ABS_TRANS_BITS = 12,
  94. AV1_GM_TRANS_PREC_BITS = 6,
  95. AV1_WARPEDMODEL_PREC_BITS = 16,
  96. AV1_WARP_MODEL_IDENTITY = 0,
  97. AV1_WARP_MODEL_TRANSLATION = 1,
  98. AV1_WARP_MODEL_ROTZOOM = 2,
  99. AV1_WARP_MODEL_AFFINE = 3,
  100. };
  101. // The main colour configuration information uses the same ISO/IEC 23001-8
  102. // (H.273) enums as FFmpeg does, so separate definitions are not required.
  103. // Chroma sample position.
  104. enum {
  105. AV1_CSP_UNKNOWN = 0,
  106. AV1_CSP_VERTICAL = 1, // -> AVCHROMA_LOC_LEFT.
  107. AV1_CSP_COLOCATED = 2, // -> AVCHROMA_LOC_TOPLEFT.
  108. };
  109. // Scalability modes (section 6.7.5)
  110. enum {
  111. AV1_SCALABILITY_L1T2 = 0,
  112. AV1_SCALABILITY_L1T3 = 1,
  113. AV1_SCALABILITY_L2T1 = 2,
  114. AV1_SCALABILITY_L2T2 = 3,
  115. AV1_SCALABILITY_L2T3 = 4,
  116. AV1_SCALABILITY_S2T1 = 5,
  117. AV1_SCALABILITY_S2T2 = 6,
  118. AV1_SCALABILITY_S2T3 = 7,
  119. AV1_SCALABILITY_L2T1h = 8,
  120. AV1_SCALABILITY_L2T2h = 9,
  121. AV1_SCALABILITY_L2T3h = 10,
  122. AV1_SCALABILITY_S2T1h = 11,
  123. AV1_SCALABILITY_S2T2h = 12,
  124. AV1_SCALABILITY_S2T3h = 13,
  125. AV1_SCALABILITY_SS = 14,
  126. AV1_SCALABILITY_L3T1 = 15,
  127. AV1_SCALABILITY_L3T2 = 16,
  128. AV1_SCALABILITY_L3T3 = 17,
  129. AV1_SCALABILITY_S3T1 = 18,
  130. AV1_SCALABILITY_S3T2 = 19,
  131. AV1_SCALABILITY_S3T3 = 20,
  132. AV1_SCALABILITY_L3T2_KEY = 21,
  133. AV1_SCALABILITY_L3T3_KEY = 22,
  134. AV1_SCALABILITY_L4T5_KEY = 23,
  135. AV1_SCALABILITY_L4T7_KEY = 24,
  136. AV1_SCALABILITY_L3T2_KEY_SHIFT = 25,
  137. AV1_SCALABILITY_L3T3_KEY_SHIFT = 26,
  138. AV1_SCALABILITY_L4T5_KEY_SHIFT = 27,
  139. AV1_SCALABILITY_L4T7_KEY_SHIFT = 28,
  140. };
  141. #endif /* AVCODEC_AV1_H */