dx50 = DX50
[mplayer/glamo.git] / libmpeg2 / vlc.h
blobaa3dfe184161057bb20d103dad5e19dea91d206b
1 /*
2 * vlc.h
3 * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
4 * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
6 * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
7 * See http://libmpeg2.sourceforge.net/ for updates.
9 * mpeg2dec is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * mpeg2dec is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #define GETWORD(bit_buf,shift,bit_ptr) \
25 do { \
26 bit_buf |= ((bit_ptr[0] << 8) | bit_ptr[1]) << (shift); \
27 bit_ptr += 2; \
28 } while (0)
30 static inline void bitstream_init (decoder_t * decoder, const uint8_t * start)
32 decoder->bitstream_buf =
33 (start[0] << 24) | (start[1] << 16) | (start[2] << 8) | start[3];
34 decoder->bitstream_ptr = start + 4;
35 decoder->bitstream_bits = -16;
38 /* make sure that there are at least 16 valid bits in bit_buf */
39 #define NEEDBITS(bit_buf,bits,bit_ptr) \
40 do { \
41 if (unlikely (bits > 0)) { \
42 GETWORD (bit_buf, bits, bit_ptr); \
43 bits -= 16; \
44 } \
45 } while (0)
47 /* remove num valid bits from bit_buf */
48 #define DUMPBITS(bit_buf,bits,num) \
49 do { \
50 bit_buf <<= (num); \
51 bits += (num); \
52 } while (0)
54 /* take num bits from the high part of bit_buf and zero extend them */
55 #define UBITS(bit_buf,num) (((uint32_t)(bit_buf)) >> (32 - (num)))
57 /* take num bits from the high part of bit_buf and sign extend them */
58 #define SBITS(bit_buf,num) (((int32_t)(bit_buf)) >> (32 - (num)))
60 typedef struct {
61 uint8_t modes;
62 uint8_t len;
63 } MBtab;
65 typedef struct {
66 uint8_t delta;
67 uint8_t len;
68 } MVtab;
70 typedef struct {
71 int8_t dmv;
72 uint8_t len;
73 } DMVtab;
75 typedef struct {
76 uint8_t cbp;
77 uint8_t len;
78 } CBPtab;
80 typedef struct {
81 uint8_t size;
82 uint8_t len;
83 } DCtab;
85 typedef struct {
86 uint8_t run;
87 uint8_t level;
88 uint8_t len;
89 } DCTtab;
91 typedef struct {
92 uint8_t mba;
93 uint8_t len;
94 } MBAtab;
97 #define INTRA MACROBLOCK_INTRA
98 #define QUANT MACROBLOCK_QUANT
100 static const MBtab MB_I [] = {
101 {INTRA|QUANT, 2}, {INTRA, 1}
104 #define MC MACROBLOCK_MOTION_FORWARD
105 #define CODED MACROBLOCK_PATTERN
107 static const MBtab MB_P [] = {
108 {INTRA|QUANT, 6}, {CODED|QUANT, 5}, {MC|CODED|QUANT, 5}, {INTRA, 5},
109 {MC, 3}, {MC, 3}, {MC, 3}, {MC, 3},
110 {CODED, 2}, {CODED, 2}, {CODED, 2}, {CODED, 2},
111 {CODED, 2}, {CODED, 2}, {CODED, 2}, {CODED, 2},
112 {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1},
113 {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1},
114 {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1},
115 {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}, {MC|CODED, 1}
118 #define FWD MACROBLOCK_MOTION_FORWARD
119 #define BWD MACROBLOCK_MOTION_BACKWARD
120 #define INTER MACROBLOCK_MOTION_FORWARD|MACROBLOCK_MOTION_BACKWARD
122 static const MBtab MB_B [] = {
123 {0, 0}, {INTRA|QUANT, 6},
124 {BWD|CODED|QUANT, 6}, {FWD|CODED|QUANT, 6},
125 {INTER|CODED|QUANT, 5}, {INTER|CODED|QUANT, 5},
126 {INTRA, 5}, {INTRA, 5},
127 {FWD, 4}, {FWD, 4}, {FWD, 4}, {FWD, 4},
128 {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4}, {FWD|CODED, 4},
129 {BWD, 3}, {BWD, 3}, {BWD, 3}, {BWD, 3},
130 {BWD, 3}, {BWD, 3}, {BWD, 3}, {BWD, 3},
131 {BWD|CODED, 3}, {BWD|CODED, 3}, {BWD|CODED, 3}, {BWD|CODED, 3},
132 {BWD|CODED, 3}, {BWD|CODED, 3}, {BWD|CODED, 3}, {BWD|CODED, 3},
133 {INTER, 2}, {INTER, 2}, {INTER, 2}, {INTER, 2},
134 {INTER, 2}, {INTER, 2}, {INTER, 2}, {INTER, 2},
135 {INTER, 2}, {INTER, 2}, {INTER, 2}, {INTER, 2},
136 {INTER, 2}, {INTER, 2}, {INTER, 2}, {INTER, 2},
137 {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2},
138 {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2},
139 {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2},
140 {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}, {INTER|CODED, 2}
143 #undef INTRA
144 #undef QUANT
145 #undef MC
146 #undef CODED
147 #undef FWD
148 #undef BWD
149 #undef INTER
152 static const MVtab MV_4 [] = {
153 { 3, 6}, { 2, 4}, { 1, 3}, { 1, 3}, { 0, 2}, { 0, 2}, { 0, 2}, { 0, 2}
156 static const MVtab MV_10 [] = {
157 { 0,10}, { 0,10}, { 0,10}, { 0,10}, { 0,10}, { 0,10}, { 0,10}, { 0,10},
158 { 0,10}, { 0,10}, { 0,10}, { 0,10}, {15,10}, {14,10}, {13,10}, {12,10},
159 {11,10}, {10,10}, { 9, 9}, { 9, 9}, { 8, 9}, { 8, 9}, { 7, 9}, { 7, 9},
160 { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7}, { 6, 7},
161 { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7}, { 5, 7},
162 { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7}, { 4, 7}
166 static const DMVtab DMV_2 [] = {
167 { 0, 1}, { 0, 1}, { 1, 2}, {-1, 2}
171 static const CBPtab CBP_7 [] = {
172 {0x22, 7}, {0x12, 7}, {0x0a, 7}, {0x06, 7},
173 {0x21, 7}, {0x11, 7}, {0x09, 7}, {0x05, 7},
174 {0x3f, 6}, {0x3f, 6}, {0x03, 6}, {0x03, 6},
175 {0x24, 6}, {0x24, 6}, {0x18, 6}, {0x18, 6},
176 {0x3e, 5}, {0x3e, 5}, {0x3e, 5}, {0x3e, 5},
177 {0x02, 5}, {0x02, 5}, {0x02, 5}, {0x02, 5},
178 {0x3d, 5}, {0x3d, 5}, {0x3d, 5}, {0x3d, 5},
179 {0x01, 5}, {0x01, 5}, {0x01, 5}, {0x01, 5},
180 {0x38, 5}, {0x38, 5}, {0x38, 5}, {0x38, 5},
181 {0x34, 5}, {0x34, 5}, {0x34, 5}, {0x34, 5},
182 {0x2c, 5}, {0x2c, 5}, {0x2c, 5}, {0x2c, 5},
183 {0x1c, 5}, {0x1c, 5}, {0x1c, 5}, {0x1c, 5},
184 {0x28, 5}, {0x28, 5}, {0x28, 5}, {0x28, 5},
185 {0x14, 5}, {0x14, 5}, {0x14, 5}, {0x14, 5},
186 {0x30, 5}, {0x30, 5}, {0x30, 5}, {0x30, 5},
187 {0x0c, 5}, {0x0c, 5}, {0x0c, 5}, {0x0c, 5},
188 {0x20, 4}, {0x20, 4}, {0x20, 4}, {0x20, 4},
189 {0x20, 4}, {0x20, 4}, {0x20, 4}, {0x20, 4},
190 {0x10, 4}, {0x10, 4}, {0x10, 4}, {0x10, 4},
191 {0x10, 4}, {0x10, 4}, {0x10, 4}, {0x10, 4},
192 {0x08, 4}, {0x08, 4}, {0x08, 4}, {0x08, 4},
193 {0x08, 4}, {0x08, 4}, {0x08, 4}, {0x08, 4},
194 {0x04, 4}, {0x04, 4}, {0x04, 4}, {0x04, 4},
195 {0x04, 4}, {0x04, 4}, {0x04, 4}, {0x04, 4},
196 {0x3c, 3}, {0x3c, 3}, {0x3c, 3}, {0x3c, 3},
197 {0x3c, 3}, {0x3c, 3}, {0x3c, 3}, {0x3c, 3},
198 {0x3c, 3}, {0x3c, 3}, {0x3c, 3}, {0x3c, 3},
199 {0x3c, 3}, {0x3c, 3}, {0x3c, 3}, {0x3c, 3}
202 static const CBPtab CBP_9 [] = {
203 {0, 0}, {0x00, 9}, {0x27, 9}, {0x1b, 9},
204 {0x3b, 9}, {0x37, 9}, {0x2f, 9}, {0x1f, 9},
205 {0x3a, 8}, {0x3a, 8}, {0x36, 8}, {0x36, 8},
206 {0x2e, 8}, {0x2e, 8}, {0x1e, 8}, {0x1e, 8},
207 {0x39, 8}, {0x39, 8}, {0x35, 8}, {0x35, 8},
208 {0x2d, 8}, {0x2d, 8}, {0x1d, 8}, {0x1d, 8},
209 {0x26, 8}, {0x26, 8}, {0x1a, 8}, {0x1a, 8},
210 {0x25, 8}, {0x25, 8}, {0x19, 8}, {0x19, 8},
211 {0x2b, 8}, {0x2b, 8}, {0x17, 8}, {0x17, 8},
212 {0x33, 8}, {0x33, 8}, {0x0f, 8}, {0x0f, 8},
213 {0x2a, 8}, {0x2a, 8}, {0x16, 8}, {0x16, 8},
214 {0x32, 8}, {0x32, 8}, {0x0e, 8}, {0x0e, 8},
215 {0x29, 8}, {0x29, 8}, {0x15, 8}, {0x15, 8},
216 {0x31, 8}, {0x31, 8}, {0x0d, 8}, {0x0d, 8},
217 {0x23, 8}, {0x23, 8}, {0x13, 8}, {0x13, 8},
218 {0x0b, 8}, {0x0b, 8}, {0x07, 8}, {0x07, 8}
222 static const DCtab DC_lum_5 [] = {
223 {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
224 {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2},
225 {0, 3}, {0, 3}, {0, 3}, {0, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3},
226 {4, 3}, {4, 3}, {4, 3}, {4, 3}, {5, 4}, {5, 4}, {6, 5}
229 static const DCtab DC_chrom_5 [] = {
230 {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2},
231 {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
232 {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2},
233 {3, 3}, {3, 3}, {3, 3}, {3, 3}, {4, 4}, {4, 4}, {5, 5}
236 static const DCtab DC_long [] = {
237 {6, 5}, {6, 5}, {6, 5}, {6, 5}, {6, 5}, {6, 5}, { 6, 5}, { 6, 5},
238 {6, 5}, {6, 5}, {6, 5}, {6, 5}, {6, 5}, {6, 5}, { 6, 5}, { 6, 5},
239 {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, { 7, 6}, { 7, 6},
240 {8, 7}, {8, 7}, {8, 7}, {8, 7}, {9, 8}, {9, 8}, {10, 9}, {11, 9}
244 static const DCTtab DCT_16 [] = {
245 {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, {129, 0, 0},
246 {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, {129, 0, 0},
247 {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, {129, 0, 0},
248 {129, 0, 0}, {129, 0, 0}, {129, 0, 0}, {129, 0, 0},
249 { 2,18, 0}, { 2,17, 0}, { 2,16, 0}, { 2,15, 0},
250 { 7, 3, 0}, { 17, 2, 0}, { 16, 2, 0}, { 15, 2, 0},
251 { 14, 2, 0}, { 13, 2, 0}, { 12, 2, 0}, { 32, 1, 0},
252 { 31, 1, 0}, { 30, 1, 0}, { 29, 1, 0}, { 28, 1, 0}
255 static const DCTtab DCT_15 [] = {
256 { 1,40,15}, { 1,39,15}, { 1,38,15}, { 1,37,15},
257 { 1,36,15}, { 1,35,15}, { 1,34,15}, { 1,33,15},
258 { 1,32,15}, { 2,14,15}, { 2,13,15}, { 2,12,15},
259 { 2,11,15}, { 2,10,15}, { 2, 9,15}, { 2, 8,15},
260 { 1,31,14}, { 1,31,14}, { 1,30,14}, { 1,30,14},
261 { 1,29,14}, { 1,29,14}, { 1,28,14}, { 1,28,14},
262 { 1,27,14}, { 1,27,14}, { 1,26,14}, { 1,26,14},
263 { 1,25,14}, { 1,25,14}, { 1,24,14}, { 1,24,14},
264 { 1,23,14}, { 1,23,14}, { 1,22,14}, { 1,22,14},
265 { 1,21,14}, { 1,21,14}, { 1,20,14}, { 1,20,14},
266 { 1,19,14}, { 1,19,14}, { 1,18,14}, { 1,18,14},
267 { 1,17,14}, { 1,17,14}, { 1,16,14}, { 1,16,14}
270 static const DCTtab DCT_13 [] = {
271 { 11, 2,13}, { 10, 2,13}, { 6, 3,13}, { 4, 4,13},
272 { 3, 5,13}, { 2, 7,13}, { 2, 6,13}, { 1,15,13},
273 { 1,14,13}, { 1,13,13}, { 1,12,13}, { 27, 1,13},
274 { 26, 1,13}, { 25, 1,13}, { 24, 1,13}, { 23, 1,13},
275 { 1,11,12}, { 1,11,12}, { 9, 2,12}, { 9, 2,12},
276 { 5, 3,12}, { 5, 3,12}, { 1,10,12}, { 1,10,12},
277 { 3, 4,12}, { 3, 4,12}, { 8, 2,12}, { 8, 2,12},
278 { 22, 1,12}, { 22, 1,12}, { 21, 1,12}, { 21, 1,12},
279 { 1, 9,12}, { 1, 9,12}, { 20, 1,12}, { 20, 1,12},
280 { 19, 1,12}, { 19, 1,12}, { 2, 5,12}, { 2, 5,12},
281 { 4, 3,12}, { 4, 3,12}, { 1, 8,12}, { 1, 8,12},
282 { 7, 2,12}, { 7, 2,12}, { 18, 1,12}, { 18, 1,12}
285 static const DCTtab DCT_B14_10 [] = {
286 { 17, 1,10}, { 6, 2,10}, { 1, 7,10}, { 3, 3,10},
287 { 2, 4,10}, { 16, 1,10}, { 15, 1,10}, { 5, 2,10}
290 static const DCTtab DCT_B14_8 [] = {
291 { 65, 0, 6}, { 65, 0, 6}, { 65, 0, 6}, { 65, 0, 6},
292 { 3, 2, 7}, { 3, 2, 7}, { 10, 1, 7}, { 10, 1, 7},
293 { 1, 4, 7}, { 1, 4, 7}, { 9, 1, 7}, { 9, 1, 7},
294 { 8, 1, 6}, { 8, 1, 6}, { 8, 1, 6}, { 8, 1, 6},
295 { 7, 1, 6}, { 7, 1, 6}, { 7, 1, 6}, { 7, 1, 6},
296 { 2, 2, 6}, { 2, 2, 6}, { 2, 2, 6}, { 2, 2, 6},
297 { 6, 1, 6}, { 6, 1, 6}, { 6, 1, 6}, { 6, 1, 6},
298 { 14, 1, 8}, { 1, 6, 8}, { 13, 1, 8}, { 12, 1, 8},
299 { 4, 2, 8}, { 2, 3, 8}, { 1, 5, 8}, { 11, 1, 8}
302 static const DCTtab DCT_B14AC_5 [] = {
303 { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5},
304 { 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4},
305 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
306 {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, {129, 0, 2},
307 {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, {129, 0, 2},
308 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
309 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}
312 static const DCTtab DCT_B14DC_5 [] = {
313 { 1, 3, 5}, { 5, 1, 5}, { 4, 1, 5},
314 { 1, 2, 4}, { 1, 2, 4}, { 3, 1, 4}, { 3, 1, 4},
315 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
316 { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1},
317 { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1},
318 { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1},
319 { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}, { 1, 1, 1}
322 static const DCTtab DCT_B15_10 [] = {
323 { 6, 2, 9}, { 6, 2, 9}, { 15, 1, 9}, { 15, 1, 9},
324 { 3, 4,10}, { 17, 1,10}, { 16, 1, 9}, { 16, 1, 9}
327 static const DCTtab DCT_B15_8 [] = {
328 { 65, 0, 6}, { 65, 0, 6}, { 65, 0, 6}, { 65, 0, 6},
329 { 8, 1, 7}, { 8, 1, 7}, { 9, 1, 7}, { 9, 1, 7},
330 { 7, 1, 7}, { 7, 1, 7}, { 3, 2, 7}, { 3, 2, 7},
331 { 1, 7, 6}, { 1, 7, 6}, { 1, 7, 6}, { 1, 7, 6},
332 { 1, 6, 6}, { 1, 6, 6}, { 1, 6, 6}, { 1, 6, 6},
333 { 5, 1, 6}, { 5, 1, 6}, { 5, 1, 6}, { 5, 1, 6},
334 { 6, 1, 6}, { 6, 1, 6}, { 6, 1, 6}, { 6, 1, 6},
335 { 2, 5, 8}, { 12, 1, 8}, { 1,11, 8}, { 1,10, 8},
336 { 14, 1, 8}, { 13, 1, 8}, { 4, 2, 8}, { 2, 4, 8},
337 { 3, 1, 5}, { 3, 1, 5}, { 3, 1, 5}, { 3, 1, 5},
338 { 3, 1, 5}, { 3, 1, 5}, { 3, 1, 5}, { 3, 1, 5},
339 { 2, 2, 5}, { 2, 2, 5}, { 2, 2, 5}, { 2, 2, 5},
340 { 2, 2, 5}, { 2, 2, 5}, { 2, 2, 5}, { 2, 2, 5},
341 { 4, 1, 5}, { 4, 1, 5}, { 4, 1, 5}, { 4, 1, 5},
342 { 4, 1, 5}, { 4, 1, 5}, { 4, 1, 5}, { 4, 1, 5},
343 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
344 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
345 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
346 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
347 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
348 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
349 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
350 { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3}, { 2, 1, 3},
351 {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, {129, 0, 4},
352 {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, {129, 0, 4},
353 {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, {129, 0, 4},
354 {129, 0, 4}, {129, 0, 4}, {129, 0, 4}, {129, 0, 4},
355 { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4},
356 { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4},
357 { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4},
358 { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4}, { 1, 3, 4},
359 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
360 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
361 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
362 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
363 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
364 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
365 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
366 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
367 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
368 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
369 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
370 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
371 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
372 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
373 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
374 { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2}, { 1, 1, 2},
375 { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3},
376 { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3},
377 { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3},
378 { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3},
379 { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3},
380 { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3},
381 { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3},
382 { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3}, { 1, 2, 3},
383 { 1, 4, 5}, { 1, 4, 5}, { 1, 4, 5}, { 1, 4, 5},
384 { 1, 4, 5}, { 1, 4, 5}, { 1, 4, 5}, { 1, 4, 5},
385 { 1, 5, 5}, { 1, 5, 5}, { 1, 5, 5}, { 1, 5, 5},
386 { 1, 5, 5}, { 1, 5, 5}, { 1, 5, 5}, { 1, 5, 5},
387 { 10, 1, 7}, { 10, 1, 7}, { 2, 3, 7}, { 2, 3, 7},
388 { 11, 1, 7}, { 11, 1, 7}, { 1, 8, 7}, { 1, 8, 7},
389 { 1, 9, 7}, { 1, 9, 7}, { 1,12, 8}, { 1,13, 8},
390 { 3, 3, 8}, { 5, 2, 8}, { 1,14, 8}, { 1,15, 8}
394 static const MBAtab MBA_5 [] = {
395 {6, 5}, {5, 5}, {4, 4}, {4, 4}, {3, 4}, {3, 4},
396 {2, 3}, {2, 3}, {2, 3}, {2, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
397 {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1},
398 {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}
401 static const MBAtab MBA_11 [] = {
402 {32, 11}, {31, 11}, {30, 11}, {29, 11},
403 {28, 11}, {27, 11}, {26, 11}, {25, 11},
404 {24, 11}, {23, 11}, {22, 11}, {21, 11},
405 {20, 10}, {20, 10}, {19, 10}, {19, 10},
406 {18, 10}, {18, 10}, {17, 10}, {17, 10},
407 {16, 10}, {16, 10}, {15, 10}, {15, 10},
408 {14, 8}, {14, 8}, {14, 8}, {14, 8},
409 {14, 8}, {14, 8}, {14, 8}, {14, 8},
410 {13, 8}, {13, 8}, {13, 8}, {13, 8},
411 {13, 8}, {13, 8}, {13, 8}, {13, 8},
412 {12, 8}, {12, 8}, {12, 8}, {12, 8},
413 {12, 8}, {12, 8}, {12, 8}, {12, 8},
414 {11, 8}, {11, 8}, {11, 8}, {11, 8},
415 {11, 8}, {11, 8}, {11, 8}, {11, 8},
416 {10, 8}, {10, 8}, {10, 8}, {10, 8},
417 {10, 8}, {10, 8}, {10, 8}, {10, 8},
418 { 9, 8}, { 9, 8}, { 9, 8}, { 9, 8},
419 { 9, 8}, { 9, 8}, { 9, 8}, { 9, 8},
420 { 8, 7}, { 8, 7}, { 8, 7}, { 8, 7},
421 { 8, 7}, { 8, 7}, { 8, 7}, { 8, 7},
422 { 8, 7}, { 8, 7}, { 8, 7}, { 8, 7},
423 { 8, 7}, { 8, 7}, { 8, 7}, { 8, 7},
424 { 7, 7}, { 7, 7}, { 7, 7}, { 7, 7},
425 { 7, 7}, { 7, 7}, { 7, 7}, { 7, 7},
426 { 7, 7}, { 7, 7}, { 7, 7}, { 7, 7},
427 { 7, 7}, { 7, 7}, { 7, 7}, { 7, 7}