2 * Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 * VP6 compatible video decoder
26 #ifndef AVCODEC_VP6DATA_H
27 #define AVCODEC_VP6DATA_H
33 static const uint8_t vp6_def_fdv_vector_model
[2][8] = {
34 { 247, 210, 135, 68, 138, 220, 239, 246 },
35 { 244, 184, 201, 44, 173, 221, 239, 253 },
38 static const uint8_t vp6_def_pdv_vector_model
[2][7] = {
39 { 225, 146, 172, 147, 214, 39, 156 },
40 { 204, 170, 119, 235, 140, 230, 228 },
43 static const uint8_t vp6_def_coeff_reorder
[] = {
44 0, 0, 1, 1, 1, 2, 2, 2,
45 2, 2, 2, 3, 3, 4, 4, 4,
46 5, 5, 5, 5, 6, 6, 7, 7,
47 7, 7, 7, 8, 8, 9, 9, 9,
48 9, 9, 9, 10, 10, 11, 11, 11,
49 11, 11, 11, 12, 12, 12, 12, 12,
50 12, 13, 13, 13, 13, 13, 14, 14,
51 14, 14, 15, 15, 15, 15, 15, 15,
54 static const uint8_t vp6_def_runv_coeff_model
[2][14] = {
55 { 198, 197, 196, 146, 198, 204, 169, 142, 130, 136, 149, 149, 191, 249 },
56 { 135, 201, 181, 154, 98, 117, 132, 126, 146, 169, 184, 240, 246, 254 },
59 static const uint8_t vp6_sig_dct_pct
[2][2] = {
64 static const uint8_t vp6_pdv_pct
[2][7] = {
65 { 253, 253, 254, 254, 254, 254, 254 },
66 { 245, 253, 254, 254, 254, 254, 254 },
69 static const uint8_t vp6_fdv_pct
[2][8] = {
70 { 254, 254, 254, 254, 254, 250, 250, 252 },
71 { 254, 254, 254, 254, 254, 251, 251, 254 },
74 static const uint8_t vp6_dccv_pct
[2][11] = {
75 { 146, 255, 181, 207, 232, 243, 238, 251, 244, 250, 249 },
76 { 179, 255, 214, 240, 250, 255, 244, 255, 255, 255, 255 },
79 static const uint8_t vp6_coeff_reorder_pct
[] = {
80 255, 132, 132, 159, 153, 151, 161, 170,
81 164, 162, 136, 110, 103, 114, 129, 118,
82 124, 125, 132, 136, 114, 110, 142, 135,
83 134, 123, 143, 126, 153, 183, 166, 161,
84 171, 180, 179, 164, 203, 218, 225, 217,
85 215, 206, 203, 217, 229, 241, 248, 243,
86 253, 255, 253, 255, 255, 255, 255, 255,
87 255, 255, 255, 255, 255, 255, 255, 255,
90 static const uint8_t vp6_runv_pct
[2][14] = {
91 { 219, 246, 238, 249, 232, 239, 249, 255, 248, 253, 239, 244, 241, 248 },
92 { 198, 232, 251, 253, 219, 241, 253, 255, 248, 249, 244, 238, 251, 255 },
95 static const uint8_t vp6_ract_pct
[3][2][6][11] = {
96 { { { 227, 246, 230, 247, 244, 255, 255, 255, 255, 255, 255 },
97 { 255, 255, 209, 231, 231, 249, 249, 253, 255, 255, 255 },
98 { 255, 255, 225, 242, 241, 251, 253, 255, 255, 255, 255 },
99 { 255, 255, 241, 253, 252, 255, 255, 255, 255, 255, 255 },
100 { 255, 255, 248, 255, 255, 255, 255, 255, 255, 255, 255 },
101 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } },
102 { { 240, 255, 248, 255, 255, 255, 255, 255, 255, 255, 255 },
103 { 255, 255, 240, 253, 255, 255, 255, 255, 255, 255, 255 },
104 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
105 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
106 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
107 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } },
108 { { { 206, 203, 227, 239, 247, 255, 253, 255, 255, 255, 255 },
109 { 207, 199, 220, 236, 243, 252, 252, 255, 255, 255, 255 },
110 { 212, 219, 230, 243, 244, 253, 252, 255, 255, 255, 255 },
111 { 236, 237, 247, 252, 253, 255, 255, 255, 255, 255, 255 },
112 { 240, 240, 248, 255, 255, 255, 255, 255, 255, 255, 255 },
113 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } },
114 { { 230, 233, 249, 255, 255, 255, 255, 255, 255, 255, 255 },
115 { 238, 238, 250, 255, 255, 255, 255, 255, 255, 255, 255 },
116 { 248, 251, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
117 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
118 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
119 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } },
120 { { { 225, 239, 227, 231, 244, 253, 243, 255, 255, 253, 255 },
121 { 232, 234, 224, 228, 242, 249, 242, 252, 251, 251, 255 },
122 { 235, 249, 238, 240, 251, 255, 249, 255, 253, 253, 255 },
123 { 249, 253, 251, 250, 255, 255, 255, 255, 255, 255, 255 },
124 { 251, 250, 249, 255, 255, 255, 255, 255, 255, 255, 255 },
125 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } },
126 { { 243, 244, 250, 250, 255, 255, 255, 255, 255, 255, 255 },
127 { 249, 248, 250, 253, 255, 255, 255, 255, 255, 255, 255 },
128 { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
129 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
130 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 },
131 { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } }
134 static const int vp6_dccv_lc
[3][5][2] = {
135 { { 122, 133 }, { 0, 1 }, { 78, 171 }, { 139, 117 }, { 168, 79 } },
136 { { 133, 51 }, { 0, 1 }, { 169, 71 }, { 214, 44 }, { 210, 38 } },
137 { { 142, -16 }, { 0, 1 }, { 221, -30 }, { 246, -3 }, { 203, 17 } },
140 static const uint8_t vp6_coeff_groups
[] = {
141 0, 0, 1, 1, 1, 2, 2, 2,
142 2, 2, 2, 3, 3, 3, 3, 3,
143 3, 3, 3, 3, 3, 3, 4, 4,
144 4, 4, 4, 4, 4, 4, 4, 4,
145 4, 4, 4, 4, 4, 5, 5, 5,
146 5, 5, 5, 5, 5, 5, 5, 5,
147 5, 5, 5, 5, 5, 5, 5, 5,
148 5, 5, 5, 5, 5, 5, 5, 5,
151 static const int16_t vp6_block_copy_filter
[17][8][4] = {
152 { { 0, 128, 0, 0 }, /* 0 */
160 { { 0, 128, 0, 0 }, /* 1 */
167 { -1, 9, 124, -4 } },
168 { { 0, 128, 0, 0 }, /* 2 */
175 { -1, 10, 123, -4 } },
176 { { 0, 128, 0, 0 }, /* 3 */
183 { -1, 10, 124, -5 } },
184 { { 0, 128, 0, 0 }, /* 4 */
191 { -1, 11, 124, -6 } },
192 { { 0, 128, 0, 0 }, /* 5 */
199 { -1, 12, 123, -6 } },
200 { { 0, 128, 0, 0 }, /* 6 */
202 { -10, 111, 30, -3 },
206 { -3, 30, 111, -10 },
207 { -1, 12, 124, -7 } },
208 { { 0, 128, 0, 0 }, /* 7 */
210 { -11, 112, 31, -4 },
212 { -10, 74, 74, -10 },
214 { -4, 31, 112, -11 },
215 { -1, 13, 123, -7 } },
216 { { 0, 128, 0, 0 }, /* 8 */
218 { -12, 112, 32, -4 },
220 { -10, 74, 74, -10 },
222 { -4, 32, 112, -12 },
223 { -1, 13, 124, -8 } },
224 { { 0, 128, 0, 0 }, /* 9 */
226 { -13, 112, 33, -4 },
228 { -11, 75, 75, -11 },
230 { -4, 33, 112, -13 },
231 { -1, 14, 124, -9 } },
232 { { 0, 128, 0, 0 }, /* 10 */
234 { -14, 113, 34, -5 },
236 { -12, 76, 76, -12 },
238 { -5, 34, 112, -13 },
239 { -1, 15, 123, -9 } },
240 { { 0, 128, 0, 0 }, /* 11 */
241 { -10, 124, 15, -1 },
242 { -14, 113, 34, -5 },
244 { -13, 77, 77, -13 },
246 { -5, 34, 113, -14 },
247 { -1, 15, 124, -10 } },
248 { { 0, 128, 0, 0 }, /* 12 */
249 { -10, 123, 16, -1 },
250 { -15, 113, 35, -5 },
251 { -16, 98, 56, -10 },
252 { -14, 78, 78, -14 },
253 { -10, 56, 98, -16 },
254 { -5, 35, 113, -15 },
255 { -1, 16, 123, -10 } },
256 { { 0, 128, 0, 0 }, /* 13 */
257 { -11, 124, 17, -2 },
258 { -16, 113, 36, -5 },
259 { -17, 98, 57, -10 },
260 { -14, 78, 78, -14 },
261 { -10, 57, 98, -17 },
262 { -5, 36, 113, -16 },
263 { -2, 17, 124, -11 } },
264 { { 0, 128, 0, 0 }, /* 14 */
265 { -12, 125, 17, -2 },
266 { -17, 114, 37, -6 },
267 { -18, 99, 58, -11 },
268 { -15, 79, 79, -15 },
269 { -11, 58, 99, -18 },
270 { -6, 37, 114, -17 },
271 { -2, 17, 125, -12 } },
272 { { 0, 128, 0, 0 }, /* 15 */
273 { -12, 124, 18, -2 },
274 { -18, 114, 38, -6 },
275 { -19, 99, 59, -11 },
276 { -16, 80, 80, -16 },
277 { -11, 59, 99, -19 },
278 { -6, 38, 114, -18 },
279 { -2, 18, 124, -12 } },
280 { { 0, 128, 0, 0 }, /* 16 */
287 { -2, 16, 118, -4 } },
290 static const VP56Tree vp6_pcr_tree
[] = {
302 static const uint8_t vp6_coord_div
[] = { 4, 4, 4, 4, 8, 8 };
304 static const uint8_t vp6_huff_coeff_map
[] = {
305 13, 14, 11, 0, 1, 15, 16, 18, 2, 17, 3, 4, 19, 20, 5, 6, 21, 22, 7, 8, 9, 10
308 static const uint8_t vp6_huff_run_map
[] = {
309 10, 13, 11, 12, 0, 1, 2, 3, 14, 8, 15, 16, 4, 5, 6, 7
312 #endif /* AVCODEC_VP6DATA_H */