comparison cavsdata.h @ 4944:5d4544d7cbbc libavcodec

move defines and enums out of cavsdata.h
author aurel
date Tue, 08 May 2007 23:58:35 +0000
parents 6c457e692336
children 9ecbfc0c82bf
comparison
equal deleted inserted replaced
4943:25cd2084129a 4944:5d4544d7cbbc
17 * You should have received a copy of the GNU Lesser General Public 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 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 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */ 20 */
21 21
22 #define SLICE_MIN_START_CODE 0x00000101 22 #include "cavs.h"
23 #define SLICE_MAX_START_CODE 0x000001af 23
24 #define EXT_START_CODE 0x000001b5
25 #define USER_START_CODE 0x000001b2
26 #define CAVS_START_CODE 0x000001b0
27 #define PIC_I_START_CODE 0x000001b3
28 #define PIC_PB_START_CODE 0x000001b6
29
30 #define A_AVAIL 1
31 #define B_AVAIL 2
32 #define C_AVAIL 4
33 #define D_AVAIL 8
34 #define NOT_AVAIL -1
35 #define REF_INTRA -2
36 #define REF_DIR -3
37
38 #define ESCAPE_CODE 59
39
40 #define FWD0 0x01
41 #define FWD1 0x02
42 #define BWD0 0x04
43 #define BWD1 0x08
44 #define SYM0 0x10
45 #define SYM1 0x20
46 #define SPLITH 0x40
47 #define SPLITV 0x80
48
49 #define MV_BWD_OFFS 12
50 #define MV_STRIDE 4
51
52 enum mb_t {
53 I_8X8 = 0,
54 P_SKIP,
55 P_16X16,
56 P_16X8,
57 P_8X16,
58 P_8X8,
59 B_SKIP,
60 B_DIRECT,
61 B_FWD_16X16,
62 B_BWD_16X16,
63 B_SYM_16X16,
64 B_8X8 = 29
65 };
66
67 enum sub_mb_t {
68 B_SUB_DIRECT,
69 B_SUB_FWD,
70 B_SUB_BWD,
71 B_SUB_SYM
72 };
73
74 enum intra_luma_t {
75 INTRA_L_VERT,
76 INTRA_L_HORIZ,
77 INTRA_L_LP,
78 INTRA_L_DOWN_LEFT,
79 INTRA_L_DOWN_RIGHT,
80 INTRA_L_LP_LEFT,
81 INTRA_L_LP_TOP,
82 INTRA_L_DC_128
83 };
84
85 enum intra_chroma_t {
86 INTRA_C_LP,
87 INTRA_C_HORIZ,
88 INTRA_C_VERT,
89 INTRA_C_PLANE,
90 INTRA_C_LP_LEFT,
91 INTRA_C_LP_TOP,
92 INTRA_C_DC_128,
93 };
94
95 enum mv_pred_t {
96 MV_PRED_MEDIAN,
97 MV_PRED_LEFT,
98 MV_PRED_TOP,
99 MV_PRED_TOPRIGHT,
100 MV_PRED_PSKIP,
101 MV_PRED_BSKIP
102 };
103
104 enum block_t {
105 BLK_16X16,
106 BLK_16X8,
107 BLK_8X16,
108 BLK_8X8
109 };
110
111 enum mv_loc_t {
112 MV_FWD_D3 = 0,
113 MV_FWD_B2,
114 MV_FWD_B3,
115 MV_FWD_C2,
116 MV_FWD_A1,
117 MV_FWD_X0,
118 MV_FWD_X1,
119 MV_FWD_A3 = 8,
120 MV_FWD_X2,
121 MV_FWD_X3,
122 MV_BWD_D3 = MV_BWD_OFFS,
123 MV_BWD_B2,
124 MV_BWD_B3,
125 MV_BWD_C2,
126 MV_BWD_A1,
127 MV_BWD_X0,
128 MV_BWD_X1,
129 MV_BWD_A3 = MV_BWD_OFFS+8,
130 MV_BWD_X2,
131 MV_BWD_X3
132 };
133
134 #ifdef CONFIG_CAVS_DECODER
135 static const uint8_t partition_flags[30] = { 24 static const uint8_t partition_flags[30] = {
136 0, //I_8X8 25 0, //I_8X8
137 0, //P_SKIP 26 0, //P_SKIP
138 0, //P_16X16 27 0, //P_16X16
139 SPLITH, //P_16X8 28 SPLITH, //P_16X8
210 65535,35744,38968,42495,46341,50535,55099,60087, 99 65535,35744,38968,42495,46341,50535,55099,60087,
211 65535,35734,38973,42500,46341,50535,55109,60097, 100 65535,35734,38973,42500,46341,50535,55109,60097,
212 32771,35734,38965,42497,46341,50535,55109,60099 101 32771,35734,38965,42497,46341,50535,55109,60099
213 }; 102 };
214 103
215 DECLARE_ALIGNED_8(typedef, struct) {
216 int16_t x;
217 int16_t y;
218 int16_t dist;
219 int16_t ref;
220 } vector_t;
221
222 /** marks block as unavailable, i.e. out of picture 104 /** marks block as unavailable, i.e. out of picture
223 or not yet decoded */ 105 or not yet decoded */
224 static const vector_t un_mv = {0,0,1,NOT_AVAIL}; 106 static const vector_t un_mv = {0,0,1,NOT_AVAIL};
225 107
226 /** marks block as "no prediction from this direction" 108 /** marks block as "no prediction from this direction"
227 e.g. forward motion vector in BWD partition */ 109 e.g. forward motion vector in BWD partition */
228 static const vector_t dir_mv = {0,0,1,REF_DIR}; 110 static const vector_t dir_mv = {0,0,1,REF_DIR};
229 111
230 /** marks block as using intra prediction */ 112 /** marks block as using intra prediction */
231 static const vector_t intra_mv = {0,0,1,REF_INTRA}; 113 static const vector_t intra_mv = {0,0,1,REF_INTRA};
232
233 typedef struct residual_vlc_t {
234 int8_t rltab[59][3];
235 int8_t level_add[27];
236 int8_t golomb_order;
237 int inc_limit;
238 int8_t max_run;
239 } residual_vlc_t;
240 114
241 #define EOB 0,0,0 115 #define EOB 0,0,0
242 116
243 static const residual_vlc_t intra_2dvlc[7] = { 117 static const residual_vlc_t intra_2dvlc[7] = {
244 { 118 {
638 512
639 static const int_fast8_t left_modifier_l[8] = { 0,-1, 6,-1,-1, 7, 6, 7}; 513 static const int_fast8_t left_modifier_l[8] = { 0,-1, 6,-1,-1, 7, 6, 7};
640 static const int_fast8_t top_modifier_l[8] = {-1, 1, 5,-1,-1, 5, 7, 7}; 514 static const int_fast8_t top_modifier_l[8] = {-1, 1, 5,-1,-1, 5, 7, 7};
641 static const int_fast8_t left_modifier_c[7] = { 5,-1, 2,-1, 6, 5, 6}; 515 static const int_fast8_t left_modifier_c[7] = { 5,-1, 2,-1, 6, 5, 6};
642 static const int_fast8_t top_modifier_c[7] = { 4, 1,-1,-1, 4, 6, 6}; 516 static const int_fast8_t top_modifier_c[7] = { 4, 1,-1,-1, 4, 6, 6};
643 #endif /* CONFIG_CAVS_DECODER */