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
15 ********************************************************************/
17 #include "vorbis/codec.h"
20 #include "books/coupled/res_books_51.h"
22 /***** residue backends *********************************************/
24 static const vorbis_info_residue0 _residue_44p_lo={
26 /* 0 1 2 3 4 5 6 7 8 */
29 { 0, 1, 2, 7, 17, 31},
30 { 0, 0, 99, 7, 17, 31},
33 static const vorbis_info_residue0 _residue_44p={
35 /* 0 1 2 3 4 5 6 7 8 */
38 { 0, 1, 1, 2, 7, 17, 31},
39 { 0, 0, 99, 99, 7, 17, 31},
42 static const vorbis_info_residue0 _residue_44p_hi={
44 /* 0 1 2 3 4 5 6 7 8 */
47 { 0, 1, 2, 4, 7, 17, 31},
48 { 0, 1, 2, 4, 7, 17, 31},
51 static const vorbis_info_residue0 _residue_44p_lfe={
53 /* 0 1 2 3 4 5 6 7 8 */
60 static const static_bookblock _resbook_44p_n1={
65 {&_44pn1_p2_0,&_44pn1_p2_1,0},
66 {&_44pn1_p3_0,&_44pn1_p3_1,0},
67 {&_44pn1_p4_0,&_44pn1_p4_1,0},
69 {&_44pn1_p5_0,&_44pn1_p5_1,&_44pn1_p4_1},
70 {&_44pn1_p6_0,&_44pn1_p6_1,&_44pn1_p6_2},
74 static const static_bookblock _resbook_44p_0={
79 {&_44p0_p2_0,&_44p0_p2_1,0},
80 {&_44p0_p3_0,&_44p0_p3_1,0},
81 {&_44p0_p4_0,&_44p0_p4_1,0},
83 {&_44p0_p5_0,&_44p0_p5_1,&_44p0_p4_1},
84 {&_44p0_p6_0,&_44p0_p6_1,&_44p0_p6_2},
88 static const static_bookblock _resbook_44p_1={
93 {&_44p1_p2_0,&_44p1_p2_1,0},
94 {&_44p1_p3_0,&_44p1_p3_1,0},
95 {&_44p1_p4_0,&_44p1_p4_1,0},
97 {&_44p1_p5_0,&_44p1_p5_1,&_44p1_p4_1},
98 {&_44p1_p6_0,&_44p1_p6_1,&_44p1_p6_2},
102 static const static_bookblock _resbook_44p_2={
108 {&_44p2_p3_0,&_44p2_p3_1,0},
109 {&_44p2_p4_0,&_44p2_p4_1,0},
110 {&_44p2_p5_0,&_44p2_p5_1,0},
112 {&_44p2_p6_0,&_44p2_p6_1,&_44p2_p5_1},
113 {&_44p2_p7_0,&_44p2_p7_1,&_44p2_p7_2,&_44p2_p7_3}
116 static const static_bookblock _resbook_44p_3={
122 {&_44p3_p3_0,&_44p3_p3_1,0},
123 {&_44p3_p4_0,&_44p3_p4_1,0},
124 {&_44p3_p5_0,&_44p3_p5_1,0},
126 {&_44p3_p6_0,&_44p3_p6_1,&_44p3_p5_1},
127 {&_44p3_p7_0,&_44p3_p7_1,&_44p3_p7_2,&_44p3_p7_3}
130 static const static_bookblock _resbook_44p_4={
136 {&_44p4_p3_0,&_44p4_p3_1,0},
137 {&_44p4_p4_0,&_44p4_p4_1,0},
138 {&_44p4_p5_0,&_44p4_p5_1,0},
140 {&_44p4_p6_0,&_44p4_p6_1,&_44p4_p5_1},
141 {&_44p4_p7_0,&_44p4_p7_1,&_44p4_p7_2,&_44p4_p7_3}
144 static const static_bookblock _resbook_44p_5={
150 {&_44p5_p3_0,&_44p5_p3_1,0},
151 {&_44p5_p4_0,&_44p5_p4_1,0},
152 {&_44p5_p5_0,&_44p5_p5_1,0},
154 {&_44p5_p6_0,&_44p5_p6_1,&_44p5_p5_1},
155 {&_44p5_p7_0,&_44p5_p7_1,&_44p5_p7_2,&_44p5_p7_3}
158 static const static_bookblock _resbook_44p_6={
164 {&_44p6_p3_0,&_44p6_p3_1,0},
165 {&_44p6_p4_0,&_44p6_p4_1,0},
166 {&_44p6_p5_0,&_44p6_p5_1,0},
168 {&_44p6_p6_0,&_44p6_p6_1,&_44p6_p5_1},
169 {&_44p6_p7_0,&_44p6_p7_1,&_44p6_p7_2,&_44p6_p7_3}
172 static const static_bookblock _resbook_44p_7={
178 {&_44p7_p3_0,&_44p7_p3_1,0},
179 {&_44p7_p4_0,&_44p7_p4_1,0},
180 {&_44p7_p5_0,&_44p7_p5_1,0},
182 {&_44p7_p6_0,&_44p7_p6_1,&_44p7_p5_1},
183 {&_44p7_p7_0,&_44p7_p7_1,&_44p7_p7_2,&_44p7_p7_3}
186 static const static_bookblock _resbook_44p_8={
192 {&_44p8_p3_0,&_44p8_p3_1,0},
193 {&_44p8_p4_0,&_44p8_p4_1,0},
194 {&_44p8_p5_0,&_44p8_p5_1,0},
196 {&_44p8_p6_0,&_44p8_p6_1,&_44p8_p5_1},
197 {&_44p8_p7_0,&_44p8_p7_1,&_44p8_p7_2,&_44p8_p7_3}
200 static const static_bookblock _resbook_44p_9={
206 {&_44p9_p3_0,&_44p9_p3_1,0},
207 {&_44p9_p4_0,&_44p9_p4_1,0},
208 {&_44p9_p5_0,&_44p9_p5_1,0},
210 {&_44p9_p6_0,&_44p9_p6_1,&_44p9_p5_1},
211 {&_44p9_p7_0,&_44p9_p7_1,&_44p9_p7_2,&_44p9_p7_3}
215 static const static_bookblock _resbook_44p_ln1={
217 {&_44pn1_l0_0,&_44pn1_l0_1,0},
218 {&_44pn1_l1_0,&_44pn1_p6_1,&_44pn1_p6_2},
221 static const static_bookblock _resbook_44p_l0={
223 {&_44p0_l0_0,&_44p0_l0_1,0},
224 {&_44p0_l1_0,&_44p0_p6_1,&_44p0_p6_2},
227 static const static_bookblock _resbook_44p_l1={
229 {&_44p1_l0_0,&_44p1_l0_1,0},
230 {&_44p1_l1_0,&_44p1_p6_1,&_44p1_p6_2},
233 static const static_bookblock _resbook_44p_l2={
235 {&_44p2_l0_0,&_44p2_l0_1,0},
236 {&_44p2_l1_0,&_44p2_p7_2,&_44p2_p7_3},
239 static const static_bookblock _resbook_44p_l3={
241 {&_44p3_l0_0,&_44p3_l0_1,0},
242 {&_44p3_l1_0,&_44p3_p7_2,&_44p3_p7_3},
245 static const static_bookblock _resbook_44p_l4={
247 {&_44p4_l0_0,&_44p4_l0_1,0},
248 {&_44p4_l1_0,&_44p4_p7_2,&_44p4_p7_3},
251 static const static_bookblock _resbook_44p_l5={
253 {&_44p5_l0_0,&_44p5_l0_1,0},
254 {&_44p5_l1_0,&_44p5_p7_2,&_44p5_p7_3},
257 static const static_bookblock _resbook_44p_l6={
259 {&_44p6_l0_0,&_44p6_l0_1,0},
260 {&_44p6_l1_0,&_44p6_p7_2,&_44p6_p7_3},
263 static const static_bookblock _resbook_44p_l7={
265 {&_44p7_l0_0,&_44p7_l0_1,0},
266 {&_44p7_l1_0,&_44p7_p7_2,&_44p7_p7_3},
269 static const static_bookblock _resbook_44p_l8={
271 {&_44p8_l0_0,&_44p8_l0_1,0},
272 {&_44p8_l1_0,&_44p8_p7_2,&_44p8_p7_3},
275 static const static_bookblock _resbook_44p_l9={
277 {&_44p9_l0_0,&_44p9_l0_1,0},
278 {&_44p9_l1_0,&_44p9_p7_2,&_44p9_p7_3},
283 static const vorbis_info_mapping0 _map_nominal_51[2]={
284 {2, {0,0,0,0,0,1}, {0,2}, {0,2}, 4,{0,3,0,0},{2,4,1,3}},
285 {2, {0,0,0,0,0,1}, {1,2}, {1,2}, 4,{0,3,0,0},{2,4,1,3}}
287 static const vorbis_info_mapping0 _map_nominal_51u[2]={
288 {2, {0,0,0,0,0,1}, {0,2}, {0,2}, 0,{0},{0}},
289 {2, {0,0,0,0,0,1}, {1,2}, {1,2}, 0,{0},{0}}
292 static const vorbis_residue_template _res_44p51_n1[]={
293 {2,0,30, &_residue_44p_lo,
294 &_huff_book__44pn1_short,&_huff_book__44pn1_short,
295 &_resbook_44p_n1,&_resbook_44p_n1},
297 {2,0,30, &_residue_44p_lo,
298 &_huff_book__44pn1_long,&_huff_book__44pn1_long,
299 &_resbook_44p_n1,&_resbook_44p_n1},
301 {1,2,6, &_residue_44p_lfe,
302 &_huff_book__44pn1_lfe,&_huff_book__44pn1_lfe,
303 &_resbook_44p_ln1,&_resbook_44p_ln1}
305 static const vorbis_residue_template _res_44p51_0[]={
306 {2,0,15, &_residue_44p_lo,
307 &_huff_book__44p0_short,&_huff_book__44p0_short,
308 &_resbook_44p_0,&_resbook_44p_0},
310 {2,0,30, &_residue_44p_lo,
311 &_huff_book__44p0_long,&_huff_book__44p0_long,
312 &_resbook_44p_0,&_resbook_44p_0},
314 {1,2,6, &_residue_44p_lfe,
315 &_huff_book__44p0_lfe,&_huff_book__44p0_lfe,
316 &_resbook_44p_l0,&_resbook_44p_l0}
318 static const vorbis_residue_template _res_44p51_1[]={
319 {2,0,15, &_residue_44p_lo,
320 &_huff_book__44p1_short,&_huff_book__44p1_short,
321 &_resbook_44p_1,&_resbook_44p_1},
323 {2,0,30, &_residue_44p_lo,
324 &_huff_book__44p1_long,&_huff_book__44p1_long,
325 &_resbook_44p_1,&_resbook_44p_1},
327 {1,2,6, &_residue_44p_lfe,
328 &_huff_book__44p1_lfe,&_huff_book__44p1_lfe,
329 &_resbook_44p_l1,&_resbook_44p_l1}
331 static const vorbis_residue_template _res_44p51_2[]={
332 {2,0,15, &_residue_44p,
333 &_huff_book__44p2_short,&_huff_book__44p2_short,
334 &_resbook_44p_2,&_resbook_44p_2},
336 {2,0,30, &_residue_44p,
337 &_huff_book__44p2_long,&_huff_book__44p2_long,
338 &_resbook_44p_2,&_resbook_44p_2},
340 {1,2,6, &_residue_44p_lfe,
341 &_huff_book__44p2_lfe,&_huff_book__44p2_lfe,
342 &_resbook_44p_l2,&_resbook_44p_l2}
344 static const vorbis_residue_template _res_44p51_3[]={
345 {2,0,15, &_residue_44p,
346 &_huff_book__44p3_short,&_huff_book__44p3_short,
347 &_resbook_44p_3,&_resbook_44p_3},
349 {2,0,30, &_residue_44p,
350 &_huff_book__44p3_long,&_huff_book__44p3_long,
351 &_resbook_44p_3,&_resbook_44p_3},
353 {1,2,6, &_residue_44p_lfe,
354 &_huff_book__44p3_lfe,&_huff_book__44p3_lfe,
355 &_resbook_44p_l3,&_resbook_44p_l3}
357 static const vorbis_residue_template _res_44p51_4[]={
358 {2,0,15, &_residue_44p,
359 &_huff_book__44p4_short,&_huff_book__44p4_short,
360 &_resbook_44p_4,&_resbook_44p_4},
362 {2,0,30, &_residue_44p,
363 &_huff_book__44p4_long,&_huff_book__44p4_long,
364 &_resbook_44p_4,&_resbook_44p_4},
366 {1,2,6, &_residue_44p_lfe,
367 &_huff_book__44p4_lfe,&_huff_book__44p4_lfe,
368 &_resbook_44p_l4,&_resbook_44p_l4}
370 static const vorbis_residue_template _res_44p51_5[]={
371 {2,0,15, &_residue_44p_hi,
372 &_huff_book__44p5_short,&_huff_book__44p5_short,
373 &_resbook_44p_5,&_resbook_44p_5},
375 {2,0,30, &_residue_44p_hi,
376 &_huff_book__44p5_long,&_huff_book__44p5_long,
377 &_resbook_44p_5,&_resbook_44p_5},
379 {1,2,6, &_residue_44p_lfe,
380 &_huff_book__44p5_lfe,&_huff_book__44p5_lfe,
381 &_resbook_44p_l5,&_resbook_44p_l5}
383 static const vorbis_residue_template _res_44p51_6[]={
384 {2,0,15, &_residue_44p_hi,
385 &_huff_book__44p6_short,&_huff_book__44p6_short,
386 &_resbook_44p_6,&_resbook_44p_6},
388 {2,0,30, &_residue_44p_hi,
389 &_huff_book__44p6_long,&_huff_book__44p6_long,
390 &_resbook_44p_6,&_resbook_44p_6},
392 {1,2,6, &_residue_44p_lfe,
393 &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
394 &_resbook_44p_l6,&_resbook_44p_l6}
398 static const vorbis_residue_template _res_44p51_7[]={
399 {2,0,15, &_residue_44p_hi,
400 &_huff_book__44p7_short,&_huff_book__44p7_short,
401 &_resbook_44p_7,&_resbook_44p_7},
403 {2,0,30, &_residue_44p_hi,
404 &_huff_book__44p7_long,&_huff_book__44p7_long,
405 &_resbook_44p_7,&_resbook_44p_7},
407 {1,2,6, &_residue_44p_lfe,
408 &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
409 &_resbook_44p_l6,&_resbook_44p_l6}
411 static const vorbis_residue_template _res_44p51_8[]={
412 {2,0,15, &_residue_44p_hi,
413 &_huff_book__44p8_short,&_huff_book__44p8_short,
414 &_resbook_44p_8,&_resbook_44p_8},
416 {2,0,30, &_residue_44p_hi,
417 &_huff_book__44p8_long,&_huff_book__44p8_long,
418 &_resbook_44p_8,&_resbook_44p_8},
420 {1,2,6, &_residue_44p_lfe,
421 &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
422 &_resbook_44p_l6,&_resbook_44p_l6}
424 static const vorbis_residue_template _res_44p51_9[]={
425 {2,0,15, &_residue_44p_hi,
426 &_huff_book__44p9_short,&_huff_book__44p9_short,
427 &_resbook_44p_9,&_resbook_44p_9},
429 {2,0,30, &_residue_44p_hi,
430 &_huff_book__44p9_long,&_huff_book__44p9_long,
431 &_resbook_44p_9,&_resbook_44p_9},
433 {1,2,6, &_residue_44p_lfe,
434 &_huff_book__44p6_lfe,&_huff_book__44p6_lfe,
435 &_resbook_44p_l6,&_resbook_44p_l6}
438 static const vorbis_mapping_template _mapres_template_44_51[]={
439 { _map_nominal_51, _res_44p51_n1 }, /* -1 */
440 { _map_nominal_51, _res_44p51_0 }, /* 0 */
441 { _map_nominal_51, _res_44p51_1 }, /* 1 */
442 { _map_nominal_51, _res_44p51_2 }, /* 2 */
443 { _map_nominal_51, _res_44p51_3 }, /* 3 */
444 { _map_nominal_51, _res_44p51_4 }, /* 4 */
445 { _map_nominal_51u, _res_44p51_5 }, /* 5 */
446 { _map_nominal_51u, _res_44p51_6 }, /* 6 */
447 { _map_nominal_51u, _res_44p51_7 }, /* 7 */
448 { _map_nominal_51u, _res_44p51_8 }, /* 8 */
449 { _map_nominal_51u, _res_44p51_9 }, /* 9 */