r956: README.BUILD - add more library recommendations
[cinelerra_cv/ct.git] / libmpeg3 / video / vlc.c
blobc20b2a8dcdd6d46a6d845476e2ee7725bcc795b2
1 // FIXME: vlc.h redefines ERROR to 99 if and only if error is defined.
2 #define ERROR
4 #include "mpeg3private.h"
5 #include "mpeg3protos.h"
6 #include "vlc.h"
8 /* variable length code tables */
10 /* Table B-3, mb_type in P-pictures, codes 001..1xx */
11 mpeg3_VLCtab_t mpeg3_PMBtab0[8] = {
12 {ERROR,0},
13 {MB_FORWARD,3},
14 {MB_PATTERN,2}, {MB_PATTERN,2},
15 {MB_FORWARD|MB_PATTERN,1}, {MB_FORWARD|MB_PATTERN,1},
16 {MB_FORWARD|MB_PATTERN,1}, {MB_FORWARD|MB_PATTERN,1}
19 /* Table B-3, mb_type in P-pictures, codes 000001..00011x */
20 mpeg3_VLCtab_t mpeg3_PMBtab1[8] = {
21 {ERROR,0},
22 {MB_QUANT|MB_INTRA,6},
23 {MB_QUANT|MB_PATTERN,5}, {MB_QUANT|MB_PATTERN,5},
24 {MB_QUANT|MB_FORWARD|MB_PATTERN,5}, {MB_QUANT|MB_FORWARD|MB_PATTERN,5},
25 {MB_INTRA,5}, {MB_INTRA,5}
28 /* Table B-4, mb_type in B-pictures, codes 0010..11xx */
29 mpeg3_VLCtab_t mpeg3_BMBtab0[16] = {
30 {ERROR,0}, {ERROR,0},
31 {MB_FORWARD,4},
32 {MB_FORWARD|MB_PATTERN,4},
33 {MB_BACKWARD,3}, {MB_BACKWARD,3},
34 {MB_BACKWARD|MB_PATTERN,3}, {MB_BACKWARD|MB_PATTERN,3},
35 {MB_FORWARD|MB_BACKWARD,2}, {MB_FORWARD|MB_BACKWARD,2},
36 {MB_FORWARD|MB_BACKWARD,2}, {MB_FORWARD|MB_BACKWARD,2},
37 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2},
38 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2},
39 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2},
40 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2}
43 /* Table B-4, mb_type in B-pictures, codes 000001..00011x */
44 mpeg3_VLCtab_t mpeg3_BMBtab1[8] = {
45 {ERROR,0},
46 {MB_QUANT|MB_INTRA,6},
47 {MB_QUANT|MB_BACKWARD|MB_PATTERN,6},
48 {MB_QUANT|MB_FORWARD|MB_PATTERN,6},
49 {MB_QUANT|MB_FORWARD|MB_BACKWARD|MB_PATTERN,5},
50 {MB_QUANT|MB_FORWARD|MB_BACKWARD|MB_PATTERN,5},
51 {MB_INTRA,5}, {MB_INTRA,5}
54 /* Table B-5, mb_type in spat. scal. I-pictures, codes 0001..1xxx */
55 mpeg3_VLCtab_t mpeg3_spIMBtab[16] = {
56 {ERROR,0},
57 {MB_CLASS4,4},
58 {MB_QUANT|MB_INTRA,4},
59 {MB_INTRA,4},
60 {MB_CLASS4|MB_QUANT|MB_PATTERN,2}, {MB_CLASS4|MB_QUANT|MB_PATTERN,2},
61 {MB_CLASS4|MB_QUANT|MB_PATTERN,2}, {MB_CLASS4|MB_QUANT|MB_PATTERN,2},
62 {MB_CLASS4|MB_PATTERN,1}, {MB_CLASS4|MB_PATTERN,1},
63 {MB_CLASS4|MB_PATTERN,1}, {MB_CLASS4|MB_PATTERN,1},
64 {MB_CLASS4|MB_PATTERN,1}, {MB_CLASS4|MB_PATTERN,1},
65 {MB_CLASS4|MB_PATTERN,1}, {MB_CLASS4|MB_PATTERN,1}
68 /* Table B-6, mb_type in spat. scal. P-pictures, codes 0010..11xx */
69 mpeg3_VLCtab_t mpeg3_spPMBtab0[16] =
71 {ERROR,0},{ERROR,0},
72 {MB_FORWARD,4},
73 {MB_WEIGHT|MB_FORWARD,4},
74 {MB_QUANT|MB_FORWARD|MB_PATTERN,3}, {MB_QUANT|MB_FORWARD|MB_PATTERN,3},
75 {MB_WEIGHT|MB_FORWARD|MB_PATTERN,3}, {MB_WEIGHT|MB_FORWARD|MB_PATTERN,3},
76 {MB_FORWARD|MB_PATTERN,2}, {MB_FORWARD|MB_PATTERN,2},
77 {MB_FORWARD|MB_PATTERN,2}, {MB_FORWARD|MB_PATTERN,2},
78 {MB_WEIGHT|MB_QUANT|MB_FORWARD|MB_PATTERN,2},
79 {MB_WEIGHT|MB_QUANT|MB_FORWARD|MB_PATTERN,2},
80 {MB_WEIGHT|MB_QUANT|MB_FORWARD|MB_PATTERN,2},
81 {MB_WEIGHT|MB_QUANT|MB_FORWARD|MB_PATTERN,2}
84 /* Table B-6, mb_type in spat. scal. P-pictures, codes 0000010..000111x */
85 mpeg3_VLCtab_t mpeg3_spPMBtab1[16] = {
86 {ERROR,0},{ERROR,0},
87 {MB_CLASS4|MB_QUANT|MB_PATTERN,7},
88 {MB_CLASS4,7},
89 {MB_PATTERN,7},
90 {MB_CLASS4|MB_PATTERN,7},
91 {MB_QUANT|MB_INTRA,7},
92 {MB_INTRA,7},
93 {MB_QUANT|MB_PATTERN,6}, {MB_QUANT|MB_PATTERN,6},
94 {MB_WEIGHT|MB_QUANT|MB_PATTERN,6}, {MB_WEIGHT|MB_QUANT|MB_PATTERN,6},
95 {MB_WEIGHT,6}, {MB_WEIGHT,6},
96 {MB_WEIGHT|MB_PATTERN,6}, {MB_WEIGHT|MB_PATTERN,6}
99 /* Table B-7, mb_type in spat. scal. B-pictures, codes 0010..11xx */
100 mpeg3_VLCtab_t mpeg3_spBMBtab0[14] = {
101 {MB_FORWARD,4},
102 {MB_FORWARD|MB_PATTERN,4},
103 {MB_BACKWARD,3}, {MB_BACKWARD,3},
104 {MB_BACKWARD|MB_PATTERN,3}, {MB_BACKWARD|MB_PATTERN,3},
105 {MB_FORWARD|MB_BACKWARD,2}, {MB_FORWARD|MB_BACKWARD,2},
106 {MB_FORWARD|MB_BACKWARD,2}, {MB_FORWARD|MB_BACKWARD,2},
107 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2},
108 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2},
109 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2},
110 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2}
113 /* Table B-7, mb_type in spat. scal. B-pictures, codes 0000100..000111x */
114 mpeg3_VLCtab_t mpeg3_spBMBtab1[12] = {
115 {MB_QUANT|MB_FORWARD|MB_PATTERN,7},
116 {MB_QUANT|MB_BACKWARD|MB_PATTERN,7},
117 {MB_INTRA,7},
118 {MB_QUANT|MB_FORWARD|MB_BACKWARD|MB_PATTERN,7},
119 {MB_WEIGHT|MB_FORWARD,6}, {MB_WEIGHT|MB_FORWARD,6},
120 {MB_WEIGHT|MB_FORWARD|MB_PATTERN,6}, {MB_WEIGHT|MB_FORWARD|MB_PATTERN,6},
121 {MB_WEIGHT|MB_BACKWARD,6}, {MB_WEIGHT|MB_BACKWARD,6},
122 {MB_WEIGHT|MB_BACKWARD|MB_PATTERN,6}, {MB_WEIGHT|MB_BACKWARD|MB_PATTERN,6}
125 /* Table B-7, mb_type in spat. scal. B-pictures, codes 00000100x..000001111 */
126 mpeg3_VLCtab_t mpeg3_spBMBtab2[8] = {
127 {MB_QUANT|MB_INTRA,8}, {MB_QUANT|MB_INTRA,8},
128 {MB_WEIGHT|MB_QUANT|MB_FORWARD|MB_PATTERN,8},
129 {MB_WEIGHT|MB_QUANT|MB_FORWARD|MB_PATTERN,8},
130 {MB_WEIGHT|MB_QUANT|MB_BACKWARD|MB_PATTERN,9},
131 {MB_CLASS4|MB_QUANT|MB_PATTERN,9},
132 {MB_CLASS4,9},
133 {MB_CLASS4|MB_PATTERN,9}
136 /* Table B-8, mb_type in spat. scal. B-pictures, codes 001..1xx */
137 mpeg3_VLCtab_t mpeg3_SNRMBtab[8] = {
138 {ERROR,0},
139 {0,3},
140 {MB_QUANT|MB_PATTERN,2}, {MB_QUANT|MB_PATTERN,2},
141 {MB_PATTERN,1}, {MB_PATTERN,1}, {MB_PATTERN,1}, {MB_PATTERN,1}
144 /* Table B-10, motion_code, codes 0001 ... 01xx */
145 mpeg3_VLCtab_t mpeg3_MVtab0[8] =
146 { {ERROR,0}, {3,3}, {2,2}, {2,2}, {1,1}, {1,1}, {1,1}, {1,1}
149 /* Table B-10, motion_code, codes 0000011 ... 000011x */
150 mpeg3_VLCtab_t mpeg3_MVtab1[8] =
151 { {ERROR,0}, {ERROR,0}, {ERROR,0}, {7,6}, {6,6}, {5,6}, {4,5}, {4,5}
154 /* Table B-10, motion_code, codes 0000001100 ... 000001011x */
155 mpeg3_VLCtab_t mpeg3_MVtab2[12] =
156 { {16,9}, {15,9}, {14,9}, {13,9},
157 {12,9}, {11,9}, {10,8}, {10,8},
158 {9,8}, {9,8}, {8,8}, {8,8}
161 /* Table B-9, coded_block_pattern, codes 01000 ... 111xx */
162 mpeg3_VLCtab_t mpeg3_CBPtab0[32] =
163 { {ERROR,0}, {ERROR,0}, {ERROR,0}, {ERROR,0},
164 {ERROR,0}, {ERROR,0}, {ERROR,0}, {ERROR,0},
165 {62,5}, {2,5}, {61,5}, {1,5}, {56,5}, {52,5}, {44,5}, {28,5},
166 {40,5}, {20,5}, {48,5}, {12,5}, {32,4}, {32,4}, {16,4}, {16,4},
167 {8,4}, {8,4}, {4,4}, {4,4}, {60,3}, {60,3}, {60,3}, {60,3}
170 /* Table B-9, coded_block_pattern, codes 00000100 ... 001111xx */
171 mpeg3_VLCtab_t mpeg3_CBPtab1[64] =
172 { {ERROR,0}, {ERROR,0}, {ERROR,0}, {ERROR,0},
173 {58,8}, {54,8}, {46,8}, {30,8},
174 {57,8}, {53,8}, {45,8}, {29,8}, {38,8}, {26,8}, {37,8}, {25,8},
175 {43,8}, {23,8}, {51,8}, {15,8}, {42,8}, {22,8}, {50,8}, {14,8},
176 {41,8}, {21,8}, {49,8}, {13,8}, {35,8}, {19,8}, {11,8}, {7,8},
177 {34,7}, {34,7}, {18,7}, {18,7}, {10,7}, {10,7}, {6,7}, {6,7},
178 {33,7}, {33,7}, {17,7}, {17,7}, {9,7}, {9,7}, {5,7}, {5,7},
179 {63,6}, {63,6}, {63,6}, {63,6}, {3,6}, {3,6}, {3,6}, {3,6},
180 {36,6}, {36,6}, {36,6}, {36,6}, {24,6}, {24,6}, {24,6}, {24,6}
183 /* Table B-9, coded_block_pattern, codes 000000001 ... 000000111 */
184 mpeg3_VLCtab_t mpeg3_CBPtab2[8] =
185 { {ERROR,0}, {0,9}, {39,9}, {27,9}, {59,9}, {55,9}, {47,9}, {31,9}
188 /* Table B-1, macroblock_address_increment, codes 00010 ... 011xx */
189 mpeg3_VLCtab_t mpeg3_MBAtab1[16] =
190 { {ERROR,0}, {ERROR,0}, {7,5}, {6,5}, {5,4}, {5,4}, {4,4}, {4,4},
191 {3,3}, {3,3}, {3,3}, {3,3}, {2,3}, {2,3}, {2,3}, {2,3}
194 /* Table B-1, macroblock_address_increment, codes 00000011000 ... 0000111xxxx */
195 mpeg3_VLCtab_t mpeg3_MBAtab2[104] =
197 {33,11}, {32,11}, {31,11}, {30,11}, {29,11}, {28,11}, {27,11}, {26,11},
198 {25,11}, {24,11}, {23,11}, {22,11}, {21,10}, {21,10}, {20,10}, {20,10},
199 {19,10}, {19,10}, {18,10}, {18,10}, {17,10}, {17,10}, {16,10}, {16,10},
200 {15,8}, {15,8}, {15,8}, {15,8}, {15,8}, {15,8}, {15,8}, {15,8},
201 {14,8}, {14,8}, {14,8}, {14,8}, {14,8}, {14,8}, {14,8}, {14,8},
202 {13,8}, {13,8}, {13,8}, {13,8}, {13,8}, {13,8}, {13,8}, {13,8},
203 {12,8}, {12,8}, {12,8}, {12,8}, {12,8}, {12,8}, {12,8}, {12,8},
204 {11,8}, {11,8}, {11,8}, {11,8}, {11,8}, {11,8}, {11,8}, {11,8},
205 {10,8}, {10,8}, {10,8}, {10,8}, {10,8}, {10,8}, {10,8}, {10,8},
206 {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7},
207 {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7},
208 {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7},
209 {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}
212 /* Table B-12, dct_dc_size_luminance, codes 00xxx ... 11110 */
213 mpeg3_VLCtab_t mpeg3_DClumtab0[32] =
214 { {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
215 {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2},
216 {0, 3}, {0, 3}, {0, 3}, {0, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3},
217 {4, 3}, {4, 3}, {4, 3}, {4, 3}, {5, 4}, {5, 4}, {6, 5}, {ERROR, 0}
220 /* Table B-12, dct_dc_size_luminance, codes 111110xxx ... 111111111 */
221 mpeg3_VLCtab_t mpeg3_DClumtab1[16] =
222 { {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6},
223 {8, 7}, {8, 7}, {8, 7}, {8, 7}, {9, 8}, {9, 8}, {10,9}, {11,9}
226 /* Table B-13, dct_dc_size_chrominance, codes 00xxx ... 11110 */
227 mpeg3_VLCtab_t mpeg3_DCchromtab0[32] =
228 { {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2},
229 {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
230 {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2},
231 {3, 3}, {3, 3}, {3, 3}, {3, 3}, {4, 4}, {4, 4}, {5, 5}, {ERROR, 0}
234 /* Table B-13, dct_dc_size_chrominance, codes 111110xxxx ... 1111111111 */
235 mpeg3_VLCtab_t mpeg3_DCchromtab1[32] =
236 { {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6},
237 {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6},
238 {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7},
239 {8, 8}, {8, 8}, {8, 8}, {8, 8}, {9, 9}, {9, 9}, {10,10}, {11,10}
242 /* Table B-14, DCT coefficients table zero,
243 * codes 0100 ... 1xxx (used for first (DC) coefficient)
245 mpeg3_DCTtab_t mpeg3_DCTtabfirst[12] =
247 {0,2,4}, {2,1,4}, {1,1,3}, {1,1,3},
248 {0,1,1}, {0,1,1}, {0,1,1}, {0,1,1},
249 {0,1,1}, {0,1,1}, {0,1,1}, {0,1,1}
252 /* Table B-14, DCT coefficients table zero,
253 * codes 0100 ... 1xxx (used for all other coefficients)
255 mpeg3_DCTtab_t mpeg3_DCTtabnext[12] =
257 {0,2,4}, {2,1,4}, {1,1,3}, {1,1,3},
258 {64,0,2}, {64,0,2}, {64,0,2}, {64,0,2}, /* EOB */
259 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2}
262 /* Table B-14, DCT coefficients table zero,
263 * codes 000001xx ... 00111xxx
265 mpeg3_DCTtab_t mpeg3_DCTtab0[60] =
267 {65,0,6}, {65,0,6}, {65,0,6}, {65,0,6}, /* Escape */
268 {2,2,7}, {2,2,7}, {9,1,7}, {9,1,7},
269 {0,4,7}, {0,4,7}, {8,1,7}, {8,1,7},
270 {7,1,6}, {7,1,6}, {7,1,6}, {7,1,6},
271 {6,1,6}, {6,1,6}, {6,1,6}, {6,1,6},
272 {1,2,6}, {1,2,6}, {1,2,6}, {1,2,6},
273 {5,1,6}, {5,1,6}, {5,1,6}, {5,1,6},
274 {13,1,8}, {0,6,8}, {12,1,8}, {11,1,8},
275 {3,2,8}, {1,3,8}, {0,5,8}, {10,1,8},
276 {0,3,5}, {0,3,5}, {0,3,5}, {0,3,5},
277 {0,3,5}, {0,3,5}, {0,3,5}, {0,3,5},
278 {4,1,5}, {4,1,5}, {4,1,5}, {4,1,5},
279 {4,1,5}, {4,1,5}, {4,1,5}, {4,1,5},
280 {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5},
281 {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5}
284 /* Table B-15, DCT coefficients table one,
285 * codes 000001xx ... 11111111
287 mpeg3_DCTtab_t mpeg3_DCTtab0a[252] =
289 {65,0,6}, {65,0,6}, {65,0,6}, {65,0,6}, /* Escape */
290 {7,1,7}, {7,1,7}, {8,1,7}, {8,1,7},
291 {6,1,7}, {6,1,7}, {2,2,7}, {2,2,7},
292 {0,7,6}, {0,7,6}, {0,7,6}, {0,7,6},
293 {0,6,6}, {0,6,6}, {0,6,6}, {0,6,6},
294 {4,1,6}, {4,1,6}, {4,1,6}, {4,1,6},
295 {5,1,6}, {5,1,6}, {5,1,6}, {5,1,6},
296 {1,5,8}, {11,1,8}, {0,11,8}, {0,10,8},
297 {13,1,8}, {12,1,8}, {3,2,8}, {1,4,8},
298 {2,1,5}, {2,1,5}, {2,1,5}, {2,1,5},
299 {2,1,5}, {2,1,5}, {2,1,5}, {2,1,5},
300 {1,2,5}, {1,2,5}, {1,2,5}, {1,2,5},
301 {1,2,5}, {1,2,5}, {1,2,5}, {1,2,5},
302 {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5},
303 {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5},
304 {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
305 {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
306 {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
307 {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
308 {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
309 {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
310 {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
311 {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
312 {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4}, /* EOB */
313 {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4},
314 {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4},
315 {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4},
316 {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
317 {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
318 {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
319 {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
320 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
321 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
322 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
323 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
324 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
325 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
326 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
327 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
328 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
329 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
330 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
331 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
332 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
333 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
334 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
335 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
336 {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
337 {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
338 {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
339 {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
340 {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
341 {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
342 {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
343 {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
344 {0,4,5}, {0,4,5}, {0,4,5}, {0,4,5},
345 {0,4,5}, {0,4,5}, {0,4,5}, {0,4,5},
346 {0,5,5}, {0,5,5}, {0,5,5}, {0,5,5},
347 {0,5,5}, {0,5,5}, {0,5,5}, {0,5,5},
348 {9,1,7}, {9,1,7}, {1,3,7}, {1,3,7},
349 {10,1,7}, {10,1,7}, {0,8,7}, {0,8,7},
350 {0,9,7}, {0,9,7}, {0,12,8}, {0,13,8},
351 {2,3,8}, {4,2,8}, {0,14,8}, {0,15,8}
354 /* Table B-14, DCT coefficients table zero,
355 * codes 0000001000 ... 0000001111
357 mpeg3_DCTtab_t mpeg3_DCTtab1[8] =
359 {16,1,10}, {5,2,10}, {0,7,10}, {2,3,10},
360 {1,4,10}, {15,1,10}, {14,1,10}, {4,2,10}
363 /* Table B-15, DCT coefficients table one,
364 * codes 000000100x ... 000000111x
366 mpeg3_DCTtab_t mpeg3_DCTtab1a[8] =
368 {5,2,9}, {5,2,9}, {14,1,9}, {14,1,9},
369 {2,4,10}, {16,1,10}, {15,1,9}, {15,1,9}
372 /* Table B-14/15, DCT coefficients table zero / one,
373 * codes 000000010000 ... 000000011111
375 mpeg3_DCTtab_t mpeg3_DCTtab2[16] =
377 {0,11,12}, {8,2,12}, {4,3,12}, {0,10,12},
378 {2,4,12}, {7,2,12}, {21,1,12}, {20,1,12},
379 {0,9,12}, {19,1,12}, {18,1,12}, {1,5,12},
380 {3,3,12}, {0,8,12}, {6,2,12}, {17,1,12}
383 /* Table B-14/15, DCT coefficients table zero / one,
384 * codes 0000000010000 ... 0000000011111
386 mpeg3_DCTtab_t mpeg3_DCTtab3[16] =
388 {10,2,13}, {9,2,13}, {5,3,13}, {3,4,13},
389 {2,5,13}, {1,7,13}, {1,6,13}, {0,15,13},
390 {0,14,13}, {0,13,13}, {0,12,13}, {26,1,13},
391 {25,1,13}, {24,1,13}, {23,1,13}, {22,1,13}
394 /* Table B-14/15, DCT coefficients table zero / one,
395 * codes 00000000010000 ... 00000000011111
397 mpeg3_DCTtab_t mpeg3_DCTtab4[16] =
399 {0,31,14}, {0,30,14}, {0,29,14}, {0,28,14},
400 {0,27,14}, {0,26,14}, {0,25,14}, {0,24,14},
401 {0,23,14}, {0,22,14}, {0,21,14}, {0,20,14},
402 {0,19,14}, {0,18,14}, {0,17,14}, {0,16,14}
405 /* Table B-14/15, DCT coefficients table zero / one,
406 * codes 000000000010000 ... 000000000011111
408 mpeg3_DCTtab_t mpeg3_DCTtab5[16] =
410 {0,40,15}, {0,39,15}, {0,38,15}, {0,37,15},
411 {0,36,15}, {0,35,15}, {0,34,15}, {0,33,15},
412 {0,32,15}, {1,14,15}, {1,13,15}, {1,12,15},
413 {1,11,15}, {1,10,15}, {1,9,15}, {1,8,15}
416 /* Table B-14/15, DCT coefficients table zero / one,
417 * codes 0000000000010000 ... 0000000000011111
419 mpeg3_DCTtab_t mpeg3_DCTtab6[16] =
421 {1,18,16}, {1,17,16}, {1,16,16}, {1,15,16},
422 {6,3,16}, {16,2,16}, {15,2,16}, {14,2,16},
423 {13,2,16}, {12,2,16}, {11,2,16}, {31,1,16},
424 {30,1,16}, {29,1,16}, {28,1,16}, {27,1,16}