r123: Merged HEAD and TEST. New stuff shall be committed to HEAD from now on.
[cinelerra_cv/mob.git] / libmpeg3 / video / vlc.c
blob6ba853d64f0fa1afc9632fc43f3a903a6e8f0f0c
1 #include "mpeg3private.h"
2 #include "mpeg3protos.h"
3 #include "vlc.h"
5 /* variable length code tables */
7 /* Table B-3, mb_type in P-pictures, codes 001..1xx */
8 mpeg3_VLCtab_t mpeg3_PMBtab0[8] = {
9 {ERROR,0},
10 {MB_FORWARD,3},
11 {MB_PATTERN,2}, {MB_PATTERN,2},
12 {MB_FORWARD|MB_PATTERN,1}, {MB_FORWARD|MB_PATTERN,1},
13 {MB_FORWARD|MB_PATTERN,1}, {MB_FORWARD|MB_PATTERN,1}
16 /* Table B-3, mb_type in P-pictures, codes 000001..00011x */
17 mpeg3_VLCtab_t mpeg3_PMBtab1[8] = {
18 {ERROR,0},
19 {MB_QUANT|MB_INTRA,6},
20 {MB_QUANT|MB_PATTERN,5}, {MB_QUANT|MB_PATTERN,5},
21 {MB_QUANT|MB_FORWARD|MB_PATTERN,5}, {MB_QUANT|MB_FORWARD|MB_PATTERN,5},
22 {MB_INTRA,5}, {MB_INTRA,5}
25 /* Table B-4, mb_type in B-pictures, codes 0010..11xx */
26 mpeg3_VLCtab_t mpeg3_BMBtab0[16] = {
27 {ERROR,0}, {ERROR,0},
28 {MB_FORWARD,4},
29 {MB_FORWARD|MB_PATTERN,4},
30 {MB_BACKWARD,3}, {MB_BACKWARD,3},
31 {MB_BACKWARD|MB_PATTERN,3}, {MB_BACKWARD|MB_PATTERN,3},
32 {MB_FORWARD|MB_BACKWARD,2}, {MB_FORWARD|MB_BACKWARD,2},
33 {MB_FORWARD|MB_BACKWARD,2}, {MB_FORWARD|MB_BACKWARD,2},
34 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2},
35 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2},
36 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2},
37 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2}
40 /* Table B-4, mb_type in B-pictures, codes 000001..00011x */
41 mpeg3_VLCtab_t mpeg3_BMBtab1[8] = {
42 {ERROR,0},
43 {MB_QUANT|MB_INTRA,6},
44 {MB_QUANT|MB_BACKWARD|MB_PATTERN,6},
45 {MB_QUANT|MB_FORWARD|MB_PATTERN,6},
46 {MB_QUANT|MB_FORWARD|MB_BACKWARD|MB_PATTERN,5},
47 {MB_QUANT|MB_FORWARD|MB_BACKWARD|MB_PATTERN,5},
48 {MB_INTRA,5}, {MB_INTRA,5}
51 /* Table B-5, mb_type in spat. scal. I-pictures, codes 0001..1xxx */
52 mpeg3_VLCtab_t mpeg3_spIMBtab[16] = {
53 {ERROR,0},
54 {MB_CLASS4,4},
55 {MB_QUANT|MB_INTRA,4},
56 {MB_INTRA,4},
57 {MB_CLASS4|MB_QUANT|MB_PATTERN,2}, {MB_CLASS4|MB_QUANT|MB_PATTERN,2},
58 {MB_CLASS4|MB_QUANT|MB_PATTERN,2}, {MB_CLASS4|MB_QUANT|MB_PATTERN,2},
59 {MB_CLASS4|MB_PATTERN,1}, {MB_CLASS4|MB_PATTERN,1},
60 {MB_CLASS4|MB_PATTERN,1}, {MB_CLASS4|MB_PATTERN,1},
61 {MB_CLASS4|MB_PATTERN,1}, {MB_CLASS4|MB_PATTERN,1},
62 {MB_CLASS4|MB_PATTERN,1}, {MB_CLASS4|MB_PATTERN,1}
65 /* Table B-6, mb_type in spat. scal. P-pictures, codes 0010..11xx */
66 mpeg3_VLCtab_t mpeg3_spPMBtab0[16] =
68 {ERROR,0},{ERROR,0},
69 {MB_FORWARD,4},
70 {MB_WEIGHT|MB_FORWARD,4},
71 {MB_QUANT|MB_FORWARD|MB_PATTERN,3}, {MB_QUANT|MB_FORWARD|MB_PATTERN,3},
72 {MB_WEIGHT|MB_FORWARD|MB_PATTERN,3}, {MB_WEIGHT|MB_FORWARD|MB_PATTERN,3},
73 {MB_FORWARD|MB_PATTERN,2}, {MB_FORWARD|MB_PATTERN,2},
74 {MB_FORWARD|MB_PATTERN,2}, {MB_FORWARD|MB_PATTERN,2},
75 {MB_WEIGHT|MB_QUANT|MB_FORWARD|MB_PATTERN,2},
76 {MB_WEIGHT|MB_QUANT|MB_FORWARD|MB_PATTERN,2},
77 {MB_WEIGHT|MB_QUANT|MB_FORWARD|MB_PATTERN,2},
78 {MB_WEIGHT|MB_QUANT|MB_FORWARD|MB_PATTERN,2}
81 /* Table B-6, mb_type in spat. scal. P-pictures, codes 0000010..000111x */
82 mpeg3_VLCtab_t mpeg3_spPMBtab1[16] = {
83 {ERROR,0},{ERROR,0},
84 {MB_CLASS4|MB_QUANT|MB_PATTERN,7},
85 {MB_CLASS4,7},
86 {MB_PATTERN,7},
87 {MB_CLASS4|MB_PATTERN,7},
88 {MB_QUANT|MB_INTRA,7},
89 {MB_INTRA,7},
90 {MB_QUANT|MB_PATTERN,6}, {MB_QUANT|MB_PATTERN,6},
91 {MB_WEIGHT|MB_QUANT|MB_PATTERN,6}, {MB_WEIGHT|MB_QUANT|MB_PATTERN,6},
92 {MB_WEIGHT,6}, {MB_WEIGHT,6},
93 {MB_WEIGHT|MB_PATTERN,6}, {MB_WEIGHT|MB_PATTERN,6}
96 /* Table B-7, mb_type in spat. scal. B-pictures, codes 0010..11xx */
97 mpeg3_VLCtab_t mpeg3_spBMBtab0[14] = {
98 {MB_FORWARD,4},
99 {MB_FORWARD|MB_PATTERN,4},
100 {MB_BACKWARD,3}, {MB_BACKWARD,3},
101 {MB_BACKWARD|MB_PATTERN,3}, {MB_BACKWARD|MB_PATTERN,3},
102 {MB_FORWARD|MB_BACKWARD,2}, {MB_FORWARD|MB_BACKWARD,2},
103 {MB_FORWARD|MB_BACKWARD,2}, {MB_FORWARD|MB_BACKWARD,2},
104 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2},
105 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2},
106 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2},
107 {MB_FORWARD|MB_BACKWARD|MB_PATTERN,2}
110 /* Table B-7, mb_type in spat. scal. B-pictures, codes 0000100..000111x */
111 mpeg3_VLCtab_t mpeg3_spBMBtab1[12] = {
112 {MB_QUANT|MB_FORWARD|MB_PATTERN,7},
113 {MB_QUANT|MB_BACKWARD|MB_PATTERN,7},
114 {MB_INTRA,7},
115 {MB_QUANT|MB_FORWARD|MB_BACKWARD|MB_PATTERN,7},
116 {MB_WEIGHT|MB_FORWARD,6}, {MB_WEIGHT|MB_FORWARD,6},
117 {MB_WEIGHT|MB_FORWARD|MB_PATTERN,6}, {MB_WEIGHT|MB_FORWARD|MB_PATTERN,6},
118 {MB_WEIGHT|MB_BACKWARD,6}, {MB_WEIGHT|MB_BACKWARD,6},
119 {MB_WEIGHT|MB_BACKWARD|MB_PATTERN,6}, {MB_WEIGHT|MB_BACKWARD|MB_PATTERN,6}
122 /* Table B-7, mb_type in spat. scal. B-pictures, codes 00000100x..000001111 */
123 mpeg3_VLCtab_t mpeg3_spBMBtab2[8] = {
124 {MB_QUANT|MB_INTRA,8}, {MB_QUANT|MB_INTRA,8},
125 {MB_WEIGHT|MB_QUANT|MB_FORWARD|MB_PATTERN,8},
126 {MB_WEIGHT|MB_QUANT|MB_FORWARD|MB_PATTERN,8},
127 {MB_WEIGHT|MB_QUANT|MB_BACKWARD|MB_PATTERN,9},
128 {MB_CLASS4|MB_QUANT|MB_PATTERN,9},
129 {MB_CLASS4,9},
130 {MB_CLASS4|MB_PATTERN,9}
133 /* Table B-8, mb_type in spat. scal. B-pictures, codes 001..1xx */
134 mpeg3_VLCtab_t mpeg3_SNRMBtab[8] = {
135 {ERROR,0},
136 {0,3},
137 {MB_QUANT|MB_PATTERN,2}, {MB_QUANT|MB_PATTERN,2},
138 {MB_PATTERN,1}, {MB_PATTERN,1}, {MB_PATTERN,1}, {MB_PATTERN,1}
141 /* Table B-10, motion_code, codes 0001 ... 01xx */
142 mpeg3_VLCtab_t mpeg3_MVtab0[8] =
143 { {ERROR,0}, {3,3}, {2,2}, {2,2}, {1,1}, {1,1}, {1,1}, {1,1}
146 /* Table B-10, motion_code, codes 0000011 ... 000011x */
147 mpeg3_VLCtab_t mpeg3_MVtab1[8] =
148 { {ERROR,0}, {ERROR,0}, {ERROR,0}, {7,6}, {6,6}, {5,6}, {4,5}, {4,5}
151 /* Table B-10, motion_code, codes 0000001100 ... 000001011x */
152 mpeg3_VLCtab_t mpeg3_MVtab2[12] =
153 { {16,9}, {15,9}, {14,9}, {13,9},
154 {12,9}, {11,9}, {10,8}, {10,8},
155 {9,8}, {9,8}, {8,8}, {8,8}
158 /* Table B-9, coded_block_pattern, codes 01000 ... 111xx */
159 mpeg3_VLCtab_t mpeg3_CBPtab0[32] =
160 { {ERROR,0}, {ERROR,0}, {ERROR,0}, {ERROR,0},
161 {ERROR,0}, {ERROR,0}, {ERROR,0}, {ERROR,0},
162 {62,5}, {2,5}, {61,5}, {1,5}, {56,5}, {52,5}, {44,5}, {28,5},
163 {40,5}, {20,5}, {48,5}, {12,5}, {32,4}, {32,4}, {16,4}, {16,4},
164 {8,4}, {8,4}, {4,4}, {4,4}, {60,3}, {60,3}, {60,3}, {60,3}
167 /* Table B-9, coded_block_pattern, codes 00000100 ... 001111xx */
168 mpeg3_VLCtab_t mpeg3_CBPtab1[64] =
169 { {ERROR,0}, {ERROR,0}, {ERROR,0}, {ERROR,0},
170 {58,8}, {54,8}, {46,8}, {30,8},
171 {57,8}, {53,8}, {45,8}, {29,8}, {38,8}, {26,8}, {37,8}, {25,8},
172 {43,8}, {23,8}, {51,8}, {15,8}, {42,8}, {22,8}, {50,8}, {14,8},
173 {41,8}, {21,8}, {49,8}, {13,8}, {35,8}, {19,8}, {11,8}, {7,8},
174 {34,7}, {34,7}, {18,7}, {18,7}, {10,7}, {10,7}, {6,7}, {6,7},
175 {33,7}, {33,7}, {17,7}, {17,7}, {9,7}, {9,7}, {5,7}, {5,7},
176 {63,6}, {63,6}, {63,6}, {63,6}, {3,6}, {3,6}, {3,6}, {3,6},
177 {36,6}, {36,6}, {36,6}, {36,6}, {24,6}, {24,6}, {24,6}, {24,6}
180 /* Table B-9, coded_block_pattern, codes 000000001 ... 000000111 */
181 mpeg3_VLCtab_t mpeg3_CBPtab2[8] =
182 { {ERROR,0}, {0,9}, {39,9}, {27,9}, {59,9}, {55,9}, {47,9}, {31,9}
185 /* Table B-1, macroblock_address_increment, codes 00010 ... 011xx */
186 mpeg3_VLCtab_t mpeg3_MBAtab1[16] =
187 { {ERROR,0}, {ERROR,0}, {7,5}, {6,5}, {5,4}, {5,4}, {4,4}, {4,4},
188 {3,3}, {3,3}, {3,3}, {3,3}, {2,3}, {2,3}, {2,3}, {2,3}
191 /* Table B-1, macroblock_address_increment, codes 00000011000 ... 0000111xxxx */
192 mpeg3_VLCtab_t mpeg3_MBAtab2[104] =
194 {33,11}, {32,11}, {31,11}, {30,11}, {29,11}, {28,11}, {27,11}, {26,11},
195 {25,11}, {24,11}, {23,11}, {22,11}, {21,10}, {21,10}, {20,10}, {20,10},
196 {19,10}, {19,10}, {18,10}, {18,10}, {17,10}, {17,10}, {16,10}, {16,10},
197 {15,8}, {15,8}, {15,8}, {15,8}, {15,8}, {15,8}, {15,8}, {15,8},
198 {14,8}, {14,8}, {14,8}, {14,8}, {14,8}, {14,8}, {14,8}, {14,8},
199 {13,8}, {13,8}, {13,8}, {13,8}, {13,8}, {13,8}, {13,8}, {13,8},
200 {12,8}, {12,8}, {12,8}, {12,8}, {12,8}, {12,8}, {12,8}, {12,8},
201 {11,8}, {11,8}, {11,8}, {11,8}, {11,8}, {11,8}, {11,8}, {11,8},
202 {10,8}, {10,8}, {10,8}, {10,8}, {10,8}, {10,8}, {10,8}, {10,8},
203 {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7},
204 {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7}, {9,7},
205 {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7},
206 {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}, {8,7}
209 /* Table B-12, dct_dc_size_luminance, codes 00xxx ... 11110 */
210 mpeg3_VLCtab_t mpeg3_DClumtab0[32] =
211 { {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
212 {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2},
213 {0, 3}, {0, 3}, {0, 3}, {0, 3}, {3, 3}, {3, 3}, {3, 3}, {3, 3},
214 {4, 3}, {4, 3}, {4, 3}, {4, 3}, {5, 4}, {5, 4}, {6, 5}, {ERROR, 0}
217 /* Table B-12, dct_dc_size_luminance, codes 111110xxx ... 111111111 */
218 mpeg3_VLCtab_t mpeg3_DClumtab1[16] =
219 { {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6}, {7, 6},
220 {8, 7}, {8, 7}, {8, 7}, {8, 7}, {9, 8}, {9, 8}, {10,9}, {11,9}
223 /* Table B-13, dct_dc_size_chrominance, codes 00xxx ... 11110 */
224 mpeg3_VLCtab_t mpeg3_DCchromtab0[32] =
225 { {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2}, {0, 2},
226 {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2}, {1, 2},
227 {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2}, {2, 2},
228 {3, 3}, {3, 3}, {3, 3}, {3, 3}, {4, 4}, {4, 4}, {5, 5}, {ERROR, 0}
231 /* Table B-13, dct_dc_size_chrominance, codes 111110xxxx ... 1111111111 */
232 mpeg3_VLCtab_t mpeg3_DCchromtab1[32] =
233 { {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6},
234 {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6}, {6, 6},
235 {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7}, {7, 7},
236 {8, 8}, {8, 8}, {8, 8}, {8, 8}, {9, 9}, {9, 9}, {10,10}, {11,10}
239 /* Table B-14, DCT coefficients table zero,
240 * codes 0100 ... 1xxx (used for first (DC) coefficient)
242 mpeg3_DCTtab_t mpeg3_DCTtabfirst[12] =
244 {0,2,4}, {2,1,4}, {1,1,3}, {1,1,3},
245 {0,1,1}, {0,1,1}, {0,1,1}, {0,1,1},
246 {0,1,1}, {0,1,1}, {0,1,1}, {0,1,1}
249 /* Table B-14, DCT coefficients table zero,
250 * codes 0100 ... 1xxx (used for all other coefficients)
252 mpeg3_DCTtab_t mpeg3_DCTtabnext[12] =
254 {0,2,4}, {2,1,4}, {1,1,3}, {1,1,3},
255 {64,0,2}, {64,0,2}, {64,0,2}, {64,0,2}, /* EOB */
256 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2}
259 /* Table B-14, DCT coefficients table zero,
260 * codes 000001xx ... 00111xxx
262 mpeg3_DCTtab_t mpeg3_DCTtab0[60] =
264 {65,0,6}, {65,0,6}, {65,0,6}, {65,0,6}, /* Escape */
265 {2,2,7}, {2,2,7}, {9,1,7}, {9,1,7},
266 {0,4,7}, {0,4,7}, {8,1,7}, {8,1,7},
267 {7,1,6}, {7,1,6}, {7,1,6}, {7,1,6},
268 {6,1,6}, {6,1,6}, {6,1,6}, {6,1,6},
269 {1,2,6}, {1,2,6}, {1,2,6}, {1,2,6},
270 {5,1,6}, {5,1,6}, {5,1,6}, {5,1,6},
271 {13,1,8}, {0,6,8}, {12,1,8}, {11,1,8},
272 {3,2,8}, {1,3,8}, {0,5,8}, {10,1,8},
273 {0,3,5}, {0,3,5}, {0,3,5}, {0,3,5},
274 {0,3,5}, {0,3,5}, {0,3,5}, {0,3,5},
275 {4,1,5}, {4,1,5}, {4,1,5}, {4,1,5},
276 {4,1,5}, {4,1,5}, {4,1,5}, {4,1,5},
277 {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5},
278 {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5}
281 /* Table B-15, DCT coefficients table one,
282 * codes 000001xx ... 11111111
284 mpeg3_DCTtab_t mpeg3_DCTtab0a[252] =
286 {65,0,6}, {65,0,6}, {65,0,6}, {65,0,6}, /* Escape */
287 {7,1,7}, {7,1,7}, {8,1,7}, {8,1,7},
288 {6,1,7}, {6,1,7}, {2,2,7}, {2,2,7},
289 {0,7,6}, {0,7,6}, {0,7,6}, {0,7,6},
290 {0,6,6}, {0,6,6}, {0,6,6}, {0,6,6},
291 {4,1,6}, {4,1,6}, {4,1,6}, {4,1,6},
292 {5,1,6}, {5,1,6}, {5,1,6}, {5,1,6},
293 {1,5,8}, {11,1,8}, {0,11,8}, {0,10,8},
294 {13,1,8}, {12,1,8}, {3,2,8}, {1,4,8},
295 {2,1,5}, {2,1,5}, {2,1,5}, {2,1,5},
296 {2,1,5}, {2,1,5}, {2,1,5}, {2,1,5},
297 {1,2,5}, {1,2,5}, {1,2,5}, {1,2,5},
298 {1,2,5}, {1,2,5}, {1,2,5}, {1,2,5},
299 {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5},
300 {3,1,5}, {3,1,5}, {3,1,5}, {3,1,5},
301 {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
302 {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
303 {1,1,3}, {1,1,3}, {1,1,3}, {1,1,3},
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 {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4}, /* EOB */
310 {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4},
311 {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4},
312 {64,0,4}, {64,0,4}, {64,0,4}, {64,0,4},
313 {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
314 {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
315 {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
316 {0,3,4}, {0,3,4}, {0,3,4}, {0,3,4},
317 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
318 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
319 {0,1,2}, {0,1,2}, {0,1,2}, {0,1,2},
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,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
334 {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
335 {0,2,3}, {0,2,3}, {0,2,3}, {0,2,3},
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,4,5}, {0,4,5}, {0,4,5}, {0,4,5},
342 {0,4,5}, {0,4,5}, {0,4,5}, {0,4,5},
343 {0,5,5}, {0,5,5}, {0,5,5}, {0,5,5},
344 {0,5,5}, {0,5,5}, {0,5,5}, {0,5,5},
345 {9,1,7}, {9,1,7}, {1,3,7}, {1,3,7},
346 {10,1,7}, {10,1,7}, {0,8,7}, {0,8,7},
347 {0,9,7}, {0,9,7}, {0,12,8}, {0,13,8},
348 {2,3,8}, {4,2,8}, {0,14,8}, {0,15,8}
351 /* Table B-14, DCT coefficients table zero,
352 * codes 0000001000 ... 0000001111
354 mpeg3_DCTtab_t mpeg3_DCTtab1[8] =
356 {16,1,10}, {5,2,10}, {0,7,10}, {2,3,10},
357 {1,4,10}, {15,1,10}, {14,1,10}, {4,2,10}
360 /* Table B-15, DCT coefficients table one,
361 * codes 000000100x ... 000000111x
363 mpeg3_DCTtab_t mpeg3_DCTtab1a[8] =
365 {5,2,9}, {5,2,9}, {14,1,9}, {14,1,9},
366 {2,4,10}, {16,1,10}, {15,1,9}, {15,1,9}
369 /* Table B-14/15, DCT coefficients table zero / one,
370 * codes 000000010000 ... 000000011111
372 mpeg3_DCTtab_t mpeg3_DCTtab2[16] =
374 {0,11,12}, {8,2,12}, {4,3,12}, {0,10,12},
375 {2,4,12}, {7,2,12}, {21,1,12}, {20,1,12},
376 {0,9,12}, {19,1,12}, {18,1,12}, {1,5,12},
377 {3,3,12}, {0,8,12}, {6,2,12}, {17,1,12}
380 /* Table B-14/15, DCT coefficients table zero / one,
381 * codes 0000000010000 ... 0000000011111
383 mpeg3_DCTtab_t mpeg3_DCTtab3[16] =
385 {10,2,13}, {9,2,13}, {5,3,13}, {3,4,13},
386 {2,5,13}, {1,7,13}, {1,6,13}, {0,15,13},
387 {0,14,13}, {0,13,13}, {0,12,13}, {26,1,13},
388 {25,1,13}, {24,1,13}, {23,1,13}, {22,1,13}
391 /* Table B-14/15, DCT coefficients table zero / one,
392 * codes 00000000010000 ... 00000000011111
394 mpeg3_DCTtab_t mpeg3_DCTtab4[16] =
396 {0,31,14}, {0,30,14}, {0,29,14}, {0,28,14},
397 {0,27,14}, {0,26,14}, {0,25,14}, {0,24,14},
398 {0,23,14}, {0,22,14}, {0,21,14}, {0,20,14},
399 {0,19,14}, {0,18,14}, {0,17,14}, {0,16,14}
402 /* Table B-14/15, DCT coefficients table zero / one,
403 * codes 000000000010000 ... 000000000011111
405 mpeg3_DCTtab_t mpeg3_DCTtab5[16] =
407 {0,40,15}, {0,39,15}, {0,38,15}, {0,37,15},
408 {0,36,15}, {0,35,15}, {0,34,15}, {0,33,15},
409 {0,32,15}, {1,14,15}, {1,13,15}, {1,12,15},
410 {1,11,15}, {1,10,15}, {1,9,15}, {1,8,15}
413 /* Table B-14/15, DCT coefficients table zero / one,
414 * codes 0000000000010000 ... 0000000000011111
416 mpeg3_DCTtab_t mpeg3_DCTtab6[16] =
418 {1,18,16}, {1,17,16}, {1,16,16}, {1,15,16},
419 {6,3,16}, {16,2,16}, {15,2,16}, {14,2,16},
420 {13,2,16}, {12,2,16}, {11,2,16}, {31,1,16},
421 {30,1,16}, {29,1,16}, {28,1,16}, {27,1,16}