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-2007 *
9 * by the Xiph.Org Foundation https://xiph.org/ *
11 ********************************************************************
13 function: toplevel residue templates for 32/44.1/48kHz uncoupled
15 ********************************************************************/
17 #include "vorbis/codec.h"
19 #include "books/uncoupled/res_books_uncoupled.h"
21 /***** residue backends *********************************************/
24 static const vorbis_info_residue0 _residue_44_low_un={
28 { 0, 1, 1, 2, 2, 4, 28},
29 { -1, 25, -1, 45, -1, -1, -1}
32 static const vorbis_info_residue0 _residue_44_mid_un={
34 /* 0 1 2 3 4 5 6 7 8 9 */
37 { 0, 1, 1, 2, 2, 4, 4, 16, 60},
38 { -1, 30, -1, 50, -1, 80, -1, -1, -1}
41 static const vorbis_info_residue0 _residue_44_hi_un={
43 /* 0 1 2 3 4 5 6 7 8 9 */
46 { 0, 1, 2, 4, 8, 16, 32, 71,157},
47 { -1, -1, -1, -1, -1, -1, -1, -1, -1}
50 /* mapping conventions:
51 only one submap (this would change for efficient 5.1 support for example)*/
52 /* Four psychoacoustic profiles are used, one for each blocktype */
53 static const vorbis_info_mapping0 _map_nominal_u[2]={
54 {1, {0,0,0,0,0,0}, {0}, {0}, 0,{0},{0}},
55 {1, {0,0,0,0,0,0}, {1}, {1}, 0,{0},{0}}
58 static const static_bookblock _resbook_44u_n1={
66 {&_44un1__p6_0,&_44un1__p6_1},
67 {&_44un1__p7_0,&_44un1__p7_1,&_44un1__p7_2}
70 static const static_bookblock _resbook_44u_0={
78 {&_44u0__p6_0,&_44u0__p6_1},
79 {&_44u0__p7_0,&_44u0__p7_1,&_44u0__p7_2}
82 static const static_bookblock _resbook_44u_1={
90 {&_44u1__p6_0,&_44u1__p6_1},
91 {&_44u1__p7_0,&_44u1__p7_1,&_44u1__p7_2}
94 static const static_bookblock _resbook_44u_2={
102 {&_44u2__p6_0,&_44u2__p6_1},
103 {&_44u2__p7_0,&_44u2__p7_1,&_44u2__p7_2}
106 static const static_bookblock _resbook_44u_3={
114 {&_44u3__p6_0,&_44u3__p6_1},
115 {&_44u3__p7_0,&_44u3__p7_1,&_44u3__p7_2}
118 static const static_bookblock _resbook_44u_4={
126 {&_44u4__p6_0,&_44u4__p6_1},
127 {&_44u4__p7_0,&_44u4__p7_1,&_44u4__p7_2}
130 static const static_bookblock _resbook_44u_5={
139 {&_44u5__p7_0,&_44u5__p7_1},
140 {&_44u5__p8_0,&_44u5__p8_1},
141 {&_44u5__p9_0,&_44u5__p9_1,&_44u5__p9_2}
144 static const static_bookblock _resbook_44u_6={
153 {&_44u6__p7_0,&_44u6__p7_1},
154 {&_44u6__p8_0,&_44u6__p8_1},
155 {&_44u6__p9_0,&_44u6__p9_1,&_44u6__p9_2}
158 static const static_bookblock _resbook_44u_7={
167 {&_44u7__p7_0,&_44u7__p7_1},
168 {&_44u7__p8_0,&_44u7__p8_1},
169 {&_44u7__p9_0,&_44u7__p9_1,&_44u7__p9_2}
172 static const static_bookblock _resbook_44u_8={
179 {&_44u8_p5_0,&_44u8_p5_1},
180 {&_44u8_p6_0,&_44u8_p6_1},
181 {&_44u8_p7_0,&_44u8_p7_1},
182 {&_44u8_p8_0,&_44u8_p8_1},
183 {&_44u8_p9_0,&_44u8_p9_1,&_44u8_p9_2}
186 static const static_bookblock _resbook_44u_9={
193 {&_44u9_p5_0,&_44u9_p5_1},
194 {&_44u9_p6_0,&_44u9_p6_1},
195 {&_44u9_p7_0,&_44u9_p7_1},
196 {&_44u9_p8_0,&_44u9_p8_1},
197 {&_44u9_p9_0,&_44u9_p9_1,&_44u9_p9_2}
201 static const vorbis_residue_template _res_44u_n1[]={
202 {1,0,32, &_residue_44_low_un,
203 &_huff_book__44un1__short,&_huff_book__44un1__short,
204 &_resbook_44u_n1,&_resbook_44u_n1},
206 {1,0,32, &_residue_44_low_un,
207 &_huff_book__44un1__long,&_huff_book__44un1__long,
208 &_resbook_44u_n1,&_resbook_44u_n1}
210 static const vorbis_residue_template _res_44u_0[]={
211 {1,0,16, &_residue_44_low_un,
212 &_huff_book__44u0__short,&_huff_book__44u0__short,
213 &_resbook_44u_0,&_resbook_44u_0},
215 {1,0,32, &_residue_44_low_un,
216 &_huff_book__44u0__long,&_huff_book__44u0__long,
217 &_resbook_44u_0,&_resbook_44u_0}
219 static const vorbis_residue_template _res_44u_1[]={
220 {1,0,16, &_residue_44_low_un,
221 &_huff_book__44u1__short,&_huff_book__44u1__short,
222 &_resbook_44u_1,&_resbook_44u_1},
224 {1,0,32, &_residue_44_low_un,
225 &_huff_book__44u1__long,&_huff_book__44u1__long,
226 &_resbook_44u_1,&_resbook_44u_1}
228 static const vorbis_residue_template _res_44u_2[]={
229 {1,0,16, &_residue_44_low_un,
230 &_huff_book__44u2__short,&_huff_book__44u2__short,
231 &_resbook_44u_2,&_resbook_44u_2},
233 {1,0,32, &_residue_44_low_un,
234 &_huff_book__44u2__long,&_huff_book__44u2__long,
235 &_resbook_44u_2,&_resbook_44u_2}
237 static const vorbis_residue_template _res_44u_3[]={
238 {1,0,16, &_residue_44_low_un,
239 &_huff_book__44u3__short,&_huff_book__44u3__short,
240 &_resbook_44u_3,&_resbook_44u_3},
242 {1,0,32, &_residue_44_low_un,
243 &_huff_book__44u3__long,&_huff_book__44u3__long,
244 &_resbook_44u_3,&_resbook_44u_3}
246 static const vorbis_residue_template _res_44u_4[]={
247 {1,0,16, &_residue_44_low_un,
248 &_huff_book__44u4__short,&_huff_book__44u4__short,
249 &_resbook_44u_4,&_resbook_44u_4},
251 {1,0,32, &_residue_44_low_un,
252 &_huff_book__44u4__long,&_huff_book__44u4__long,
253 &_resbook_44u_4,&_resbook_44u_4}
256 static const vorbis_residue_template _res_44u_5[]={
257 {1,0,16, &_residue_44_mid_un,
258 &_huff_book__44u5__short,&_huff_book__44u5__short,
259 &_resbook_44u_5,&_resbook_44u_5},
261 {1,0,32, &_residue_44_mid_un,
262 &_huff_book__44u5__long,&_huff_book__44u5__long,
263 &_resbook_44u_5,&_resbook_44u_5}
266 static const vorbis_residue_template _res_44u_6[]={
267 {1,0,16, &_residue_44_mid_un,
268 &_huff_book__44u6__short,&_huff_book__44u6__short,
269 &_resbook_44u_6,&_resbook_44u_6},
271 {1,0,32, &_residue_44_mid_un,
272 &_huff_book__44u6__long,&_huff_book__44u6__long,
273 &_resbook_44u_6,&_resbook_44u_6}
276 static const vorbis_residue_template _res_44u_7[]={
277 {1,0,16, &_residue_44_mid_un,
278 &_huff_book__44u7__short,&_huff_book__44u7__short,
279 &_resbook_44u_7,&_resbook_44u_7},
281 {1,0,32, &_residue_44_mid_un,
282 &_huff_book__44u7__long,&_huff_book__44u7__long,
283 &_resbook_44u_7,&_resbook_44u_7}
286 static const vorbis_residue_template _res_44u_8[]={
287 {1,0,16, &_residue_44_hi_un,
288 &_huff_book__44u8__short,&_huff_book__44u8__short,
289 &_resbook_44u_8,&_resbook_44u_8},
291 {1,0,32, &_residue_44_hi_un,
292 &_huff_book__44u8__long,&_huff_book__44u8__long,
293 &_resbook_44u_8,&_resbook_44u_8}
295 static const vorbis_residue_template _res_44u_9[]={
296 {1,0,16, &_residue_44_hi_un,
297 &_huff_book__44u9__short,&_huff_book__44u9__short,
298 &_resbook_44u_9,&_resbook_44u_9},
300 {1,0,32, &_residue_44_hi_un,
301 &_huff_book__44u9__long,&_huff_book__44u9__long,
302 &_resbook_44u_9,&_resbook_44u_9}
305 static const vorbis_mapping_template _mapres_template_44_uncoupled[]={
306 { _map_nominal_u, _res_44u_n1 }, /* -1 */
307 { _map_nominal_u, _res_44u_0 }, /* 0 */
308 { _map_nominal_u, _res_44u_1 }, /* 1 */
309 { _map_nominal_u, _res_44u_2 }, /* 2 */
310 { _map_nominal_u, _res_44u_3 }, /* 3 */
311 { _map_nominal_u, _res_44u_4 }, /* 4 */
312 { _map_nominal_u, _res_44u_5 }, /* 5 */
313 { _map_nominal_u, _res_44u_6 }, /* 6 */
314 { _map_nominal_u, _res_44u_7 }, /* 7 */
315 { _map_nominal_u, _res_44u_8 }, /* 8 */
316 { _map_nominal_u, _res_44u_9 }, /* 9 */