[cvs] / xvidcore / src / bitstream / vlc_codes.h Repository:
ViewVC logotype

Annotation of /xvidcore/src/bitstream/vlc_codes.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (view) (download)

1 : edgomez 1.7 /*****************************************************************************
2 :     *
3 :     * XVID MPEG-4 VIDEO CODEC
4 :     * - Vector Length Coding tables -
5 :     *
6 : edgomez 1.11 * Copyright(C) 2002 Michael Militzer <isibaar@xvid.org>
7 : edgomez 1.7 *
8 : edgomez 1.12 * This file is part of XviD, a free MPEG-4 video encoder/decoder
9 : edgomez 1.7 *
10 : edgomez 1.12 * XviD is free software; you can redistribute it and/or modify it
11 :     * under the terms of the GNU General Public License as published by
12 : edgomez 1.7 * the Free Software Foundation; either version 2 of the License, or
13 :     * (at your option) any later version.
14 :     *
15 :     * This program is distributed in the hope that it will be useful,
16 :     * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 :     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 :     * GNU General Public License for more details.
19 :     *
20 :     * You should have received a copy of the GNU General Public License
21 :     * along with this program; if not, write to the Free Software
22 :     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 :     *
24 : edgomez 1.12 * Under section 8 of the GNU General Public License, the copyright
25 :     * holders of XVID explicitly forbid distribution in the following
26 :     * countries:
27 :     *
28 :     * - Japan
29 :     * - United States of America
30 :     *
31 :     * Linking XviD statically or dynamically with other modules is making a
32 :     * combined work based on XviD. Thus, the terms and conditions of the
33 :     * GNU General Public License cover the whole combination.
34 :     *
35 :     * As a special exception, the copyright holders of XviD give you
36 :     * permission to link XviD with independent modules that communicate with
37 :     * XviD solely through the VFW1.1 and DShow interfaces, regardless of the
38 :     * license terms of these independent modules, and to copy and distribute
39 :     * the resulting combined work under terms of your choice, provided that
40 :     * every copy of the combined work is accompanied by a complete copy of
41 :     * the source code of XviD (the version of XviD used to produce the
42 :     * combined work), being distributed under the terms of the GNU General
43 :     * Public License plus this exception. An independent module is a module
44 :     * which is not derived from or based on XviD.
45 :     *
46 :     * Note that people who make modified versions of XviD are not obligated
47 :     * to grant this special exception for their modified versions; it is
48 :     * their choice whether to do so. The GNU General Public License gives
49 :     * permission to release a modified version without this exception; this
50 :     * exception also makes it possible to release a modified version which
51 :     * carries forward this exception.
52 :     *
53 :     * $Id$
54 : edgomez 1.7 *
55 :     ****************************************************************************/
56 :    
57 : Isibaar 1.1 #ifndef _VLC_CODES_H_
58 :     #define _VLC_CODES_H_
59 :    
60 :     #include "../portab.h"
61 : Isibaar 1.5 #include "mbcoding.h"
62 : Isibaar 1.1
63 :     #define VLC_ERROR (-1)
64 : Isibaar 1.5 #define ESCAPE 7167
65 : Isibaar 1.1
66 : edgomez 1.7 /*****************************************************************************
67 :     * The Vector Length Coding structure
68 :     ****************************************************************************/
69 :    
70 : Isibaar 1.1 typedef struct
71 :     {
72 :     uint32_t code;
73 :     int8_t len;
74 : edgomez 1.6 }
75 :     VLC;
76 : Isibaar 1.1
77 : Isibaar 1.5 static VLC *DCT3D[2];
78 :    
79 : Isibaar 1.1
80 : edgomez 1.7 /*****************************************************************************
81 :     * common tables between encoder/decoder
82 :     ****************************************************************************/
83 : Isibaar 1.1
84 :     /* constants taken from momusys/vm_common/inlcude/max_level.h */
85 : edgomez 1.10 static char const max_level[4][64] = {
86 : edgomez 1.7 /* intra, last = 0 */
87 :     {
88 : edgomez 1.6 27, 10, 5, 4, 3, 3, 3, 3,
89 :     2, 2, 1, 1, 1, 1, 1, 0,
90 :     0, 0, 0, 0, 0, 0, 0, 0,
91 :     0, 0, 0, 0, 0, 0, 0, 0,
92 :     0, 0, 0, 0, 0, 0, 0, 0,
93 :     0, 0, 0, 0, 0, 0, 0, 0,
94 :     0, 0, 0, 0, 0, 0, 0, 0,
95 : edgomez 1.7 0, 0, 0, 0, 0, 0, 0, 0
96 : edgomez 1.6 },
97 :    
98 : edgomez 1.7 /* intra, last = 1 */
99 :     {
100 : edgomez 1.6 8, 3, 2, 2, 2, 2, 2, 1,
101 :     1, 1, 1, 1, 1, 1, 1, 1,
102 :     1, 1, 1, 1, 1, 0, 0, 0,
103 :     0, 0, 0, 0, 0, 0, 0, 0,
104 :     0, 0, 0, 0, 0, 0, 0, 0,
105 :     0, 0, 0, 0, 0, 0, 0, 0,
106 :     0, 0, 0, 0, 0, 0, 0, 0,
107 : edgomez 1.7 0, 0, 0, 0, 0, 0, 0, 0
108 : edgomez 1.6 },
109 :    
110 : edgomez 1.7 /* inter, last = 0 */
111 :     {
112 : edgomez 1.6 12, 6, 4, 3, 3, 3, 3, 2,
113 :     2, 2, 2, 1, 1, 1, 1, 1,
114 :     1, 1, 1, 1, 1, 1, 1, 1,
115 :     1, 1, 1, 0, 0, 0, 0, 0,
116 :     0, 0, 0, 0, 0, 0, 0, 0,
117 :     0, 0, 0, 0, 0, 0, 0, 0,
118 :     0, 0, 0, 0, 0, 0, 0, 0,
119 : edgomez 1.7 0, 0, 0, 0, 0, 0, 0, 0
120 : edgomez 1.6 },
121 :    
122 : edgomez 1.7 /* inter, last = 1 */
123 :     {
124 : edgomez 1.6 3, 2, 1, 1, 1, 1, 1, 1,
125 :     1, 1, 1, 1, 1, 1, 1, 1,
126 :     1, 1, 1, 1, 1, 1, 1, 1,
127 :     1, 1, 1, 1, 1, 1, 1, 1,
128 :     1, 1, 1, 1, 1, 1, 1, 1,
129 :     1, 0, 0, 0, 0, 0, 0, 0,
130 :     0, 0, 0, 0, 0, 0, 0, 0,
131 : edgomez 1.7 0, 0, 0, 0, 0, 0, 0, 0
132 : edgomez 1.6 }
133 : Isibaar 1.1 };
134 :    
135 : edgomez 1.10 static char const max_run[4][256] = {
136 : edgomez 1.7 /* intra, last = 0 */
137 :     {
138 : edgomez 1.6 0, 14, 9, 7, 3, 2, 1, 1,
139 :     1, 1, 1, 0, 0, 0, 0, 0,
140 :     0, 0, 0, 0, 0, 0, 0, 0,
141 :     0, 0, 0, 0, 0, 0, 0, 0,
142 :     0, 0, 0, 0, 0, 0, 0, 0,
143 :     0, 0, 0, 0, 0, 0, 0, 0,
144 :     0, 0, 0, 0, 0, 0, 0, 0,
145 :     0, 0, 0, 0, 0, 0, 0, 0,
146 :     0, 0, 0, 0, 0, 0, 0, 0,
147 :     0, 0, 0, 0, 0, 0, 0, 0,
148 :     0, 0, 0, 0, 0, 0, 0, 0,
149 :     0, 0, 0, 0, 0, 0, 0, 0,
150 :     0, 0, 0, 0, 0, 0, 0, 0,
151 :     0, 0, 0, 0, 0, 0, 0, 0,
152 :     0, 0, 0, 0, 0, 0, 0, 0,
153 :     0, 0, 0, 0, 0, 0, 0, 0,
154 :     0, 0, 0, 0, 0, 0, 0, 0,
155 :     0, 0, 0, 0, 0, 0, 0, 0,
156 :     0, 0, 0, 0, 0, 0, 0, 0,
157 :     0, 0, 0, 0, 0, 0, 0, 0,
158 :     0, 0, 0, 0, 0, 0, 0, 0,
159 :     0, 0, 0, 0, 0, 0, 0, 0,
160 :     0, 0, 0, 0, 0, 0, 0, 0,
161 :     0, 0, 0, 0, 0, 0, 0, 0,
162 :     0, 0, 0, 0, 0, 0, 0, 0,
163 :     0, 0, 0, 0, 0, 0, 0, 0,
164 :     0, 0, 0, 0, 0, 0, 0, 0,
165 :     0, 0, 0, 0, 0, 0, 0, 0,
166 :     0, 0, 0, 0, 0, 0, 0, 0,
167 :     0, 0, 0, 0, 0, 0, 0, 0,
168 :     0, 0, 0, 0, 0, 0, 0, 0,
169 : edgomez 1.7 0, 0, 0, 0, 0, 0, 0, 0
170 : edgomez 1.6 },
171 :    
172 : edgomez 1.7 /* intra, last = 1 */
173 :     {
174 : edgomez 1.6 0, 20, 6, 1, 0, 0, 0, 0,
175 :     0, 0, 0, 0, 0, 0, 0, 0,
176 :     0, 0, 0, 0, 0, 0, 0, 0,
177 :     0, 0, 0, 0, 0, 0, 0, 0,
178 :     0, 0, 0, 0, 0, 0, 0, 0,
179 :     0, 0, 0, 0, 0, 0, 0, 0,
180 :     0, 0, 0, 0, 0, 0, 0, 0,
181 :     0, 0, 0, 0, 0, 0, 0, 0,
182 :     0, 0, 0, 0, 0, 0, 0, 0,
183 :     0, 0, 0, 0, 0, 0, 0, 0,
184 :     0, 0, 0, 0, 0, 0, 0, 0,
185 :     0, 0, 0, 0, 0, 0, 0, 0,
186 :     0, 0, 0, 0, 0, 0, 0, 0,
187 :     0, 0, 0, 0, 0, 0, 0, 0,
188 :     0, 0, 0, 0, 0, 0, 0, 0,
189 :     0, 0, 0, 0, 0, 0, 0, 0,
190 :     0, 0, 0, 0, 0, 0, 0, 0,
191 :     0, 0, 0, 0, 0, 0, 0, 0,
192 :     0, 0, 0, 0, 0, 0, 0, 0,
193 :     0, 0, 0, 0, 0, 0, 0, 0,
194 :     0, 0, 0, 0, 0, 0, 0, 0,
195 :     0, 0, 0, 0, 0, 0, 0, 0,
196 :     0, 0, 0, 0, 0, 0, 0, 0,
197 :     0, 0, 0, 0, 0, 0, 0, 0,
198 :     0, 0, 0, 0, 0, 0, 0, 0,
199 :     0, 0, 0, 0, 0, 0, 0, 0,
200 :     0, 0, 0, 0, 0, 0, 0, 0,
201 :     0, 0, 0, 0, 0, 0, 0, 0,
202 :     0, 0, 0, 0, 0, 0, 0, 0,
203 :     0, 0, 0, 0, 0, 0, 0, 0,
204 :     0, 0, 0, 0, 0, 0, 0, 0,
205 : edgomez 1.7 0, 0, 0, 0, 0, 0, 0, 0
206 : edgomez 1.6 },
207 :    
208 : edgomez 1.7 /* inter, last = 0 */
209 :     {
210 : edgomez 1.6 0, 26, 10, 6, 2, 1, 1, 0,
211 :     0, 0, 0, 0, 0, 0, 0, 0,
212 :     0, 0, 0, 0, 0, 0, 0, 0,
213 :     0, 0, 0, 0, 0, 0, 0, 0,
214 :     0, 0, 0, 0, 0, 0, 0, 0,
215 :     0, 0, 0, 0, 0, 0, 0, 0,
216 :     0, 0, 0, 0, 0, 0, 0, 0,
217 :     0, 0, 0, 0, 0, 0, 0, 0,
218 :     0, 0, 0, 0, 0, 0, 0, 0,
219 :     0, 0, 0, 0, 0, 0, 0, 0,
220 :     0, 0, 0, 0, 0, 0, 0, 0,
221 :     0, 0, 0, 0, 0, 0, 0, 0,
222 :     0, 0, 0, 0, 0, 0, 0, 0,
223 :     0, 0, 0, 0, 0, 0, 0, 0,
224 :     0, 0, 0, 0, 0, 0, 0, 0,
225 :     0, 0, 0, 0, 0, 0, 0, 0,
226 :     0, 0, 0, 0, 0, 0, 0, 0,
227 :     0, 0, 0, 0, 0, 0, 0, 0,
228 :     0, 0, 0, 0, 0, 0, 0, 0,
229 :     0, 0, 0, 0, 0, 0, 0, 0,
230 :     0, 0, 0, 0, 0, 0, 0, 0,
231 :     0, 0, 0, 0, 0, 0, 0, 0,
232 :     0, 0, 0, 0, 0, 0, 0, 0,
233 :     0, 0, 0, 0, 0, 0, 0, 0,
234 :     0, 0, 0, 0, 0, 0, 0, 0,
235 :     0, 0, 0, 0, 0, 0, 0, 0,
236 :     0, 0, 0, 0, 0, 0, 0, 0,
237 :     0, 0, 0, 0, 0, 0, 0, 0,
238 :     0, 0, 0, 0, 0, 0, 0, 0,
239 :     0, 0, 0, 0, 0, 0, 0, 0,
240 :     0, 0, 0, 0, 0, 0, 0, 0,
241 : edgomez 1.7 0, 0, 0, 0, 0, 0, 0, 0
242 : edgomez 1.6 },
243 :    
244 : edgomez 1.7 /* inter, last = 1 */
245 :     {
246 : edgomez 1.6 0, 40, 1, 0, 0, 0, 0, 0,
247 :     0, 0, 0, 0, 0, 0, 0, 0,
248 :     0, 0, 0, 0, 0, 0, 0, 0,
249 :     0, 0, 0, 0, 0, 0, 0, 0,
250 :     0, 0, 0, 0, 0, 0, 0, 0,
251 :     0, 0, 0, 0, 0, 0, 0, 0,
252 :     0, 0, 0, 0, 0, 0, 0, 0,
253 :     0, 0, 0, 0, 0, 0, 0, 0,
254 :     0, 0, 0, 0, 0, 0, 0, 0,
255 :     0, 0, 0, 0, 0, 0, 0, 0,
256 :     0, 0, 0, 0, 0, 0, 0, 0,
257 :     0, 0, 0, 0, 0, 0, 0, 0,
258 :     0, 0, 0, 0, 0, 0, 0, 0,
259 :     0, 0, 0, 0, 0, 0, 0, 0,
260 :     0, 0, 0, 0, 0, 0, 0, 0,
261 :     0, 0, 0, 0, 0, 0, 0, 0,
262 :     0, 0, 0, 0, 0, 0, 0, 0,
263 :     0, 0, 0, 0, 0, 0, 0, 0,
264 :     0, 0, 0, 0, 0, 0, 0, 0,
265 :     0, 0, 0, 0, 0, 0, 0, 0,
266 :     0, 0, 0, 0, 0, 0, 0, 0,
267 :     0, 0, 0, 0, 0, 0, 0, 0,
268 :     0, 0, 0, 0, 0, 0, 0, 0,
269 :     0, 0, 0, 0, 0, 0, 0, 0,
270 :     0, 0, 0, 0, 0, 0, 0, 0,
271 :     0, 0, 0, 0, 0, 0, 0, 0,
272 :     0, 0, 0, 0, 0, 0, 0, 0,
273 :     0, 0, 0, 0, 0, 0, 0, 0,
274 :     0, 0, 0, 0, 0, 0, 0, 0,
275 :     0, 0, 0, 0, 0, 0, 0, 0,
276 :     0, 0, 0, 0, 0, 0, 0, 0,
277 : edgomez 1.7 0, 0, 0, 0, 0, 0, 0, 0
278 : edgomez 1.6 }
279 : Isibaar 1.1 };
280 :    
281 :    
282 :     /******************************************************************
283 : edgomez 1.2 * encoder tables *
284 :     ******************************************************************/
285 : Isibaar 1.1
286 :     /* DCT coefficients. Four tables, two for last = 0, two for last = 1.
287 :     the sign bit must be added afterwards. */
288 :    
289 :     /* first part of coeffs for last = 0. Indexed by [run][level-1] */
290 :    
291 : edgomez 1.10 static VLC const coeff_tab0[2][12] = {
292 : edgomez 1.7 /* run = 0 */
293 : edgomez 1.3 {
294 : edgomez 1.7 {0x02, 2}, {0x0f, 4}, {0x15, 6}, {0x17, 7},
295 :     {0x1f, 8}, {0x25, 9}, {0x24, 9}, {0x21, 10},
296 :     {0x20, 10}, {0x07, 11}, {0x06, 11}, {0x20, 11}
297 :     },
298 :    
299 :     /* run = 1 */
300 :     {
301 :     {0x06, 3}, {0x14, 6}, {0x1e, 8}, {0x0f, 10},
302 :     {0x21, 11}, {0x50, 12}, {0x00, 0}, {0x00, 0},
303 :     {0x00, 0}, {0x00, 0}, {0x00, 0}, {0x00, 0}
304 :     }
305 : Isibaar 1.1 };
306 :    
307 :     /* rest of coeffs for last = 0. indexing by [run-2][level-1] */
308 :    
309 : edgomez 1.10 static VLC const coeff_tab1[25][4] = {
310 : edgomez 1.7 /* First row is run=2, then each row is run 2 + index */
311 :     {{0x0e, 4}, {0x1d, 8}, {0x0e, 10}, {0x51, 12}},
312 :     {{0x0d, 5}, {0x23, 9}, {0x0d, 10}, {0x00, 0}},
313 :     {{0x0c, 5}, {0x22, 9}, {0x52, 12}, {0x00, 0}},
314 :     {{0x0b, 5}, {0x0c, 10}, {0x53, 12}, {0x00, 0}},
315 :     {{0x13, 6}, {0x0b, 10}, {0x54, 12}, {0x00, 0}},
316 :     {{0x12, 6}, {0x0a, 10}, {0x00, 0}, {0x00, 0}},
317 :     {{0x11, 6}, {0x09, 10}, {0x00, 0}, {0x00, 0}},
318 :     {{0x10, 6}, {0x08, 10}, {0x00, 0}, {0x00, 0}},
319 :     {{0x16, 7}, {0x55, 12}, {0x00, 0}, {0x00, 0}},
320 :     {{0x15, 7}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
321 :     {{0x14, 7}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
322 :     {{0x1c, 8}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
323 :     {{0x1b, 8}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
324 :     {{0x21, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
325 :     {{0x20, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
326 :     {{0x1f, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
327 :     {{0x1e, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
328 :     {{0x1d, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
329 :     {{0x1c, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
330 :     {{0x1b, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
331 :     {{0x1a, 9}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
332 :     {{0x22, 11}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
333 :     {{0x23, 11}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
334 :     {{0x56, 12}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
335 :     {{0x57, 12}, {0x00, 0}, {0x00, 0}, {0x00, 0}}
336 :    
337 : Isibaar 1.1 };
338 :    
339 :     /* first coeffs of last = 1. indexing by [run][level-1] */
340 :    
341 : edgomez 1.10 static VLC const coeff_tab2[2][3] = {
342 : edgomez 1.7 /* run = 0 */
343 :     {{0x07, 4}, {0x19, 9}, {0x05, 11}},
344 :     /* run = 1 */
345 :     {{0x0f, 6}, {0x04, 11}, {0x00, 0}}
346 : Isibaar 1.1 };
347 :    
348 :     /* rest of coeffs for last = 1. indexing by [run-2] */
349 :    
350 : edgomez 1.10 static VLC const coeff_tab3[40][1] = {
351 : edgomez 1.7 {{0x0e, 6}}, {{0x0d, 6}}, {{0x0c, 6}}, {{0x13, 7}},
352 :     {{0x12, 7}}, {{0x11, 7}}, {{0x10, 7}}, {{0x1a, 8}},
353 :     {{0x19, 8}}, {{0x18, 8}}, {{0x17, 8}}, {{0x16, 8}},
354 :     {{0x15, 8}}, {{0x14, 8}}, {{0x13, 8}}, {{0x18, 9}},
355 :     {{0x17, 9}}, {{0x16, 9}}, {{0x15, 9}}, {{0x14, 9}},
356 :     {{0x13, 9}}, {{0x12, 9}}, {{0x11, 9}}, {{0x07, 10}},
357 :     {{0x06, 10}}, {{0x05, 10}}, {{0x04, 10}}, {{0x24, 11}},
358 :     {{0x25, 11}}, {{0x26, 11}}, {{0x27, 11}}, {{0x58, 12}},
359 :     {{0x59, 12}}, {{0x5a, 12}}, {{0x5b, 12}}, {{0x5c, 12}},
360 :     {{0x5d, 12}}, {{0x5e, 12}}, {{0x5f, 12}}, {{0x00, 0}}
361 :     };
362 :    
363 :     /*
364 :     * New tables for Intra luminance coefficients. Same codewords,
365 :     * different meaning
366 :     */
367 : Isibaar 1.1
368 :     /* Coeffs for last = 0, run = 0. Indexed by [level-1] */
369 :    
370 : edgomez 1.10 static VLC const coeff_tab4[27] = {
371 : edgomez 1.7 /* run = 0 */
372 :     {0x02, 2}, {0x06, 3}, {0x0f, 4},
373 :     {0x0d, 5}, {0x0c, 5}, {0x15, 6},
374 : edgomez 1.9 {0x13, 6}, {0x12, 6}, {0x17, 7},
375 : edgomez 1.7 {0x1f, 8}, {0x1e, 8}, {0x1d, 8},
376 :     {0x25, 9}, {0x24, 9}, {0x23, 9},
377 : edgomez 1.9 {0x21, 9}, {0x21, 10}, {0x20, 10},
378 : edgomez 1.7 {0x0f, 10}, {0x0e, 10}, {0x07, 11},
379 :     {0x06, 11}, {0x20, 11}, {0x21, 11},
380 : edgomez 1.3 {0x50, 12}, {0x51, 12}, {0x52, 12}
381 : Isibaar 1.1 };
382 :    
383 :     /* Coeffs for last = 0, run = 1. Indexed by [level-1] */
384 :    
385 : edgomez 1.10 static VLC const coeff_tab5[10] = {
386 : edgomez 1.7 {0x0e, 4}, {0x14, 6}, {0x16, 7}, {0x1c, 8}, {0x20, 9},
387 :     {0x1f, 9}, {0x0d, 10}, {0x22, 11}, {0x53, 12}, {0x55, 12}
388 : Isibaar 1.1 };
389 :    
390 :     /* Coeffs for last = 0, run = 2 -> 9. Indexed by [run-2][level-1] */
391 :    
392 :     static VLC coeff_tab6[8][5] = {
393 : edgomez 1.7 /* run = 2 */
394 :     {{0x0b, 5}, {0x15, 7}, {0x1e, 9}, {0x0c, 10}, {0x56, 12}},
395 :    
396 :     /* run = 3 */
397 :     {{0x11, 6}, {0x1b, 8}, {0x1d, 9}, {0x0b, 10}, {0x00, 0}},
398 :    
399 :     /* run = 4 */
400 :     {{0x10, 6}, {0x22, 9}, {0x0a, 10}, {0x00, 0}, {0x00, 0}},
401 :    
402 :     /* run = 5 */
403 :     {{0x0d, 6}, {0x1c, 9}, {0x08, 10}, {0x00, 0}, {0x00, 0}},
404 :    
405 :     /* run = 6 */
406 :     {{0x12, 7}, {0x1b, 9}, {0x54, 12}, {0x00, 0}, {0x00, 0}},
407 :    
408 :     /* run = 7 */
409 :     {{0x14, 7}, {0x1a, 9}, {0x57, 12}, {0x00, 0}, {0x00, 0}},
410 :    
411 :     /* run = 8 */
412 :     {{0x19, 8}, {0x09, 10}, {0x00, 0}, {0x00, 0}, {0x00, 0}},
413 :    
414 :     /* run = 9 */
415 :     {{0x18, 8}, {0x23, 11}, {0x00, 0}, {0x00, 0}, {0x00, 0}}
416 : Isibaar 1.1 };
417 :    
418 :     /* Coeffs for last = 0, run = 10 -> 14. Indexed by [run-10] */
419 :    
420 : edgomez 1.10 static VLC const coeff_tab7[5][1] = {
421 : edgomez 1.7 {{0x17, 8}},
422 :     {{0x19, 9}},
423 :     {{0x18, 9}},
424 :     {{0x07, 10}},
425 : edgomez 1.3 {{0x58, 12}}
426 : Isibaar 1.1 };
427 :    
428 :     /* Coeffs for last = 1, run = 0. Indexed by [level-1] */
429 :    
430 : edgomez 1.10 static VLC const coeff_tab8[8] = {
431 : edgomez 1.7 {0x07, 4}, {0x0c, 6}, {0x16, 8}, {0x17, 9},
432 : edgomez 1.3 {0x06, 10}, {0x05, 11}, {0x04, 11}, {0x59, 12}
433 : Isibaar 1.1 };
434 :    
435 :     /* Coeffs for last = 1, run = 1 -> 6. Indexed by [run-1][level-1] */
436 :    
437 : edgomez 1.10 static VLC const coeff_tab9[6][3] = {
438 : edgomez 1.7 /* run = 1 */
439 :     {{0x0f, 6}, {0x16, 9}, {0x05, 10}},
440 :    
441 :     /* run = 2 */
442 :     {{0x0e, 6}, {0x04, 10}, {0x00, 0}},
443 :    
444 :     /* run = 3 */
445 :     {{0x11, 7}, {0x24, 11}, {0x00, 0}},
446 :    
447 :     /* run = 4 */
448 :     {{0x10, 7}, {0x25, 11}, {0x00, 0}},
449 :    
450 :     /* run = 5 */
451 :     {{0x13, 7}, {0x5a, 12}, {0x00, 0}},
452 :    
453 :     /* run = 6 */
454 :     {{0x15, 8}, {0x5b, 12}, {0x00, 0}}
455 : Isibaar 1.1 };
456 :    
457 :     /* Coeffs for last = 1, run = 7 -> 20. Indexed by [run-7] */
458 :    
459 : edgomez 1.10 static VLC const coeff_tab10[14][1] = {
460 : edgomez 1.7 {{0x14, 8}},
461 :     {{0x13, 8}},
462 :     {{0x1a, 8}},
463 :     {{0x15, 9}},
464 :     {{0x14, 9}},
465 :     {{0x13, 9}},
466 :     {{0x12, 9}},
467 :     {{0x11, 9}},
468 :     {{0x26, 11}},
469 :     {{0x27, 11}},
470 :     {{0x5c, 12}},
471 :     {{0x5d, 12}},
472 :     {{0x5e, 12}},
473 :     {{0x5f, 12}}
474 : Isibaar 1.1 };
475 :    
476 :    
477 : edgomez 1.10 static VLC const *coeff_intra_last0[15] = {
478 : edgomez 1.3 coeff_tab4,
479 :     coeff_tab5,
480 :     coeff_tab6[0],
481 :     coeff_tab6[1],
482 :     coeff_tab6[2],
483 :     coeff_tab6[3],
484 :     coeff_tab6[4],
485 :     coeff_tab6[5],
486 :     coeff_tab6[6],
487 :     coeff_tab6[7],
488 :     coeff_tab7[0],
489 :     coeff_tab7[1],
490 :     coeff_tab7[2],
491 :     coeff_tab7[3],
492 :     coeff_tab7[4]
493 : Isibaar 1.1 };
494 :    
495 : edgomez 1.10 static VLC const *coeff_intra_last1[21] = {
496 : Isibaar 1.1 coeff_tab8,
497 :     coeff_tab9[0],
498 :     coeff_tab9[1],
499 :     coeff_tab9[2],
500 :     coeff_tab9[3],
501 :     coeff_tab9[4],
502 :     coeff_tab9[5],
503 :     coeff_tab10[0],
504 :     coeff_tab10[1],
505 :     coeff_tab10[2],
506 :     coeff_tab10[3],
507 :     coeff_tab10[4],
508 :     coeff_tab10[5],
509 :     coeff_tab10[6],
510 :     coeff_tab10[7],
511 :     coeff_tab10[8],
512 :     coeff_tab10[9],
513 :     coeff_tab10[10],
514 :     coeff_tab10[11],
515 :     coeff_tab10[12],
516 :     coeff_tab10[13],
517 :     };
518 :    
519 : edgomez 1.10 static VLC const *coeff_inter_last0[27] = {
520 : Isibaar 1.1 coeff_tab0[0],
521 :     coeff_tab0[1],
522 :     coeff_tab1[0],
523 :     coeff_tab1[1],
524 :     coeff_tab1[2],
525 :     coeff_tab1[3],
526 :     coeff_tab1[4],
527 :     coeff_tab1[5],
528 :     coeff_tab1[6],
529 :     coeff_tab1[7],
530 :     coeff_tab1[8],
531 :     coeff_tab1[9],
532 :     coeff_tab1[10],
533 :     coeff_tab1[11],
534 :     coeff_tab1[12],
535 :     coeff_tab1[13],
536 :     coeff_tab1[14],
537 :     coeff_tab1[15],
538 :     coeff_tab1[16],
539 :     coeff_tab1[17],
540 :     coeff_tab1[18],
541 :     coeff_tab1[19],
542 :     coeff_tab1[20],
543 :     coeff_tab1[21],
544 :     coeff_tab1[22],
545 :     coeff_tab1[23],
546 :     coeff_tab1[24],
547 :     };
548 :    
549 : edgomez 1.10 static VLC const *coeff_inter_last1[42] = {
550 : Isibaar 1.1 coeff_tab2[0],
551 :     coeff_tab2[1],
552 :     coeff_tab3[0],
553 :     coeff_tab3[1],
554 :     coeff_tab3[2],
555 :     coeff_tab3[3],
556 :     coeff_tab3[4],
557 :     coeff_tab3[5],
558 :     coeff_tab3[6],
559 :     coeff_tab3[7],
560 :     coeff_tab3[8],
561 :     coeff_tab3[9],
562 :     coeff_tab3[10],
563 :     coeff_tab3[11],
564 :     coeff_tab3[12],
565 :     coeff_tab3[13],
566 :     coeff_tab3[14],
567 :     coeff_tab3[15],
568 :     coeff_tab3[16],
569 :     coeff_tab3[17],
570 :     coeff_tab3[18],
571 :     coeff_tab3[19],
572 :     coeff_tab3[20],
573 :     coeff_tab3[21],
574 :     coeff_tab3[22],
575 :     coeff_tab3[23],
576 :     coeff_tab3[24],
577 :     coeff_tab3[25],
578 :     coeff_tab3[26],
579 :     coeff_tab3[27],
580 :     coeff_tab3[28],
581 :     coeff_tab3[29],
582 :     coeff_tab3[30],
583 :     coeff_tab3[31],
584 :     coeff_tab3[32],
585 :     coeff_tab3[33],
586 :     coeff_tab3[34],
587 :     coeff_tab3[35],
588 :     coeff_tab3[36],
589 :     coeff_tab3[37],
590 :     coeff_tab3[38],
591 :     coeff_tab3[39],
592 :     };
593 :    
594 : edgomez 1.10 static VLC const **coeff_vlc[4] = {
595 : Isibaar 1.1 coeff_intra_last0,
596 :     coeff_intra_last1,
597 :     coeff_inter_last0,
598 :     coeff_inter_last1,
599 :     };
600 :    
601 : edgomez 1.7 /*
602 :     * MCBPC Indexing by cbpc in first two bits, mode in last two.
603 :     * CBPC as in table 4/H.263, MB type (mode): 3 = 01, 4 = 10.
604 :     * Example: cbpc = 01 and mode = 4 gives index = 0110 = 6.
605 :     */
606 : Isibaar 1.1
607 : edgomez 1.10 static VLC const mcbpc_intra_tab[15] = {
608 : edgomez 1.6 {0x01, 9}, {0x01, 1}, {0x01, 4}, {0x00, 0},
609 :     {0x00, 0}, {0x01, 3}, {0x01, 6}, {0x00, 0},
610 :     {0x00, 0}, {0x02, 3}, {0x02, 6}, {0x00, 0},
611 :     {0x00, 0}, {0x03, 3}, {0x03, 6}
612 : Isibaar 1.1 };
613 :    
614 : Isibaar 1.4 /* MCBPC inter.
615 :     Addressing: 5 bit ccmmm (cc = CBPC, mmm = mode (1-4 binary)) */
616 : Isibaar 1.1
617 : edgomez 1.10 static VLC const mcbpc_inter_tab[29] = {
618 : edgomez 1.6 {1, 1}, {3, 3}, {2, 3}, {3, 5}, {4, 6}, {1, 9}, {0, 0}, {0, 0},
619 :     {3, 4}, {7, 7}, {5, 7}, {4, 8}, {4, 9}, {0, 0}, {0, 0}, {0, 0},
620 :     {2, 4}, {6, 7}, {4, 7}, {3, 8}, {3, 9}, {0, 0}, {0, 0}, {0, 0},
621 :     {5, 6}, {5, 9}, {5, 8}, {3, 7}, {2, 9}
622 : Isibaar 1.1 };
623 :    
624 : edgomez 1.10 static VLC const cbpy_tab[16] = {
625 : edgomez 1.6 {3, 4}, {5, 5}, {4, 5}, {9, 4}, {3, 5}, {7, 4}, {2, 6}, {11, 4},
626 :     {2, 5}, {3, 6}, {5, 4}, {10, 4}, {4, 4}, {8, 4}, {6, 4}, {3, 2}
627 : Isibaar 1.1 };
628 :    
629 : edgomez 1.10 static VLC const dcy_tab[511] = {
630 : edgomez 1.3 {0x100, 15}, {0x101, 15}, {0x102, 15}, {0x103, 15},
631 :     {0x104, 15}, {0x105, 15}, {0x106, 15}, {0x107, 15},
632 :     {0x108, 15}, {0x109, 15}, {0x10a, 15}, {0x10b, 15},
633 :     {0x10c, 15}, {0x10d, 15}, {0x10e, 15}, {0x10f, 15},
634 :     {0x110, 15}, {0x111, 15}, {0x112, 15}, {0x113, 15},
635 :     {0x114, 15}, {0x115, 15}, {0x116, 15}, {0x117, 15},
636 :     {0x118, 15}, {0x119, 15}, {0x11a, 15}, {0x11b, 15},
637 :     {0x11c, 15}, {0x11d, 15}, {0x11e, 15}, {0x11f, 15},
638 :     {0x120, 15}, {0x121, 15}, {0x122, 15}, {0x123, 15},
639 :     {0x124, 15}, {0x125, 15}, {0x126, 15}, {0x127, 15},
640 :     {0x128, 15}, {0x129, 15}, {0x12a, 15}, {0x12b, 15},
641 :     {0x12c, 15}, {0x12d, 15}, {0x12e, 15}, {0x12f, 15},
642 :     {0x130, 15}, {0x131, 15}, {0x132, 15}, {0x133, 15},
643 :     {0x134, 15}, {0x135, 15}, {0x136, 15}, {0x137, 15},
644 :     {0x138, 15}, {0x139, 15}, {0x13a, 15}, {0x13b, 15},
645 :     {0x13c, 15}, {0x13d, 15}, {0x13e, 15}, {0x13f, 15},
646 :     {0x140, 15}, {0x141, 15}, {0x142, 15}, {0x143, 15},
647 :     {0x144, 15}, {0x145, 15}, {0x146, 15}, {0x147, 15},
648 :     {0x148, 15}, {0x149, 15}, {0x14a, 15}, {0x14b, 15},
649 :     {0x14c, 15}, {0x14d, 15}, {0x14e, 15}, {0x14f, 15},
650 :     {0x150, 15}, {0x151, 15}, {0x152, 15}, {0x153, 15},
651 :     {0x154, 15}, {0x155, 15}, {0x156, 15}, {0x157, 15},
652 :     {0x158, 15}, {0x159, 15}, {0x15a, 15}, {0x15b, 15},
653 :     {0x15c, 15}, {0x15d, 15}, {0x15e, 15}, {0x15f, 15},
654 :     {0x160, 15}, {0x161, 15}, {0x162, 15}, {0x163, 15},
655 :     {0x164, 15}, {0x165, 15}, {0x166, 15}, {0x167, 15},
656 :     {0x168, 15}, {0x169, 15}, {0x16a, 15}, {0x16b, 15},
657 :     {0x16c, 15}, {0x16d, 15}, {0x16e, 15}, {0x16f, 15},
658 :     {0x170, 15}, {0x171, 15}, {0x172, 15}, {0x173, 15},
659 :     {0x174, 15}, {0x175, 15}, {0x176, 15}, {0x177, 15},
660 :     {0x178, 15}, {0x179, 15}, {0x17a, 15}, {0x17b, 15},
661 :     {0x17c, 15}, {0x17d, 15}, {0x17e, 15}, {0x17f, 15},
662 :     {0x80, 13}, {0x81, 13}, {0x82, 13}, {0x83, 13},
663 :     {0x84, 13}, {0x85, 13}, {0x86, 13}, {0x87, 13},
664 :     {0x88, 13}, {0x89, 13}, {0x8a, 13}, {0x8b, 13},
665 :     {0x8c, 13}, {0x8d, 13}, {0x8e, 13}, {0x8f, 13},
666 :     {0x90, 13}, {0x91, 13}, {0x92, 13}, {0x93, 13},
667 :     {0x94, 13}, {0x95, 13}, {0x96, 13}, {0x97, 13},
668 :     {0x98, 13}, {0x99, 13}, {0x9a, 13}, {0x9b, 13},
669 :     {0x9c, 13}, {0x9d, 13}, {0x9e, 13}, {0x9f, 13},
670 :     {0xa0, 13}, {0xa1, 13}, {0xa2, 13}, {0xa3, 13},
671 :     {0xa4, 13}, {0xa5, 13}, {0xa6, 13}, {0xa7, 13},
672 :     {0xa8, 13}, {0xa9, 13}, {0xaa, 13}, {0xab, 13},
673 :     {0xac, 13}, {0xad, 13}, {0xae, 13}, {0xaf, 13},
674 :     {0xb0, 13}, {0xb1, 13}, {0xb2, 13}, {0xb3, 13},
675 :     {0xb4, 13}, {0xb5, 13}, {0xb6, 13}, {0xb7, 13},
676 :     {0xb8, 13}, {0xb9, 13}, {0xba, 13}, {0xbb, 13},
677 :     {0xbc, 13}, {0xbd, 13}, {0xbe, 13}, {0xbf, 13},
678 :     {0x40, 11}, {0x41, 11}, {0x42, 11}, {0x43, 11},
679 :     {0x44, 11}, {0x45, 11}, {0x46, 11}, {0x47, 11},
680 :     {0x48, 11}, {0x49, 11}, {0x4a, 11}, {0x4b, 11},
681 :     {0x4c, 11}, {0x4d, 11}, {0x4e, 11}, {0x4f, 11},
682 :     {0x50, 11}, {0x51, 11}, {0x52, 11}, {0x53, 11},
683 :     {0x54, 11}, {0x55, 11}, {0x56, 11}, {0x57, 11},
684 :     {0x58, 11}, {0x59, 11}, {0x5a, 11}, {0x5b, 11},
685 :     {0x5c, 11}, {0x5d, 11}, {0x5e, 11}, {0x5f, 11},
686 :     {0x20, 9}, {0x21, 9}, {0x22, 9}, {0x23, 9},
687 :     {0x24, 9}, {0x25, 9}, {0x26, 9}, {0x27, 9},
688 :     {0x28, 9}, {0x29, 9}, {0x2a, 9}, {0x2b, 9},
689 :     {0x2c, 9}, {0x2d, 9}, {0x2e, 9}, {0x2f, 9},
690 :     {0x10, 7}, {0x11, 7}, {0x12, 7}, {0x13, 7},
691 :     {0x14, 7}, {0x15, 7}, {0x16, 7}, {0x17, 7},
692 :     {0x10, 6}, {0x11, 6}, {0x12, 6}, {0x13, 6},
693 :     {0x08, 4}, {0x09, 4}, {0x06, 3}, {0x03, 3},
694 :     {0x07, 3}, {0x0a, 4}, {0x0b, 4}, {0x14, 6},
695 :     {0x15, 6}, {0x16, 6}, {0x17, 6}, {0x18, 7},
696 :     {0x19, 7}, {0x1a, 7}, {0x1b, 7}, {0x1c, 7},
697 :     {0x1d, 7}, {0x1e, 7}, {0x1f, 7}, {0x30, 9},
698 :     {0x31, 9}, {0x32, 9}, {0x33, 9}, {0x34, 9},
699 :     {0x35, 9}, {0x36, 9}, {0x37, 9}, {0x38, 9},
700 :     {0x39, 9}, {0x3a, 9}, {0x3b, 9}, {0x3c, 9},
701 :     {0x3d, 9}, {0x3e, 9}, {0x3f, 9}, {0x60, 11},
702 :     {0x61, 11}, {0x62, 11}, {0x63, 11}, {0x64, 11},
703 :     {0x65, 11}, {0x66, 11}, {0x67, 11}, {0x68, 11},
704 :     {0x69, 11}, {0x6a, 11}, {0x6b, 11}, {0x6c, 11},
705 :     {0x6d, 11}, {0x6e, 11}, {0x6f, 11}, {0x70, 11},
706 :     {0x71, 11}, {0x72, 11}, {0x73, 11}, {0x74, 11},
707 :     {0x75, 11}, {0x76, 11}, {0x77, 11}, {0x78, 11},
708 :     {0x79, 11}, {0x7a, 11}, {0x7b, 11}, {0x7c, 11},
709 :     {0x7d, 11}, {0x7e, 11}, {0x7f, 11}, {0xc0, 13},
710 :     {0xc1, 13}, {0xc2, 13}, {0xc3, 13}, {0xc4, 13},
711 :     {0xc5, 13}, {0xc6, 13}, {0xc7, 13}, {0xc8, 13},
712 :     {0xc9, 13}, {0xca, 13}, {0xcb, 13}, {0xcc, 13},
713 :     {0xcd, 13}, {0xce, 13}, {0xcf, 13}, {0xd0, 13},
714 :     {0xd1, 13}, {0xd2, 13}, {0xd3, 13}, {0xd4, 13},
715 :     {0xd5, 13}, {0xd6, 13}, {0xd7, 13}, {0xd8, 13},
716 :     {0xd9, 13}, {0xda, 13}, {0xdb, 13}, {0xdc, 13},
717 :     {0xdd, 13}, {0xde, 13}, {0xdf, 13}, {0xe0, 13},
718 :     {0xe1, 13}, {0xe2, 13}, {0xe3, 13}, {0xe4, 13},
719 :     {0xe5, 13}, {0xe6, 13}, {0xe7, 13}, {0xe8, 13},
720 :     {0xe9, 13}, {0xea, 13}, {0xeb, 13}, {0xec, 13},
721 :     {0xed, 13}, {0xee, 13}, {0xef, 13}, {0xf0, 13},
722 :     {0xf1, 13}, {0xf2, 13}, {0xf3, 13}, {0xf4, 13},
723 :     {0xf5, 13}, {0xf6, 13}, {0xf7, 13}, {0xf8, 13},
724 :     {0xf9, 13}, {0xfa, 13}, {0xfb, 13}, {0xfc, 13},
725 :     {0xfd, 13}, {0xfe, 13}, {0xff, 13}, {0x180, 15},
726 :     {0x181, 15}, {0x182, 15}, {0x183, 15}, {0x184, 15},
727 :     {0x185, 15}, {0x186, 15}, {0x187, 15}, {0x188, 15},
728 :     {0x189, 15}, {0x18a, 15}, {0x18b, 15}, {0x18c, 15},
729 :     {0x18d, 15}, {0x18e, 15}, {0x18f, 15}, {0x190, 15},
730 :     {0x191, 15}, {0x192, 15}, {0x193, 15}, {0x194, 15},
731 :     {0x195, 15}, {0x196, 15}, {0x197, 15}, {0x198, 15},
732 :     {0x199, 15}, {0x19a, 15}, {0x19b, 15}, {0x19c, 15},
733 :     {0x19d, 15}, {0x19e, 15}, {0x19f, 15}, {0x1a0, 15},
734 :     {0x1a1, 15}, {0x1a2, 15}, {0x1a3, 15}, {0x1a4, 15},
735 :     {0x1a5, 15}, {0x1a6, 15}, {0x1a7, 15}, {0x1a8, 15},
736 :     {0x1a9, 15}, {0x1aa, 15}, {0x1ab, 15}, {0x1ac, 15},
737 :     {0x1ad, 15}, {0x1ae, 15}, {0x1af, 15}, {0x1b0, 15},
738 :     {0x1b1, 15}, {0x1b2, 15}, {0x1b3, 15}, {0x1b4, 15},
739 :     {0x1b5, 15}, {0x1b6, 15}, {0x1b7, 15}, {0x1b8, 15},
740 :     {0x1b9, 15}, {0x1ba, 15}, {0x1bb, 15}, {0x1bc, 15},
741 :     {0x1bd, 15}, {0x1be, 15}, {0x1bf, 15}, {0x1c0, 15},
742 :     {0x1c1, 15}, {0x1c2, 15}, {0x1c3, 15}, {0x1c4, 15},
743 :     {0x1c5, 15}, {0x1c6, 15}, {0x1c7, 15}, {0x1c8, 15},
744 :     {0x1c9, 15}, {0x1ca, 15}, {0x1cb, 15}, {0x1cc, 15},
745 :     {0x1cd, 15}, {0x1ce, 15}, {0x1cf, 15}, {0x1d0, 15},
746 :     {0x1d1, 15}, {0x1d2, 15}, {0x1d3, 15}, {0x1d4, 15},
747 :     {0x1d5, 15}, {0x1d6, 15}, {0x1d7, 15}, {0x1d8, 15},
748 :     {0x1d9, 15}, {0x1da, 15}, {0x1db, 15}, {0x1dc, 15},
749 :     {0x1dd, 15}, {0x1de, 15}, {0x1df, 15}, {0x1e0, 15},
750 :     {0x1e1, 15}, {0x1e2, 15}, {0x1e3, 15}, {0x1e4, 15},
751 :     {0x1e5, 15}, {0x1e6, 15}, {0x1e7, 15}, {0x1e8, 15},
752 :     {0x1e9, 15}, {0x1ea, 15}, {0x1eb, 15}, {0x1ec, 15},
753 :     {0x1ed, 15}, {0x1ee, 15}, {0x1ef, 15}, {0x1f0, 15},
754 :     {0x1f1, 15}, {0x1f2, 15}, {0x1f3, 15}, {0x1f4, 15},
755 :     {0x1f5, 15}, {0x1f6, 15}, {0x1f7, 15}, {0x1f8, 15},
756 :     {0x1f9, 15}, {0x1fa, 15}, {0x1fb, 15}, {0x1fc, 15},
757 :     {0x1fd, 15}, {0x1fe, 15}, {0x1ff, 15},
758 : Isibaar 1.1 };
759 :    
760 : edgomez 1.10 static VLC const dcc_tab[511] = {
761 : edgomez 1.3 {0x100, 16}, {0x101, 16}, {0x102, 16}, {0x103, 16},
762 :     {0x104, 16}, {0x105, 16}, {0x106, 16}, {0x107, 16},
763 :     {0x108, 16}, {0x109, 16}, {0x10a, 16}, {0x10b, 16},
764 :     {0x10c, 16}, {0x10d, 16}, {0x10e, 16}, {0x10f, 16},
765 :     {0x110, 16}, {0x111, 16}, {0x112, 16}, {0x113, 16},
766 :     {0x114, 16}, {0x115, 16}, {0x116, 16}, {0x117, 16},
767 :     {0x118, 16}, {0x119, 16}, {0x11a, 16}, {0x11b, 16},
768 :     {0x11c, 16}, {0x11d, 16}, {0x11e, 16}, {0x11f, 16},
769 :     {0x120, 16}, {0x121, 16}, {0x122, 16}, {0x123, 16},
770 :     {0x124, 16}, {0x125, 16}, {0x126, 16}, {0x127, 16},
771 :     {0x128, 16}, {0x129, 16}, {0x12a, 16}, {0x12b, 16},
772 :     {0x12c, 16}, {0x12d, 16}, {0x12e, 16}, {0x12f, 16},
773 :     {0x130, 16}, {0x131, 16}, {0x132, 16}, {0x133, 16},
774 :     {0x134, 16}, {0x135, 16}, {0x136, 16}, {0x137, 16},
775 :     {0x138, 16}, {0x139, 16}, {0x13a, 16}, {0x13b, 16},
776 :     {0x13c, 16}, {0x13d, 16}, {0x13e, 16}, {0x13f, 16},
777 :     {0x140, 16}, {0x141, 16}, {0x142, 16}, {0x143, 16},
778 :     {0x144, 16}, {0x145, 16}, {0x146, 16}, {0x147, 16},
779 :     {0x148, 16}, {0x149, 16}, {0x14a, 16}, {0x14b, 16},
780 :     {0x14c, 16}, {0x14d, 16}, {0x14e, 16}, {0x14f, 16},
781 :     {0x150, 16}, {0x151, 16}, {0x152, 16}, {0x153, 16},
782 :     {0x154, 16}, {0x155, 16}, {0x156, 16}, {0x157, 16},
783 :     {0x158, 16}, {0x159, 16}, {0x15a, 16}, {0x15b, 16},
784 :     {0x15c, 16}, {0x15d, 16}, {0x15e, 16}, {0x15f, 16},
785 :     {0x160, 16}, {0x161, 16}, {0x162, 16}, {0x163, 16},
786 :     {0x164, 16}, {0x165, 16}, {0x166, 16}, {0x167, 16},
787 :     {0x168, 16}, {0x169, 16}, {0x16a, 16}, {0x16b, 16},
788 :     {0x16c, 16}, {0x16d, 16}, {0x16e, 16}, {0x16f, 16},
789 :     {0x170, 16}, {0x171, 16}, {0x172, 16}, {0x173, 16},
790 :     {0x174, 16}, {0x175, 16}, {0x176, 16}, {0x177, 16},
791 :     {0x178, 16}, {0x179, 16}, {0x17a, 16}, {0x17b, 16},
792 :     {0x17c, 16}, {0x17d, 16}, {0x17e, 16}, {0x17f, 16},
793 :     {0x80, 14}, {0x81, 14}, {0x82, 14}, {0x83, 14},
794 :     {0x84, 14}, {0x85, 14}, {0x86, 14}, {0x87, 14},
795 :     {0x88, 14}, {0x89, 14}, {0x8a, 14}, {0x8b, 14},
796 :     {0x8c, 14}, {0x8d, 14}, {0x8e, 14}, {0x8f, 14},
797 :     {0x90, 14}, {0x91, 14}, {0x92, 14}, {0x93, 14},
798 :     {0x94, 14}, {0x95, 14}, {0x96, 14}, {0x97, 14},
799 :     {0x98, 14}, {0x99, 14}, {0x9a, 14}, {0x9b, 14},
800 :     {0x9c, 14}, {0x9d, 14}, {0x9e, 14}, {0x9f, 14},
801 :     {0xa0, 14}, {0xa1, 14}, {0xa2, 14}, {0xa3, 14},
802 :     {0xa4, 14}, {0xa5, 14}, {0xa6, 14}, {0xa7, 14},
803 :     {0xa8, 14}, {0xa9, 14}, {0xaa, 14}, {0xab, 14},
804 :     {0xac, 14}, {0xad, 14}, {0xae, 14}, {0xaf, 14},
805 :     {0xb0, 14}, {0xb1, 14}, {0xb2, 14}, {0xb3, 14},
806 :     {0xb4, 14}, {0xb5, 14}, {0xb6, 14}, {0xb7, 14},
807 :     {0xb8, 14}, {0xb9, 14}, {0xba, 14}, {0xbb, 14},
808 :     {0xbc, 14}, {0xbd, 14}, {0xbe, 14}, {0xbf, 14},
809 :     {0x40, 12}, {0x41, 12}, {0x42, 12}, {0x43, 12},
810 :     {0x44, 12}, {0x45, 12}, {0x46, 12}, {0x47, 12},
811 :     {0x48, 12}, {0x49, 12}, {0x4a, 12}, {0x4b, 12},
812 :     {0x4c, 12}, {0x4d, 12}, {0x4e, 12}, {0x4f, 12},
813 :     {0x50, 12}, {0x51, 12}, {0x52, 12}, {0x53, 12},
814 :     {0x54, 12}, {0x55, 12}, {0x56, 12}, {0x57, 12},
815 :     {0x58, 12}, {0x59, 12}, {0x5a, 12}, {0x5b, 12},
816 :     {0x5c, 12}, {0x5d, 12}, {0x5e, 12}, {0x5f, 12},
817 :     {0x20, 10}, {0x21, 10}, {0x22, 10}, {0x23, 10},
818 :     {0x24, 10}, {0x25, 10}, {0x26, 10}, {0x27, 10},
819 :     {0x28, 10}, {0x29, 10}, {0x2a, 10}, {0x2b, 10},
820 :     {0x2c, 10}, {0x2d, 10}, {0x2e, 10}, {0x2f, 10},
821 :     {0x10, 8}, {0x11, 8}, {0x12, 8}, {0x13, 8},
822 :     {0x14, 8}, {0x15, 8}, {0x16, 8}, {0x17, 8},
823 :     {0x08, 6}, {0x09, 6}, {0x0a, 6}, {0x0b, 6},
824 :     {0x04, 4}, {0x05, 4}, {0x04, 3}, {0x03, 2},
825 :     {0x05, 3}, {0x06, 4}, {0x07, 4}, {0x0c, 6},
826 :     {0x0d, 6}, {0x0e, 6}, {0x0f, 6}, {0x18, 8},
827 :     {0x19, 8}, {0x1a, 8}, {0x1b, 8}, {0x1c, 8},
828 :     {0x1d, 8}, {0x1e, 8}, {0x1f, 8}, {0x30, 10},
829 :     {0x31, 10}, {0x32, 10}, {0x33, 10}, {0x34, 10},
830 :     {0x35, 10}, {0x36, 10}, {0x37, 10}, {0x38, 10},
831 :     {0x39, 10}, {0x3a, 10}, {0x3b, 10}, {0x3c, 10},
832 :     {0x3d, 10}, {0x3e, 10}, {0x3f, 10}, {0x60, 12},
833 :     {0x61, 12}, {0x62, 12}, {0x63, 12}, {0x64, 12},
834 :     {0x65, 12}, {0x66, 12}, {0x67, 12}, {0x68, 12},
835 :     {0x69, 12}, {0x6a, 12}, {0x6b, 12}, {0x6c, 12},
836 :     {0x6d, 12}, {0x6e, 12}, {0x6f, 12}, {0x70, 12},
837 :     {0x71, 12}, {0x72, 12}, {0x73, 12}, {0x74, 12},
838 :     {0x75, 12}, {0x76, 12}, {0x77, 12}, {0x78, 12},
839 :     {0x79, 12}, {0x7a, 12}, {0x7b, 12}, {0x7c, 12},
840 :     {0x7d, 12}, {0x7e, 12}, {0x7f, 12}, {0xc0, 14},
841 :     {0xc1, 14}, {0xc2, 14}, {0xc3, 14}, {0xc4, 14},
842 :     {0xc5, 14}, {0xc6, 14}, {0xc7, 14}, {0xc8, 14},
843 :     {0xc9, 14}, {0xca, 14}, {0xcb, 14}, {0xcc, 14},
844 :     {0xcd, 14}, {0xce, 14}, {0xcf, 14}, {0xd0, 14},
845 :     {0xd1, 14}, {0xd2, 14}, {0xd3, 14}, {0xd4, 14},
846 :     {0xd5, 14}, {0xd6, 14}, {0xd7, 14}, {0xd8, 14},
847 :     {0xd9, 14}, {0xda, 14}, {0xdb, 14}, {0xdc, 14},
848 :     {0xdd, 14}, {0xde, 14}, {0xdf, 14}, {0xe0, 14},
849 :     {0xe1, 14}, {0xe2, 14}, {0xe3, 14}, {0xe4, 14},
850 :     {0xe5, 14}, {0xe6, 14}, {0xe7, 14}, {0xe8, 14},
851 :     {0xe9, 14}, {0xea, 14}, {0xeb, 14}, {0xec, 14},
852 :     {0xed, 14}, {0xee, 14}, {0xef, 14}, {0xf0, 14},
853 :     {0xf1, 14}, {0xf2, 14}, {0xf3, 14}, {0xf4, 14},
854 :     {0xf5, 14}, {0xf6, 14}, {0xf7, 14}, {0xf8, 14},
855 :     {0xf9, 14}, {0xfa, 14}, {0xfb, 14}, {0xfc, 14},
856 :     {0xfd, 14}, {0xfe, 14}, {0xff, 14}, {0x180, 16},
857 :     {0x181, 16}, {0x182, 16}, {0x183, 16}, {0x184, 16},
858 :     {0x185, 16}, {0x186, 16}, {0x187, 16}, {0x188, 16},
859 :     {0x189, 16}, {0x18a, 16}, {0x18b, 16}, {0x18c, 16},
860 :     {0x18d, 16}, {0x18e, 16}, {0x18f, 16}, {0x190, 16},
861 :     {0x191, 16}, {0x192, 16}, {0x193, 16}, {0x194, 16},
862 :     {0x195, 16}, {0x196, 16}, {0x197, 16}, {0x198, 16},
863 :     {0x199, 16}, {0x19a, 16}, {0x19b, 16}, {0x19c, 16},
864 :     {0x19d, 16}, {0x19e, 16}, {0x19f, 16}, {0x1a0, 16},
865 :     {0x1a1, 16}, {0x1a2, 16}, {0x1a3, 16}, {0x1a4, 16},
866 :     {0x1a5, 16}, {0x1a6, 16}, {0x1a7, 16}, {0x1a8, 16},
867 :     {0x1a9, 16}, {0x1aa, 16}, {0x1ab, 16}, {0x1ac, 16},
868 :     {0x1ad, 16}, {0x1ae, 16}, {0x1af, 16}, {0x1b0, 16},
869 :     {0x1b1, 16}, {0x1b2, 16}, {0x1b3, 16}, {0x1b4, 16},
870 :     {0x1b5, 16}, {0x1b6, 16}, {0x1b7, 16}, {0x1b8, 16},
871 :     {0x1b9, 16}, {0x1ba, 16}, {0x1bb, 16}, {0x1bc, 16},
872 :     {0x1bd, 16}, {0x1be, 16}, {0x1bf, 16}, {0x1c0, 16},
873 :     {0x1c1, 16}, {0x1c2, 16}, {0x1c3, 16}, {0x1c4, 16},
874 :     {0x1c5, 16}, {0x1c6, 16}, {0x1c7, 16}, {0x1c8, 16},
875 :     {0x1c9, 16}, {0x1ca, 16}, {0x1cb, 16}, {0x1cc, 16},
876 :     {0x1cd, 16}, {0x1ce, 16}, {0x1cf, 16}, {0x1d0, 16},
877 :     {0x1d1, 16}, {0x1d2, 16}, {0x1d3, 16}, {0x1d4, 16},
878 :     {0x1d5, 16}, {0x1d6, 16}, {0x1d7, 16}, {0x1d8, 16},
879 :     {0x1d9, 16}, {0x1da, 16}, {0x1db, 16}, {0x1dc, 16},
880 :     {0x1dd, 16}, {0x1de, 16}, {0x1df, 16}, {0x1e0, 16},
881 :     {0x1e1, 16}, {0x1e2, 16}, {0x1e3, 16}, {0x1e4, 16},
882 :     {0x1e5, 16}, {0x1e6, 16}, {0x1e7, 16}, {0x1e8, 16},
883 :     {0x1e9, 16}, {0x1ea, 16}, {0x1eb, 16}, {0x1ec, 16},
884 :     {0x1ed, 16}, {0x1ee, 16}, {0x1ef, 16}, {0x1f0, 16},
885 :     {0x1f1, 16}, {0x1f2, 16}, {0x1f3, 16}, {0x1f4, 16},
886 :     {0x1f5, 16}, {0x1f6, 16}, {0x1f7, 16}, {0x1f8, 16},
887 :     {0x1f9, 16}, {0x1fa, 16}, {0x1fb, 16}, {0x1fc, 16},
888 :     {0x1fd, 16}, {0x1fe, 16}, {0x1ff, 16},
889 : Isibaar 1.1 };
890 :    
891 :    
892 : edgomez 1.10 static VLC const mb_motion_table[65] = {
893 : edgomez 1.6 {0x05, 13}, {0x07, 13}, {0x05, 12}, {0x07, 12},
894 :     {0x09, 12}, {0x0b, 12}, {0x0d, 12}, {0x0f, 12},
895 :     {0x09, 11}, {0x0b, 11}, {0x0d, 11}, {0x0f, 11},
896 :     {0x11, 11}, {0x13, 11}, {0x15, 11}, {0x17, 11},
897 :     {0x19, 11}, {0x1b, 11}, {0x1d, 11}, {0x1f, 11},
898 :     {0x21, 11}, {0x23, 11}, {0x13, 10}, {0x15, 10},
899 :     {0x17, 10}, {0x07, 8}, {0x09, 8}, {0x0b, 8},
900 :     {0x07, 7}, {0x03, 5}, {0x03, 4}, {0x03, 3},
901 :     {0x01, 1}, {0x02, 3}, {0x02, 4}, {0x02, 5},
902 :     {0x06, 7}, {0x0a, 8}, {0x08, 8}, {0x06, 8},
903 :     {0x16, 10}, {0x14, 10}, {0x12, 10}, {0x22, 11},
904 :     {0x20, 11}, {0x1e, 11}, {0x1c, 11}, {0x1a, 11},
905 :     {0x18, 11}, {0x16, 11}, {0x14, 11}, {0x12, 11},
906 :     {0x10, 11}, {0x0e, 11}, {0x0c, 11}, {0x0a, 11},
907 :     {0x08, 11}, {0x0e, 12}, {0x0c, 12}, {0x0a, 12},
908 :     {0x08, 12}, {0x06, 12}, {0x04, 12}, {0x06, 13},
909 : edgomez 1.3 {0x04, 13}
910 : Isibaar 1.1 };
911 :    
912 :    
913 :     /******************************************************************
914 : edgomez 1.2 * decoder tables *
915 :     ******************************************************************/
916 : Isibaar 1.1
917 : edgomez 1.10 static VLC const mcbpc_intra_table[64] = {
918 : edgomez 1.7 {-1, 0}, {20, 6}, {36, 6}, {52, 6}, {4, 4}, {4, 4}, {4, 4}, {4, 4},
919 :     {19, 3}, {19, 3}, {19, 3}, {19, 3}, {19, 3}, {19, 3}, {19, 3}, {19, 3},
920 :     {35, 3}, {35, 3}, {35, 3}, {35, 3}, {35, 3}, {35, 3}, {35, 3}, {35, 3},
921 :     {51, 3}, {51, 3}, {51, 3}, {51, 3}, {51, 3}, {51, 3}, {51, 3}, {51, 3},
922 : edgomez 1.9 {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1},
923 :     {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1},
924 : edgomez 1.7 {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1},
925 :     {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1}, {3, 1}
926 : Isibaar 1.1 };
927 :    
928 :    
929 : edgomez 1.10 static VLC const mcbpc_inter_table[257] = {
930 :     {VLC_ERROR, 0}, {255, 9}, {52, 9}, {36, 9}, {20, 9}, {49, 9}, {35, 8}, {35, 8},
931 : edgomez 1.7 {19, 8}, {19, 8}, {50, 8}, {50, 8}, {51, 7}, {51, 7}, {51, 7}, {51, 7},
932 :     {34, 7}, {34, 7}, {34, 7}, {34, 7}, {18, 7}, {18, 7}, {18, 7}, {18, 7},
933 :     {33, 7}, {33, 7}, {33, 7}, {33, 7}, {17, 7}, {17, 7}, {17, 7}, {17, 7},
934 : edgomez 1.9 {4, 6}, {4, 6}, {4, 6}, {4, 6}, {4, 6}, {4, 6}, {4, 6}, {4, 6},
935 : edgomez 1.7 {48, 6}, {48, 6}, {48, 6}, {48, 6}, {48, 6}, {48, 6}, {48, 6}, {48, 6},
936 : edgomez 1.9 {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5},
937 : edgomez 1.7 {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5}, {3, 5},
938 :     {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4},
939 : edgomez 1.6 {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4},
940 :     {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4},
941 :     {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4}, {32, 4},
942 : edgomez 1.9 {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4},
943 :     {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4},
944 : edgomez 1.6 {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4},
945 :     {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4}, {16, 4},
946 : edgomez 1.7 {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
947 :     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
948 :     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
949 :     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
950 :     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
951 :     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
952 :     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
953 :     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3}, {2, 3},
954 :     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
955 :     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
956 :     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
957 :     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
958 :     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
959 :     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
960 :     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
961 :     {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
962 :     {0, 1}
963 : edgomez 1.6 };
964 :    
965 : edgomez 1.10 static VLC const cbpy_table[64] = {
966 : edgomez 1.7 {-1, 0}, {-1, 0}, {6, 6}, {9, 6}, {8, 5}, {8, 5}, {4, 5}, {4, 5},
967 :     {2, 5}, {2, 5}, {1, 5}, {1, 5}, {0, 4}, {0, 4}, {0, 4}, {0, 4},
968 : edgomez 1.6 {12, 4}, {12, 4}, {12, 4}, {12, 4}, {10, 4}, {10, 4}, {10, 4}, {10, 4},
969 : edgomez 1.7 {14, 4}, {14, 4}, {14, 4}, {14, 4}, {5, 4}, {5, 4}, {5, 4}, {5, 4},
970 :     {13, 4}, {13, 4}, {13, 4}, {13, 4}, {3, 4}, {3, 4}, {3, 4}, {3, 4},
971 :     {11, 4}, {11, 4}, {11, 4}, {11, 4}, {7, 4}, {7, 4}, {7, 4}, {7, 4},
972 :     {15, 2}, {15, 2}, {15, 2}, {15, 2}, {15, 2}, {15, 2}, {15, 2}, {15, 2},
973 :     {15, 2}, {15, 2}, {15, 2}, {15, 2}, {15, 2}, {15, 2}, {15, 2}, {15, 2}
974 : Isibaar 1.1 };
975 :    
976 :    
977 : edgomez 1.10 static VLC const TMNMVtab0[] = {
978 : edgomez 1.7 {3, 4}, {-3, 4}, {2, 3}, {2, 3}, {-2, 3}, {-2, 3}, {1, 2},
979 :     {1, 2}, {1, 2}, {1, 2}, {-1, 2}, {-1, 2}, {-1, 2}, {-1, 2}
980 : Isibaar 1.1 };
981 :    
982 : edgomez 1.10 static VLC const TMNMVtab1[] = {
983 : edgomez 1.7 {12, 10}, {-12, 10}, {11, 10}, {-11, 10},
984 :     {10, 9}, {10, 9}, {-10, 9}, {-10, 9},
985 :     {9, 9}, {9, 9}, {-9, 9}, {-9, 9},
986 :     {8, 9}, {8, 9}, {-8, 9}, {-8, 9},
987 : edgomez 1.9 {7, 7}, {7, 7}, {7, 7}, {7, 7},
988 : edgomez 1.7 {7, 7}, {7, 7}, {7, 7}, {7, 7},
989 :     {-7, 7}, {-7, 7}, {-7, 7}, {-7, 7},
990 :     {-7, 7}, {-7, 7}, {-7, 7}, {-7, 7},
991 :     {6, 7}, {6, 7}, {6, 7}, {6, 7},
992 : edgomez 1.9 {6, 7}, {6, 7}, {6, 7}, {6, 7},
993 : edgomez 1.7 {-6, 7}, {-6, 7}, {-6, 7}, {-6, 7},
994 :     {-6, 7}, {-6, 7}, {-6, 7}, {-6, 7},
995 :     {5, 7}, {5, 7}, {5, 7}, {5, 7},
996 :     {5, 7}, {5, 7}, {5, 7}, {5, 7},
997 :     {-5, 7}, {-5, 7}, {-5, 7}, {-5, 7},
998 :     {-5, 7}, {-5, 7}, {-5, 7}, {-5, 7},
999 :     {4, 6}, {4, 6}, {4, 6}, {4, 6},
1000 :     {4, 6}, {4, 6}, {4, 6}, {4, 6},
1001 :     {4, 6}, {4, 6}, {4, 6}, {4, 6},
1002 : edgomez 1.9 {4, 6}, {4, 6}, {4, 6}, {4, 6},
1003 : edgomez 1.7 {-4, 6}, {-4, 6}, {-4, 6}, {-4, 6},
1004 :     {-4, 6}, {-4, 6}, {-4, 6}, {-4, 6},
1005 :     {-4, 6}, {-4, 6}, {-4, 6}, {-4, 6},
1006 : edgomez 1.9 {-4, 6}, {-4, 6}, {-4, 6}, {-4, 6}
1007 : Isibaar 1.1 };
1008 :    
1009 : edgomez 1.10 static VLC const TMNMVtab2[] = {
1010 : edgomez 1.7 {32, 12}, {-32, 12}, {31, 12}, {-31, 12},
1011 :     {30, 11}, {30, 11}, {-30, 11}, {-30, 11},
1012 :     {29, 11}, {29, 11}, {-29, 11}, {-29, 11},
1013 :     {28, 11}, {28, 11}, {-28, 11}, {-28, 11},
1014 :     {27, 11}, {27, 11}, {-27, 11}, {-27, 11},
1015 :     {26, 11}, {26, 11}, {-26, 11}, {-26, 11},
1016 :     {25, 11}, {25, 11}, {-25, 11}, {-25, 11},
1017 :     {24, 10}, {24, 10}, {24, 10}, {24, 10},
1018 :     {-24, 10}, {-24, 10}, {-24, 10}, {-24, 10},
1019 :     {23, 10}, {23, 10}, {23, 10}, {23, 10},
1020 :     {-23, 10}, {-23, 10}, {-23, 10}, {-23, 10},
1021 :     {22, 10}, {22, 10}, {22, 10}, {22, 10},
1022 :     {-22, 10}, {-22, 10}, {-22, 10}, {-22, 10},
1023 :     {21, 10}, {21, 10}, {21, 10}, {21, 10},
1024 :     {-21, 10}, {-21, 10}, {-21, 10}, {-21, 10},
1025 :     {20, 10}, {20, 10}, {20, 10}, {20, 10},
1026 :     {-20, 10}, {-20, 10}, {-20, 10}, {-20, 10},
1027 :     {19, 10}, {19, 10}, {19, 10}, {19, 10},
1028 :     {-19, 10}, {-19, 10}, {-19, 10}, {-19, 10},
1029 :     {18, 10}, {18, 10}, {18, 10}, {18, 10},
1030 :     {-18, 10}, {-18, 10}, {-18, 10}, {-18, 10},
1031 :     {17, 10}, {17, 10}, {17, 10}, {17, 10},
1032 :     {-17, 10}, {-17, 10}, {-17, 10}, {-17, 10},
1033 :     {16, 10}, {16, 10}, {16, 10}, {16, 10},
1034 :     {-16, 10}, {-16, 10}, {-16, 10}, {-16, 10},
1035 :     {15, 10}, {15, 10}, {15, 10}, {15, 10},
1036 :     {-15, 10}, {-15, 10}, {-15, 10}, {-15, 10},
1037 :     {14, 10}, {14, 10}, {14, 10}, {14, 10},
1038 :     {-14, 10}, {-14, 10}, {-14, 10}, {-14, 10},
1039 :     {13, 10}, {13, 10}, {13, 10}, {13, 10},
1040 : edgomez 1.6 {-13, 10}, {-13, 10}, {-13, 10}, {-13, 10}
1041 : Isibaar 1.1 };
1042 :    
1043 :    
1044 : edgomez 1.10 static VLC const DCT3Dtab0[] = {
1045 : edgomez 1.6 {4225, 7}, {4209, 7}, {4193, 7}, {4177, 7}, {193, 7}, {177, 7},
1046 :     {161, 7}, {4, 7}, {4161, 6}, {4161, 6}, {4145, 6}, {4145, 6},
1047 :     {4129, 6}, {4129, 6}, {4113, 6}, {4113, 6}, {145, 6}, {145, 6},
1048 :     {129, 6}, {129, 6}, {113, 6}, {113, 6}, {97, 6}, {97, 6},
1049 :     {18, 6}, {18, 6}, {3, 6}, {3, 6}, {81, 5}, {81, 5},
1050 :     {81, 5}, {81, 5}, {65, 5}, {65, 5}, {65, 5}, {65, 5},
1051 :     {49, 5}, {49, 5}, {49, 5}, {49, 5}, {4097, 4}, {4097, 4},
1052 :     {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4}, {4097, 4},
1053 :     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
1054 :     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
1055 :     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
1056 :     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
1057 :     {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
1058 :     {1, 2}, {1, 2}, {17, 3}, {17, 3}, {17, 3}, {17, 3},
1059 :     {17, 3}, {17, 3}, {17, 3}, {17, 3}, {17, 3}, {17, 3},
1060 :     {17, 3}, {17, 3}, {17, 3}, {17, 3}, {17, 3}, {17, 3},
1061 :     {33, 4}, {33, 4}, {33, 4}, {33, 4}, {33, 4}, {33, 4},
1062 :     {33, 4}, {33, 4}, {2, 4}, {2, 4}, {2, 4}, {2, 4},
1063 :     {2, 4}, {2, 4}, {2, 4}, {2, 4}
1064 : Isibaar 1.1 };
1065 :    
1066 :    
1067 : edgomez 1.10 static VLC const DCT3Dtab1[] = {
1068 : edgomez 1.6 {9, 10}, {8, 10}, {4481, 9}, {4481, 9}, {4465, 9}, {4465, 9},
1069 :     {4449, 9}, {4449, 9}, {4433, 9}, {4433, 9}, {4417, 9}, {4417, 9},
1070 :     {4401, 9}, {4401, 9}, {4385, 9}, {4385, 9}, {4369, 9}, {4369, 9},
1071 :     {4098, 9}, {4098, 9}, {353, 9}, {353, 9}, {337, 9}, {337, 9},
1072 :     {321, 9}, {321, 9}, {305, 9}, {305, 9}, {289, 9}, {289, 9},
1073 :     {273, 9}, {273, 9}, {257, 9}, {257, 9}, {241, 9}, {241, 9},
1074 :     {66, 9}, {66, 9}, {50, 9}, {50, 9}, {7, 9}, {7, 9},
1075 :     {6, 9}, {6, 9}, {4353, 8}, {4353, 8}, {4353, 8}, {4353, 8},
1076 :     {4337, 8}, {4337, 8}, {4337, 8}, {4337, 8}, {4321, 8}, {4321, 8},
1077 :     {4321, 8}, {4321, 8}, {4305, 8}, {4305, 8}, {4305, 8}, {4305, 8},
1078 :     {4289, 8}, {4289, 8}, {4289, 8}, {4289, 8}, {4273, 8}, {4273, 8},
1079 :     {4273, 8}, {4273, 8}, {4257, 8}, {4257, 8}, {4257, 8}, {4257, 8},
1080 :     {4241, 8}, {4241, 8}, {4241, 8}, {4241, 8}, {225, 8}, {225, 8},
1081 :     {225, 8}, {225, 8}, {209, 8}, {209, 8}, {209, 8}, {209, 8},
1082 :     {34, 8}, {34, 8}, {34, 8}, {34, 8}, {19, 8}, {19, 8},
1083 :     {19, 8}, {19, 8}, {5, 8}, {5, 8}, {5, 8}, {5, 8}
1084 : Isibaar 1.1 };
1085 :    
1086 : edgomez 1.10 static VLC const DCT3Dtab2[] = {
1087 : edgomez 1.6 {4114, 11}, {4114, 11}, {4099, 11}, {4099, 11}, {11, 11}, {11, 11},
1088 :     {10, 11}, {10, 11}, {4545, 10}, {4545, 10}, {4545, 10}, {4545, 10},
1089 :     {4529, 10}, {4529, 10}, {4529, 10}, {4529, 10}, {4513, 10}, {4513, 10},
1090 :     {4513, 10}, {4513, 10}, {4497, 10}, {4497, 10}, {4497, 10}, {4497, 10},
1091 :     {146, 10}, {146, 10}, {146, 10}, {146, 10}, {130, 10}, {130, 10},
1092 :     {130, 10}, {130, 10}, {114, 10}, {114, 10}, {114, 10}, {114, 10},
1093 :     {98, 10}, {98, 10}, {98, 10}, {98, 10}, {82, 10}, {82, 10},
1094 :     {82, 10}, {82, 10}, {51, 10}, {51, 10}, {51, 10}, {51, 10},
1095 :     {35, 10}, {35, 10}, {35, 10}, {35, 10}, {20, 10}, {20, 10},
1096 :     {20, 10}, {20, 10}, {12, 11}, {12, 11}, {21, 11}, {21, 11},
1097 :     {369, 11}, {369, 11}, {385, 11}, {385, 11}, {4561, 11}, {4561, 11},
1098 :     {4577, 11}, {4577, 11}, {4593, 11}, {4593, 11}, {4609, 11}, {4609, 11},
1099 :     {22, 12}, {36, 12}, {67, 12}, {83, 12}, {99, 12}, {162, 12},
1100 :     {401, 12}, {417, 12}, {4625, 12}, {4641, 12}, {4657, 12}, {4673, 12},
1101 :     {4689, 12}, {4705, 12}, {4721, 12}, {4737, 12}, {7167, 7},
1102 :     {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7},
1103 :     {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7},
1104 :     {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7},
1105 :     {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7},
1106 :     {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7}, {7167, 7},
1107 :     {7167, 7}
1108 : edgomez 1.3 };
1109 : Isibaar 1.1
1110 :    
1111 :     /* New tables for Intra luminance blocks */
1112 :    
1113 : edgomez 1.10 static VLC const DCT3Dtab3[] = {
1114 : edgomez 1.3 {0x10401, 7}, {0x10301, 7}, {0x00601, 7}, {0x10501, 7},
1115 :     {0x00701, 7}, {0x00202, 7}, {0x00103, 7}, {0x00009, 7},
1116 : edgomez 1.6 {0x10002, 6}, {0x10002, 6}, {0x00501, 6}, {0x00501, 6},
1117 : edgomez 1.3 {0x10201, 6}, {0x10201, 6}, {0x10101, 6}, {0x10101, 6},
1118 :     {0x00401, 6}, {0x00401, 6}, {0x00301, 6}, {0x00301, 6},
1119 : edgomez 1.6 {0x00008, 6}, {0x00008, 6}, {0x00007, 6}, {0x00007, 6},
1120 : edgomez 1.3 {0x00102, 6}, {0x00102, 6}, {0x00006, 6}, {0x00006, 6},
1121 :     {0x00201, 5}, {0x00201, 5}, {0x00201, 5}, {0x00201, 5},
1122 : edgomez 1.6 {0x00005, 5}, {0x00005, 5}, {0x00005, 5}, {0x00005, 5},
1123 :     {0x00004, 5}, {0x00004, 5}, {0x00004, 5}, {0x00004, 5},
1124 : edgomez 1.3 {0x10001, 4}, {0x10001, 4}, {0x10001, 4}, {0x10001, 4},
1125 :     {0x10001, 4}, {0x10001, 4}, {0x10001, 4}, {0x10001, 4},
1126 :     {0x00001, 2}, {0x00001, 2}, {0x00001, 2}, {0x00001, 2},
1127 :     {0x00001, 2}, {0x00001, 2}, {0x00001, 2}, {0x00001, 2},
1128 :     {0x00001, 2}, {0x00001, 2}, {0x00001, 2}, {0x00001, 2},
1129 :     {0x00001, 2}, {0x00001, 2}, {0x00001, 2}, {0x00001, 2},
1130 :     {0x00001, 2}, {0x00001, 2}, {0x00001, 2}, {0x00001, 2},
1131 :     {0x00001, 2}, {0x00001, 2}, {0x00001, 2}, {0x00001, 2},
1132 : edgomez 1.6 {0x00001, 2}, {0x00001, 2}, {0x00001, 2}, {0x00001, 2},
1133 :     {0x00001, 2}, {0x00001, 2}, {0x00001, 2}, {0x00001, 2},
1134 :     {0x00002, 3}, {0x00002, 3}, {0x00002, 3}, {0x00002, 3},
1135 :     {0x00002, 3}, {0x00002, 3}, {0x00002, 3}, {0x00002, 3},
1136 : edgomez 1.3 {0x00002, 3}, {0x00002, 3}, {0x00002, 3}, {0x00002, 3},
1137 :     {0x00002, 3}, {0x00002, 3}, {0x00002, 3}, {0x00002, 3},
1138 :     {0x00101, 4}, {0x00101, 4}, {0x00101, 4}, {0x00101, 4},
1139 :     {0x00101, 4}, {0x00101, 4}, {0x00101, 4}, {0x00101, 4},
1140 :     {0x00003, 4}, {0x00003, 4}, {0x00003, 4}, {0x00003, 4},
1141 :     {0x00003, 4}, {0x00003, 4}, {0x00003, 4}, {0x00003, 4}
1142 : Isibaar 1.1 };
1143 :    
1144 :    
1145 : edgomez 1.10 static VLC const DCT3Dtab4[] = {
1146 : edgomez 1.6 {0x00012, 10}, {0x00011, 10}, {0x10e01, 9}, {0x10e01, 9},
1147 : edgomez 1.3 {0x10d01, 9}, {0x10d01, 9}, {0x10c01, 9}, {0x10c01, 9},
1148 : edgomez 1.6 {0x10b01, 9}, {0x10b01, 9}, {0x10a01, 9}, {0x10a01, 9},
1149 : edgomez 1.3 {0x10102, 9}, {0x10102, 9}, {0x10004, 9}, {0x10004, 9},
1150 :     {0x00c01, 9}, {0x00c01, 9}, {0x00b01, 9}, {0x00b01, 9},
1151 : edgomez 1.6 {0x00702, 9}, {0x00702, 9}, {0x00602, 9}, {0x00602, 9},
1152 : edgomez 1.3 {0x00502, 9}, {0x00502, 9}, {0x00303, 9}, {0x00303, 9},
1153 :     {0x00203, 9}, {0x00203, 9}, {0x00106, 9}, {0x00106, 9},
1154 : edgomez 1.6 {0x00105, 9}, {0x00105, 9}, {0x00010, 9}, {0x00010, 9},
1155 : edgomez 1.3 {0x00402, 9}, {0x00402, 9}, {0x0000f, 9}, {0x0000f, 9},
1156 :     {0x0000e, 9}, {0x0000e, 9}, {0x0000d, 9}, {0x0000d, 9},
1157 : edgomez 1.6 {0x10801, 8}, {0x10801, 8}, {0x10801, 8}, {0x10801, 8},
1158 : edgomez 1.3 {0x10701, 8}, {0x10701, 8}, {0x10701, 8}, {0x10701, 8},
1159 :     {0x10601, 8}, {0x10601, 8}, {0x10601, 8}, {0x10601, 8},
1160 : edgomez 1.6 {0x10003, 8}, {0x10003, 8}, {0x10003, 8}, {0x10003, 8},
1161 : edgomez 1.3 {0x00a01, 8}, {0x00a01, 8}, {0x00a01, 8}, {0x00a01, 8},
1162 :     {0x00901, 8}, {0x00901, 8}, {0x00901, 8}, {0x00901, 8},
1163 : edgomez 1.6 {0x00801, 8}, {0x00801, 8}, {0x00801, 8}, {0x00801, 8},
1164 : edgomez 1.3 {0x10901, 8}, {0x10901, 8}, {0x10901, 8}, {0x10901, 8},
1165 :     {0x00302, 8}, {0x00302, 8}, {0x00302, 8}, {0x00302, 8},
1166 : edgomez 1.6 {0x00104, 8}, {0x00104, 8}, {0x00104, 8}, {0x00104, 8},
1167 : edgomez 1.3 {0x0000c, 8}, {0x0000c, 8}, {0x0000c, 8}, {0x0000c, 8},
1168 :     {0x0000b, 8}, {0x0000b, 8}, {0x0000b, 8}, {0x0000b, 8},
1169 : edgomez 1.6 {0x0000a, 8}, {0x0000a, 8}, {0x0000a, 8}, {0x0000a, 8}
1170 : Isibaar 1.1 };
1171 :    
1172 : edgomez 1.10 static VLC const DCT3Dtab5[] = {
1173 : edgomez 1.6 {0x10007, 11}, {0x10007, 11}, {0x10006, 11}, {0x10006, 11},
1174 :     {0x00016, 11}, {0x00016, 11}, {0x00015, 11}, {0x00015, 11},
1175 :     {0x10202, 10}, {0x10202, 10}, {0x10202, 10}, {0x10202, 10},
1176 :     {0x10103, 10}, {0x10103, 10}, {0x10103, 10}, {0x10103, 10},
1177 :     {0x10005, 10}, {0x10005, 10}, {0x10005, 10}, {0x10005, 10},
1178 :     {0x00d01, 10}, {0x00d01, 10}, {0x00d01, 10}, {0x00d01, 10},
1179 :     {0x00503, 10}, {0x00503, 10}, {0x00503, 10}, {0x00503, 10},
1180 :     {0x00802, 10}, {0x00802, 10}, {0x00802, 10}, {0x00802, 10},
1181 :     {0x00403, 10}, {0x00403, 10}, {0x00403, 10}, {0x00403, 10},
1182 :     {0x00304, 10}, {0x00304, 10}, {0x00304, 10}, {0x00304, 10},
1183 :     {0x00204, 10}, {0x00204, 10}, {0x00204, 10}, {0x00204, 10},
1184 :     {0x00107, 10}, {0x00107, 10}, {0x00107, 10}, {0x00107, 10},
1185 :     {0x00014, 10}, {0x00014, 10}, {0x00014, 10}, {0x00014, 10},
1186 :     {0x00013, 10}, {0x00013, 10}, {0x00013, 10}, {0x00013, 10},
1187 :     {0x00017, 11}, {0x00017, 11}, {0x00018, 11}, {0x00018, 11},
1188 :     {0x00108, 11}, {0x00108, 11}, {0x00902, 11}, {0x00902, 11},
1189 :     {0x10302, 11}, {0x10302, 11}, {0x10402, 11}, {0x10402, 11},
1190 :     {0x10f01, 11}, {0x10f01, 11}, {0x11001, 11}, {0x11001, 11},
1191 :     {0x00019, 12}, {0x0001a, 12}, {0x0001b, 12}, {0x00109, 12},
1192 :     {0x00603, 12}, {0x0010a, 12}, {0x00205, 12}, {0x00703, 12},
1193 :     {0x00e01, 12}, {0x10008, 12}, {0x10502, 12}, {0x10602, 12},
1194 :     {0x11101, 12}, {0x11201, 12}, {0x11301, 12}, {0x11401, 12},
1195 : edgomez 1.3 {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7},
1196 :     {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7},
1197 :     {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7},
1198 :     {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7},
1199 :     {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7},
1200 :     {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7},
1201 :     {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7},
1202 :     {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7}, {0x01bff, 7}
1203 : Isibaar 1.1 };
1204 :    
1205 : edgomez 1.10 static short const dc_threshold[] = {
1206 :     26708, 29545, 25120, 28265, 29281, 8313, 29557, 29541,
1207 :     18208, 21838, 18208, 19536, 29472, 26223, 30580, 29281,
1208 :     8293, 25956, 26994, 25974, 8292, 29286, 28015, 22560,
1209 :     18774, 8260, 20557, 18245, 8244, 26664, 29812, 14960,
1210 :     12079, 30583, 11895, 30328, 25705, 28462, 26482, 29472,
1211 :     30063, 25458, 29541, 8233, 29505, 8299, 28518, 8306,
1212 :     26740, 8293, 28531, 29301, 25955, 8307, 28532, 31008,
1213 :     30063, 8306, 26980, 29811, 26994, 30050, 28532, 2674
1214 :     };
1215 :    
1216 :    
1217 :     static VLC const ERRtab[] = {
1218 : Isibaar 1.1 {VLC_ERROR, 0}, {VLC_ERROR, 0}, {VLC_ERROR, 0},
1219 :     {VLC_ERROR, 0}, {VLC_ERROR, 0}, {VLC_ERROR, 0},
1220 :     {VLC_ERROR, 0}, {VLC_ERROR, 0}, {VLC_ERROR, 0},
1221 :     {VLC_ERROR, 0}, {VLC_ERROR, 0}, {VLC_ERROR, 0},
1222 : edgomez 1.3 {VLC_ERROR, 0}, {VLC_ERROR, 0}, {VLC_ERROR, 0}
1223 : Isibaar 1.1 };
1224 :    
1225 : edgomez 1.10 static VLC const dc_lum_tab[] = {
1226 : edgomez 1.7 {0, 0}, {4, 3}, {3, 3}, {0, 3},
1227 : Isibaar 1.1 {2, 2}, {2, 2}, {1, 2}, {1, 2},
1228 :     };
1229 :    
1230 : edgomez 1.7 #endif /* _VLC_CODES_H */

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4