You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

155 lines
3.3KB

  1. /*
  2. * Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
  3. * Copyright (c) 2006 Stefan Gehrer <stefan.gehrer@gmx.de>
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #ifndef CAVS_H
  22. #define CAVS_H
  23. #include "dsputil.h"
  24. #define SLICE_MIN_START_CODE 0x00000101
  25. #define SLICE_MAX_START_CODE 0x000001af
  26. #define EXT_START_CODE 0x000001b5
  27. #define USER_START_CODE 0x000001b2
  28. #define CAVS_START_CODE 0x000001b0
  29. #define PIC_I_START_CODE 0x000001b3
  30. #define PIC_PB_START_CODE 0x000001b6
  31. #define A_AVAIL 1
  32. #define B_AVAIL 2
  33. #define C_AVAIL 4
  34. #define D_AVAIL 8
  35. #define NOT_AVAIL -1
  36. #define REF_INTRA -2
  37. #define REF_DIR -3
  38. #define ESCAPE_CODE 59
  39. #define FWD0 0x01
  40. #define FWD1 0x02
  41. #define BWD0 0x04
  42. #define BWD1 0x08
  43. #define SYM0 0x10
  44. #define SYM1 0x20
  45. #define SPLITH 0x40
  46. #define SPLITV 0x80
  47. #define MV_BWD_OFFS 12
  48. #define MV_STRIDE 4
  49. enum mb_t {
  50. I_8X8 = 0,
  51. P_SKIP,
  52. P_16X16,
  53. P_16X8,
  54. P_8X16,
  55. P_8X8,
  56. B_SKIP,
  57. B_DIRECT,
  58. B_FWD_16X16,
  59. B_BWD_16X16,
  60. B_SYM_16X16,
  61. B_8X8 = 29
  62. };
  63. enum sub_mb_t {
  64. B_SUB_DIRECT,
  65. B_SUB_FWD,
  66. B_SUB_BWD,
  67. B_SUB_SYM
  68. };
  69. enum intra_luma_t {
  70. INTRA_L_VERT,
  71. INTRA_L_HORIZ,
  72. INTRA_L_LP,
  73. INTRA_L_DOWN_LEFT,
  74. INTRA_L_DOWN_RIGHT,
  75. INTRA_L_LP_LEFT,
  76. INTRA_L_LP_TOP,
  77. INTRA_L_DC_128
  78. };
  79. enum intra_chroma_t {
  80. INTRA_C_LP,
  81. INTRA_C_HORIZ,
  82. INTRA_C_VERT,
  83. INTRA_C_PLANE,
  84. INTRA_C_LP_LEFT,
  85. INTRA_C_LP_TOP,
  86. INTRA_C_DC_128,
  87. };
  88. enum mv_pred_t {
  89. MV_PRED_MEDIAN,
  90. MV_PRED_LEFT,
  91. MV_PRED_TOP,
  92. MV_PRED_TOPRIGHT,
  93. MV_PRED_PSKIP,
  94. MV_PRED_BSKIP
  95. };
  96. enum block_t {
  97. BLK_16X16,
  98. BLK_16X8,
  99. BLK_8X16,
  100. BLK_8X8
  101. };
  102. enum mv_loc_t {
  103. MV_FWD_D3 = 0,
  104. MV_FWD_B2,
  105. MV_FWD_B3,
  106. MV_FWD_C2,
  107. MV_FWD_A1,
  108. MV_FWD_X0,
  109. MV_FWD_X1,
  110. MV_FWD_A3 = 8,
  111. MV_FWD_X2,
  112. MV_FWD_X3,
  113. MV_BWD_D3 = MV_BWD_OFFS,
  114. MV_BWD_B2,
  115. MV_BWD_B3,
  116. MV_BWD_C2,
  117. MV_BWD_A1,
  118. MV_BWD_X0,
  119. MV_BWD_X1,
  120. MV_BWD_A3 = MV_BWD_OFFS+8,
  121. MV_BWD_X2,
  122. MV_BWD_X3
  123. };
  124. DECLARE_ALIGNED_8(typedef, struct) {
  125. int16_t x;
  126. int16_t y;
  127. int16_t dist;
  128. int16_t ref;
  129. } vector_t;
  130. typedef struct residual_vlc_t {
  131. int8_t rltab[59][3];
  132. int8_t level_add[27];
  133. int8_t golomb_order;
  134. int inc_limit;
  135. int8_t max_run;
  136. } residual_vlc_t;
  137. #endif /* CAVS_H */