1 /********************************************************************
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
5 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
6 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2010 *
9 * by the Xiph.Org Foundation http://www.xiph.org/ *
11 ********************************************************************
13 function: toplevel residue templates for 32/44.1/48kHz uncoupled
16 ********************************************************************/
18 #include "vorbis/codec.h"
21 #include "books/coupled/res_books_51.h"
23 /***** residue backends *********************************************/
25 static const vorbis_info_residue0 _residue_44p_lo={
27 /* 0 1 2 3 4 5 6 7 8 */
30 { 0, 1, 2, 7, 17, 31},
31 { 0, 0, 99, 7, 17, 31},
34 static const vorbis_info_residue0 _residue_44p={
36 /* 0 1 2 3 4 5 6 7 8 */
39 { 0, 1, 1, 2, 7, 17, 31},
40 { 0, 0, 99, 99, 7, 17, 31},
43 static const vorbis_info_residue0 _residue_44p_hi={
45 /* 0 1 2 3 4 5 6 7 8 */
48 { 0, 1, 2, 4, 7, 17, 31},
49 { 0, 1, 2, 4, 7, 17, 31},
52 static const vorbis_info_residue0 _residue_44p_lfe={
54 /* 0 1 2 3 4 5 6 7 8 */
61 static const static_bookblock _resbook_44p_n1={
66 {&_44pn1_p2_0,&_44pn1_p2_1,0},
67 {&_44pn1_p3_0,&_44pn1_p3_1,0},
68 {&_44pn1_p4_0,&_44pn1_p4_1,0},
70 {&_44pn1_p5_0,&_44pn1_p5_1,&_44pn1_p4_1},
71 {&_44pn1_p6_0,&_44pn1_p6_1,&_44pn1_p6_2},
75 static const static_bookblock _resbook_44p_0={
80 {&_44p0_p2_0,&_44p0_p2_1,0},
81 {&_44p0_p3_0,&_44p0_p3_1,0},
82 {&_44p0_p4_0,&_44p0_p4_1,0},
84 {&_44p0_p5_0,&_44p0_p5_1,&_44p0_p4_1},
85 {&_44p0_p6_0,&_44p0_p6_1,&_44p0_p6_2},
89 static const static_bookblock _resbook_44p_1={
94 {&_44p1_p2_0,&_44p1_p2_1,0},
95 {&_44p1_p3_0,&_44p1_p3_1,0},
96 {&_44p1_p4_0,&_44p1_p4_1,0},
98 {&_44p1_p5_0,&_44p1_p5_1,&_44p1_p4_1},
99 {&_44p1_p6_0,&_44p1_p6_1,&_44p1_p6_2},
103 static const static_bookblock _resbook_44p_2={
109 {&_44p2_p3_0,&_44p2_p3_1,0},
110 {&_44p2_p4_0,&_44p2_p4_1,0},
111 {&_44p2_p5_0,&_44p2_p5_1,0},
113 {&_44p2_p6_0,&_44p2_p6_1,&_44p2_p5_1},
114 {&_44p2_p7_0,&_44p2_p7_1,&_44p2_p7_2,&_44p2_p7_3}
117 static const static_bookblock _resbook_44p_3={
123 {&_44p3_p3_0,&_44p3_p3_1,0},
124 {&_44p3_p4_0,&_44p3_p4_1,0},
125 {&_44p3_p5_0,&_44p3_p5_1,0},
127 {&_44p3_p6_0,&_44p3_p6_1,&_44p3_p5_1},
128 {&_44p3_p7_0,&_44p3_p7_1,&_44p3_p7_2,&_44p3_p7_3}
131 static const static_bookblock _resbook_44p_4={
137 {&_44p4_p3_0,&_44p4_p3_1,0},
138 {&_44p4_p4_0,&_44p4_p4_1,0},
139 {&_44p4_p5_0,&_44p4_p5_1,0},
141 {&_44p4_p6_0,&_44p4_p6_1,&_44p4_p5_1},
142 {&_44p4_p7_0,&_44p4_p7_1,&_44p4_p7_2,&_44p4_p7_3}
145 static const static_bookblock _resbook_44p_5={
151 {&_44p5_p3_0,&_44p5_p3_1,0},
152 {&_44p5_p4_0,&_44p5_p4_1,0},
153 {&_44p5_p5_0,&_44p5_p5_1,0},
155 {&_44p5_p6_0,&_44p5_p6_1,&_44p5_p5_1},
156 {&_44p5_p7_0,&_44p5_p7_1,&_44p5_p7_2,&_44p5_p7_3}
159 static const static_bookblock _resbook_44p_6={
165 {&_44p6_p3_0,&_44p6_p3_1,0},
166 {&_44p6_p4_0,&_44p6_p4_1,0},
167 {&_44p6_p5_0,&_44p6_p5_1,0},
169 {&_44p6_p6_0,&_44p6_p6_1,&_44p6_p5_1},
170 {&_44p6_p7_0,&_44p6_p7_1,&_44p6_p7_2,&_44p6_p7_3}
173 static const static_bookblock _resbook_44p_7={
179 {&_44p7_p3_0,&_44p7_p3_1,0},
180 {&_44p7_p4_0,&_44p7_p4_1,0},
181 {&_44p7_p5_0,&_44p7_p5_1,0},
183 {&_44p7_p6_0,&_44p7_p6_1,&_44p7_p5_1},
184 {&_44p7_p7_0,&_44p7_p7_1,&_44p7_p7_2,&_44p7_p7_3}
187 static const static_bookblock _resbook_44p_8={
193 {&_44p8_p3_0,&_44p8_p3_1,0},
194 {&_44p8_p4_0,&_44p8_p4_1,0},
195 {&_44p8_p5_0,&_44p8_p5_1,0},
197 {&_44p8_p6_0,&_44p8_p6_1,&_44p8_p5_1},
198 {&_44p8_p7_0,&_44p8_p7_1,&_44p8_p7_2,&_44p8_p7_3}
201 static const static_bookblock _resbook_44p_9={
207 {&_44p9_p3_0,&_44p9_p3_1,0},
208 {&_44p9_p4_0,&_44p9_p4_1,0},
209 {&_44p9_p5_0,&_44p9_p5_1,0},
211 {&_44p9_p6_0,&_44p9_p6_1,&_44p9_p5_1},
212 {&_44p9_p7_0,&_44p9_p7_1,&_44p9_p7_2,&_44p9_p7_3}
216 static const static_bookblock _resbook_44p_ln1={
218 {&_44pn1_l0_0,&_44pn1_l0_1,0},
219 {&_44pn1_l1_0,&_44pn1_p6_1,&_44pn1_p6_2},
222 static const static_bookblock _resbook_44p_l0={
224 {&_44p0_l0_0,&_44p0_l0_1,0},
225 {&_44p0_l1_0,&_44p0_p6_1,&_44p0_p6_2},
228 static const static_bookblock _resbook_44p_l1={
230 {&_44p1_l0_0,&_44p1_l0_1,0},
231 {&_44p1_l1_0,&_44p1_p6_1,&_44p1_p6_2},
234 static const static_bookblock _resbook_44p_l2={
236 {&_44p2_l0_0,&_44p2_l0_1,0},
237 {&_44p2_l1_0,&_44p2_p7_2,&_44p2_p7_3},
240 static const static_bookblock _resbook_44p_l3={
242 {&_44p3_l0_0,&_44p3_l0_1,0},
243 {&_44p3_l1_0,&_44p3_p7_2,&_44p3_p7_3},
246 static const static_bookblock _resbook_44p_l4={
248 {&_44p4_l0_0,&_44p4_l0_1,0},
249 {&_44p4_l1_0,&_44p4_p7_2,&_44p4_p7_3},
252 static const static_bookblock _resbook_44p_l5={
254 {&_44p5_l0_0,&_44p5_l0_1,0},
255 {&_44p5_l1_0,&_44p5_p7_2,&_44p5_p7_3},
258 static const static_bookblock _resbook_44p_l6={
260 {&_44p6_l0_0,&_44p6_l0_1,0},
261 {&_44p6_l1_0,&_44p6_p7_2,&_44p6_p7_3},
264 static const static_bookblock _resbook_44p_l7={
266 {&_44p7_l0_0,&_44p7_l0_1,0},
267 {&_44p7_l1_0,&_44p7_p7_2,&_44p7_p7_3},
270 static const static_bookblock _resbook_44p_l8={
272 {&_44p8_l0_0,&_44p8_l0_1,0},
273 {&_44p8_l1_0,&_44p8_p7_2,&_44p8_p7_3},
276 static const static_bookblock _resbook_44p_l9={
278 {&_44p9_l0_0,&_44p9_l0_1,0},
279 {&_44p9_l1_0,&_44p9_p7_2,&_44p9_p7_3},
284 static const vorbis_info_mapping0 _map_nominal_51[2]={
285 {2, {0,0,0,0,0,1}, {0,2}, {0,2}, 4,{0,3,0,0},{2,4,1,3}},
286 {2, {0,0,0,0,0,1}, {1,2}, {1,2}, 4,{0,3,0,0},{2,4,1,3}}
288 static const vorbis_info_mapping0 _map_nominal_51u[2]={
289 {2, {0,0,0,0,0,1}, {0,2}, {0,2}, 0,{0},{0}},
290 {2, {0,0,0,0,0,1}, {1,2}, {1,2}, 0,{0},{0}}
293 static const vorbis_residue_template _res_44p51_n1[]={
294 {2,0,30, &_residue_44p_lo,
295 &_huff_book__44pn1_short,&_huff_book__44pn1_short,
296 &_resbook_44p_n1,&_resbook_44p_n1},
298 {2,0,30, &_residue_44p_lo,
299 &_huff_book__44pn1_long,&_huff_book__44pn1_long,
300 &_resbook_44p_n1,&_resbook_44p_n1},
302 {1,2,6, &_residue_44p_lfe,
303 &_huff_book__44pn1_lfe,&_huff_book__44pn1_lfe,
304 &_resbook_44p_ln1,&_resbook_44p_ln1}
306 static const vorbis_residue_template _res_44p51_0[]={
307 {2,0,15, &_residue_44p_lo,
308 &_huff_book__44p0_short,&_huff_book__44p0_short,
309 &_resbook_44p_0,&_resbook_44p_0},
311 {2,0,30, &_residue_44p_lo,
312 &_huff_book__44p0_long,&_huff_book__44p0_long,
313 &_resbook_44p_0,&_resbook_44p_0},
315 {1,2,6, &_residue_44p_lfe,
316 &_huff_book__44p0_lfe,&_huff_book__44p0_lfe,
317 &_resbook_44p_l0,&_resbook_44p_l0}
319 static const vorbis_residue_template _res_44p51_1[]={
320 {2,0,15, &_residue_44p_lo,
321 &_huff_book__44p1_short,&_huff_book__44p1_short,
322 &_resbook_44p_1,&_resbook_44p_1},
324 {2,0,30, &_residue_44p_lo,
325 &_huff_book__44p1_long,&_huff_book__44p1_long,
326 &_resbook_44p_1,&_resbook_44p_1},
328 {1,2,6, &_residue_44p_lfe,
329 &_huff_book__44p1_lfe,&_huff_book__44p1_lfe,
330 &_resbook_44p_l1,&_resbook_44p_l1}
332 static const vorbis_residue_template _res_44p51_2[]={
333 {2,0,15, &_residue_44p,
334 &_huff_book__44p2_short,&_huff_book__44p2_short,
335 &_resbook_44p_2,&_resbook_44p_2},
337 {2,0,30, &_residue_44p,
338 &_huff_book__44p2_long,&_huff_book__44p2_long,
339 &_resbook_44p_2,&_resbook_44p_2},
341 {1,2,6, &_residue_44p_lfe,
342 &_huff_book__44p2_lfe,&_huff_book__44p2_lfe,
343 &_resbook_44p_l2,&_resbook_44p_l2}
345 static const vorbis_residue_template _res_44p51_3[]={
346 {2,0,15, &_residue_44p,
347 &_huff_book__44p3_short,&_huff_book__44p3_short,
348 &_resbook_44p_3,&_resbook_44p_3},
350 {2,0,30, &_residue_44p,
351 &_huff_book__44p3_long,&_huff_book__44p3_long,
352 &_resbook_44p_3,&_resbook_44p_3},
354 {1,2,6, &_residue_44p_lfe,
355 &_huff_book__44p3_lfe,&_huff_book__44p3_lfe,
356 &_resbook_44p_l3,&_resbook_44p_l3}
358 static const vorbis_residue_template _res_44p51_4[]={
359 {2,0,15, &_residue_44p,
360 &_huff_book__44p4_short,&_huff_book__44p4_short,
361 &_resbook_44p_4,&_resbook_44p_4},
363 {2,0,30, &_residue_44p,
364 &_huff_book__44p4_long,&_huff_book__44p4_long,
365 &_resbook_44p_4,&_resbook_44p_4},
367 {1,2,6, &_residue_44p_lfe,
368 &_huff_book__44p4_lfe,&_huff_book__44p4_lfe,
369 &_resbook_44p_l4,&_resbook_44p_l4}
371 static const vorbis_residue_template _res_44p51_5[]={
372 {2,0,15, &_residue_44p_hi,
373 &_huff_book__44p5_short,&_huff_book__44p5_short,
374 &_resbook_44p_5,&_resbook_44p_5},
376 {2,0,30, &_residue_44p_hi,
377 &_huff_book__44p5_long,&_huff_book__44p5_long,
378 &_resbook_44p_5,&_resbook_44p_5},
380 {1,2,6, &_residue_44p_lfe,
381 &_huff_book__44p5_lfe,&_huff_book__44p5_lfe,
382 &_resbook_44p_l5,&_resbook_44p_l5}
384 static const vorbis_residue_template _res_44p51_6[]={
385 {2,0,15, &_residue_44p_hi,
386 &_huff_book__44p6_short,&_huff_book__44p6_short,
387 &_resbook_44p_6,&_resbook_44p_6},
389 {2,0,30, &_residue_44p_hi,
390 &_huff_book__44p6_long,&_huff_book__44p6_long,
391 &_resbook_44p_6,&_resbook_44p_6},
393 {1,2,6, &_residue_44p_lfe,
394 &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
395 &_resbook_44p_l6,&_resbook_44p_l6}
399 static const vorbis_residue_template _res_44p51_7[]={
400 {2,0,15, &_residue_44p_hi,
401 &_huff_book__44p7_short,&_huff_book__44p7_short,
402 &_resbook_44p_7,&_resbook_44p_7},
404 {2,0,30, &_residue_44p_hi,
405 &_huff_book__44p7_long,&_huff_book__44p7_long,
406 &_resbook_44p_7,&_resbook_44p_7},
408 {1,2,6, &_residue_44p_lfe,
409 &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
410 &_resbook_44p_l6,&_resbook_44p_l6}
412 static const vorbis_residue_template _res_44p51_8[]={
413 {2,0,15, &_residue_44p_hi,
414 &_huff_book__44p8_short,&_huff_book__44p8_short,
415 &_resbook_44p_8,&_resbook_44p_8},
417 {2,0,30, &_residue_44p_hi,
418 &_huff_book__44p8_long,&_huff_book__44p8_long,
419 &_resbook_44p_8,&_resbook_44p_8},
421 {1,2,6, &_residue_44p_lfe,
422 &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
423 &_resbook_44p_l6,&_resbook_44p_l6}
425 static const vorbis_residue_template _res_44p51_9[]={
426 {2,0,15, &_residue_44p_hi,
427 &_huff_book__44p9_short,&_huff_book__44p9_short,
428 &_resbook_44p_9,&_resbook_44p_9},
430 {2,0,30, &_residue_44p_hi,
431 &_huff_book__44p9_long,&_huff_book__44p9_long,
432 &_resbook_44p_9,&_resbook_44p_9},
434 {1,2,6, &_residue_44p_lfe,
435 &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
436 &_resbook_44p_l6,&_resbook_44p_l6}
439 static const vorbis_mapping_template _mapres_template_44_51[]={
440 { _map_nominal_51, _res_44p51_n1 }, /* -1 */
441 { _map_nominal_51, _res_44p51_0 }, /* 0 */
442 { _map_nominal_51, _res_44p51_1 }, /* 1 */
443 { _map_nominal_51, _res_44p51_2 }, /* 2 */
444 { _map_nominal_51, _res_44p51_3 }, /* 3 */
445 { _map_nominal_51, _res_44p51_4 }, /* 4 */
446 { _map_nominal_51u, _res_44p51_5 }, /* 5 */
447 { _map_nominal_51u, _res_44p51_6 }, /* 6 */
448 { _map_nominal_51u, _res_44p51_7 }, /* 7 */
449 { _map_nominal_51u, _res_44p51_8 }, /* 8 */
450 { _map_nominal_51u, _res_44p51_9 }, /* 9 */