3695
|
1 /**
|
|
2 * @file vp6data.h
|
|
3 * VP6 compatible video decoder
|
|
4 *
|
|
5 * Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
|
|
6 *
|
|
7 * This library 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 * This library 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 this library; if not, write to the Free Software
|
|
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
20 */
|
|
21
|
|
22 #ifndef VP6DATA_H
|
|
23 #define VP6DATA_H
|
|
24
|
|
25 #include <inttypes.h>
|
|
26 #include "vp56data.h"
|
|
27
|
|
28 static const uint8_t vp6_def_fdv_vector_model[2][8] = {
|
|
29 { 247, 210, 135, 68, 138, 220, 239, 246 },
|
|
30 { 244, 184, 201, 44, 173, 221, 239, 253 },
|
|
31 };
|
|
32
|
|
33 static const uint8_t vp6_def_pdv_vector_model[2][7] = {
|
|
34 { 225, 146, 172, 147, 214, 39, 156 },
|
|
35 { 204, 170, 119, 235, 140, 230, 228 },
|
|
36 };
|
|
37
|
|
38 static const uint8_t vp6_def_coeff_reorder[] = {
|
|
39 0, 0, 1, 1, 1, 2, 2, 2,
|
|
40 2, 2, 2, 3, 3, 4, 4, 4,
|
|
41 5, 5, 5, 5, 6, 6, 7, 7,
|
|
42 7, 7, 7, 8, 8, 9, 9, 9,
|
|
43 9, 9, 9, 10, 10, 11, 11, 11,
|
|
44 11, 11, 11, 12, 12, 12, 12, 12,
|
|
45 12, 13, 13, 13, 13, 13, 14, 14,
|
|
46 14, 14, 15, 15, 15, 15, 15, 15,
|
|
47 };
|
|
48
|
|
49 static const uint8_t vp6_def_runv_coeff_model[2][14] = {
|
|
50 { 198, 197, 196, 146, 198, 204, 169, 142, 130, 136, 149, 149, 191, 249 },
|
|
51 { 135, 201, 181, 154, 98, 117, 132, 126, 146, 169, 184, 240, 246, 254 },
|
|
52 };
|
|
53
|
|
54 static const uint8_t vp6_sig_dct_pct[2][2] = {
|
|
55 { 237, 246 },
|
|
56 { 231, 243 },
|
|
57 };
|
|
58
|
|
59 static const uint8_t vp6_pdv_pct[2][7] = {
|
|
60 { 253, 253, 254, 254, 254, 254, 254 },
|
|
61 { 245, 253, 254, 254, 254, 254, 254 },
|
|
62 };
|
|
63
|
|
64 static const uint8_t vp6_fdv_pct[2][8] = {
|
|
65 { 254, 254, 254, 254, 254, 250, 250, 252 },
|
|
66 { 254, 254, 254, 254, 254, 251, 251, 254 },
|
|
67 };
|
|
68
|
|
69 static const uint8_t vp6_dccv_pct[2][11] = {
|
|
70 { 146, 255, 181, 207, 232, 243, 238, 251, 244, 250, 249 },
|
|
71 { 179, 255, 214, 240, 250, 255, 244, 255, 255, 255, 255 },
|
|
72 };
|
|
73
|
|
74 static const uint8_t vp6_coeff_reorder_pct[] = {
|
|
75 255, 132, 132, 159, 153, 151, 161, 170,
|
|
76 164, 162, 136, 110, 103, 114, 129, 118,
|
|
77 124, 125, 132, 136, 114, 110, 142, 135,
|
|
78 134, 123, 143, 126, 153, 183, 166, 161,
|
|
79 171, 180, 179, 164, 203, 218, 225, 217,
|
|
80 215, 206, 203, 217, 229, 241, 248, 243,
|
|
81 253, 255, 253, 255, 255, 255, 255, 255,
|
|
82 255, 255, 255, 255, 255, 255, 255, 255,
|
|
83 };
|
|
84
|
|
85 static const uint8_t vp6_runv_pct[2][14] = {
|
|
86 { 219, 246, 238, 249, 232, 239, 249, 255, 248, 253, 239, 244, 241, 248 },
|
|
87 { 198, 232, 251, 253, 219, 241, 253, 255, 248, 249, 244, 238, 251, 255 },
|
|
88 };
|
|
89
|
|
90 static const uint8_t vp6_ract_pct[3][2][6][11] = {
|
|
91 { { { 227, 246, 230, 247, 244, 255, 255, 255, 255, 255, 255 },
|
|
92 { 255, 255, 209, 231, 231, 249, 249, 253, 255, 255, 255 },
|
|
93 { 255, 255, 225, 242, 241, 251, 253, 255, 255, 255, 255 },
|
|
94 { 255, 255, 241, 253, 252, 255, 255, 255, 255, 255, 255 },
|
|
95 { 255, 255, 248, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
96 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } },
|
|
97 { { 240, 255, 248, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
98 { 255, 255, 240, 253, 255, 255, 255, 255, 255, 255, 255 },
|
|
99 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
100 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
101 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
102 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } },
|
|
103 { { { 206, 203, 227, 239, 247, 255, 253, 255, 255, 255, 255 },
|
|
104 { 207, 199, 220, 236, 243, 252, 252, 255, 255, 255, 255 },
|
|
105 { 212, 219, 230, 243, 244, 253, 252, 255, 255, 255, 255 },
|
|
106 { 236, 237, 247, 252, 253, 255, 255, 255, 255, 255, 255 },
|
|
107 { 240, 240, 248, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
108 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } },
|
|
109 { { 230, 233, 249, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
110 { 238, 238, 250, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
111 { 248, 251, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
112 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
113 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
114 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } },
|
|
115 { { { 225, 239, 227, 231, 244, 253, 243, 255, 255, 253, 255 },
|
|
116 { 232, 234, 224, 228, 242, 249, 242, 252, 251, 251, 255 },
|
|
117 { 235, 249, 238, 240, 251, 255, 249, 255, 253, 253, 255 },
|
|
118 { 249, 253, 251, 250, 255, 255, 255, 255, 255, 255, 255 },
|
|
119 { 251, 250, 249, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
120 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } },
|
|
121 { { 243, 244, 250, 250, 255, 255, 255, 255, 255, 255, 255 },
|
|
122 { 249, 248, 250, 253, 255, 255, 255, 255, 255, 255, 255 },
|
|
123 { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
124 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
125 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
|
|
126 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } }
|
|
127 };
|
|
128
|
|
129 static const int vp6_dccv_lc[3][5][2] = {
|
|
130 { { 122, 133 }, { 0, 1 }, { 78, 171 }, { 139, 117 }, { 168, 79 } },
|
|
131 { { 133, 51 }, { 0, 1 }, { 169, 71 }, { 214, 44 }, { 210, 38 } },
|
|
132 { { 142, -16 }, { 0, 1 }, { 221, -30 }, { 246, -3 }, { 203, 17 } },
|
|
133 };
|
|
134
|
|
135 static const uint8_t vp6_coeff_groups[] = {
|
|
136 0, 0, 1, 1, 1, 2, 2, 2,
|
|
137 2, 2, 2, 3, 3, 3, 3, 3,
|
|
138 3, 3, 3, 3, 3, 3, 4, 4,
|
|
139 4, 4, 4, 4, 4, 4, 4, 4,
|
|
140 4, 4, 4, 4, 4, 5, 5, 5,
|
|
141 5, 5, 5, 5, 5, 5, 5, 5,
|
|
142 5, 5, 5, 5, 5, 5, 5, 5,
|
|
143 5, 5, 5, 5, 5, 5, 5, 5,
|
|
144 };
|
|
145
|
|
146 static const int16_t vp6_block_copy_filter[16][8][4] = {
|
|
147 { { 0, 128, 0, 0 }, /* 0 */
|
|
148 { -3, 122, 9, 0 },
|
|
149 { -4, 109, 24, -1 },
|
|
150 { -5, 91, 45, -3 },
|
|
151 { -4, 68, 68, -4 },
|
|
152 { -3, 45, 91, -5 },
|
|
153 { -1, 24, 109, -4 },
|
|
154 { 0, 9, 122, -3 } },
|
|
155 { { 0, 128, 0, 0 }, /* 1 */
|
|
156 { -4, 124, 9, -1 },
|
|
157 { -5, 110, 25, -2 },
|
|
158 { -6, 91, 46, -3 },
|
|
159 { -5, 69, 69, -5 },
|
|
160 { -3, 46, 91, -6 },
|
|
161 { -2, 25, 110, -5 },
|
|
162 { -1, 9, 124, -4 } },
|
|
163 { { 0, 128, 0, 0 }, /* 2 */
|
|
164 { -4, 123, 10, -1 },
|
|
165 { -6, 110, 26, -2 },
|
|
166 { -7, 92, 47, -4 },
|
|
167 { -6, 70, 70, -6 },
|
|
168 { -4, 47, 92, -7 },
|
|
169 { -2, 26, 110, -6 },
|
|
170 { -1, 10, 123, -4 } },
|
|
171 { { 0, 128, 0, 0 }, /* 3 */
|
|
172 { -5, 124, 10, -1 },
|
|
173 { -7, 110, 27, -2 },
|
|
174 { -7, 91, 48, -4 },
|
|
175 { -6, 70, 70, -6 },
|
|
176 { -4, 48, 92, -8 },
|
|
177 { -2, 27, 110, -7 },
|
|
178 { -1, 10, 124, -5 } },
|
|
179 { { 0, 128, 0, 0 }, /* 4 */
|
|
180 { -6, 124, 11, -1 },
|
|
181 { -8, 111, 28, -3 },
|
|
182 { -8, 92, 49, -5 },
|
|
183 { -7, 71, 71, -7 },
|
|
184 { -5, 49, 92, -8 },
|
|
185 { -3, 28, 111, -8 },
|
|
186 { -1, 11, 124, -6 } },
|
|
187 { { 0, 128, 0, 0 }, /* 5 */
|
|
188 { -6, 123, 12, -1 },
|
|
189 { -9, 111, 29, -3 },
|
|
190 { -9, 93, 50, -6 },
|
|
191 { -8, 72, 72, -8 },
|
|
192 { -6, 50, 93, -9 },
|
|
193 { -3, 29, 111, -9 },
|
|
194 { -1, 12, 123, -6 } },
|
|
195 { { 0, 128, 0, 0 }, /* 6 */
|
|
196 { -7, 124, 12, -1 },
|
|
197 { -10, 111, 30, -3 },
|
|
198 { -10, 93, 51, -6 },
|
|
199 { -9, 73, 73, -9 },
|
|
200 { -6, 51, 93, -10 },
|
|
201 { -3, 30, 111, -10 },
|
|
202 { -1, 12, 124, -7 } },
|
|
203 { { 0, 128, 0, 0 }, /* 7 */
|
|
204 { -7, 123, 13, -1 },
|
|
205 { -11, 112, 31, -4 },
|
|
206 { -11, 94, 52, -7 },
|
|
207 { -10, 74, 74, -10 },
|
|
208 { -7, 52, 94, -11 },
|
|
209 { -4, 31, 112, -11 },
|
|
210 { -1, 13, 123, -7 } },
|
|
211 { { 0, 128, 0, 0 }, /* 8 */
|
|
212 { -8, 124, 13, -1 },
|
|
213 { -12, 112, 32, -4 },
|
|
214 { -12, 94, 53, -7 },
|
|
215 { -10, 74, 74, -10 },
|
|
216 { -7, 53, 94, -12 },
|
|
217 { -4, 32, 112, -12 },
|
|
218 { -1, 13, 124, -8 } },
|
|
219 { { 0, 128, 0, 0 }, /* 9 */
|
|
220 { -9, 124, 14, -1 },
|
|
221 { -13, 112, 33, -4 },
|
|
222 { -13, 95, 54, -8 },
|
|
223 { -11, 75, 75, -11 },
|
|
224 { -8, 54, 95, -13 },
|
|
225 { -4, 33, 112, -13 },
|
|
226 { -1, 14, 124, -9 } },
|
|
227 { { 0, 128, 0, 0 }, /* 10 */
|
|
228 { -9, 123, 15, -1 },
|
|
229 { -14, 113, 34, -5 },
|
|
230 { -14, 95, 55, -8 },
|
|
231 { -12, 76, 76, -12 },
|
|
232 { -8, 55, 95, -14 },
|
|
233 { -5, 34, 112, -13 },
|
|
234 { -1, 15, 123, -9 } },
|
|
235 { { 0, 128, 0, 0 }, /* 11 */
|
|
236 { -10, 124, 15, -1 },
|
|
237 { -14, 113, 34, -5 },
|
|
238 { -15, 96, 56, -9 },
|
|
239 { -13, 77, 77, -13 },
|
|
240 { -9, 56, 96, -15 },
|
|
241 { -5, 34, 113, -14 },
|
|
242 { -1, 15, 124, -10 } },
|
|
243 { { 0, 128, 0, 0 }, /* 12 */
|
|
244 { -10, 123, 16, -1 },
|
|
245 { -15, 113, 35, -5 },
|
|
246 { -16, 98, 56, -10 },
|
|
247 { -14, 78, 78, -14 },
|
|
248 { -10, 56, 98, -16 },
|
|
249 { -5, 35, 113, -15 },
|
|
250 { -1, 16, 123, -10 } },
|
|
251 { { 0, 128, 0, 0 }, /* 13 */
|
|
252 { -11, 124, 17, -2 },
|
|
253 { -16, 113, 36, -5 },
|
|
254 { -17, 98, 57, -10 },
|
|
255 { -14, 78, 78, -14 },
|
|
256 { -10, 57, 98, -17 },
|
|
257 { -5, 36, 113, -16 },
|
|
258 { -2, 17, 124, -11 } },
|
|
259 { { 0, 128, 0, 0 }, /* 14 */
|
|
260 { -12, 125, 17, -2 },
|
|
261 { -17, 114, 37, -6 },
|
|
262 { -18, 99, 58, -11 },
|
|
263 { -15, 79, 79, -15 },
|
|
264 { -11, 58, 99, -18 },
|
|
265 { -6, 37, 114, -17 },
|
|
266 { -2, 17, 125, -12 } },
|
|
267 { { 0, 128, 0, 0 }, /* 15 */
|
|
268 { -12, 124, 18, -2 },
|
|
269 { -18, 114, 38, -6 },
|
|
270 { -19, 99, 59, -11 },
|
|
271 { -16, 80, 80, -16 },
|
|
272 { -11, 59, 99, -19 },
|
|
273 { -6, 38, 114, -18 },
|
|
274 { -2, 18, 124, -12 } },
|
|
275 };
|
|
276
|
|
277 const vp56_tree_t vp6_pcr_tree[] = {
|
|
278 { 8, 0},
|
|
279 { 4, 1},
|
|
280 { 2, 2}, {-1}, {-2},
|
|
281 { 2, 3}, {-3}, {-4},
|
|
282 { 8, 4},
|
|
283 { 4, 5},
|
|
284 { 2, 6}, {-5}, {-6},
|
|
285 { 2, 7}, {-7}, {-8},
|
|
286 {-0},
|
|
287 };
|
|
288
|
|
289 static const uint8_t vp6_coord_div[] = { 4, 4, 4, 4, 8, 8 };
|
|
290
|
|
291 #endif /* VP6DATA_H */
|