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 http://www.xiph.org/ *
11 ********************************************************************
13 function: toplevel residue templates for 32/44.1/48kHz uncoupled
14 last mod: $Id: residue_44u.h 15531 2008-11-24 23:50:06Z xiphmont $
16 ********************************************************************/
18 #include "vorbis/codec.h"
20 #include "books/uncoupled/res_books_uncoupled.h"
22 /***** residue backends *********************************************/
25 static const vorbis_info_residue0 _residue_44_low_un
={
29 { .5, 1.5, 1.5, 2.5, 2.5, 4.5, 28.5},
30 { -1, 25, -1, 45, -1, -1, -1}
33 static const vorbis_info_residue0 _residue_44_mid_un
={
35 /* 0 1 2 3 4 5 6 7 8 9 */
38 { .5, 1.5, 1.5, 2.5, 2.5, 4.5, 4.5, 16.5, 60.5},
39 { -1, 30, -1, 50, -1, 80, -1, -1, -1}
42 static const vorbis_info_residue0 _residue_44_hi_un
={
44 /* 0 1 2 3 4 5 6 7 8 9 */
47 { .5, 1.5, 2.5, 4.5, 8.5, 16.5, 32.5, 71.5,157.5},
48 { -1, -1, -1, -1, -1, -1, -1, -1, -1}
51 /* mapping conventions:
52 only one submap (this would change for efficient 5.1 support for example)*/
53 /* Four psychoacoustic profiles are used, one for each blocktype */
54 static const vorbis_info_mapping0 _map_nominal_u
[2]={
55 {1, {0,0}, {0}, {0}, 0,{0},{0}},
56 {1, {0,0}, {1}, {1}, 0,{0},{0}}
59 static const static_bookblock _resbook_44u_n1
={
67 {&_44un1__p6_0
,&_44un1__p6_1
},
68 {&_44un1__p7_0
,&_44un1__p7_1
,&_44un1__p7_2
}
71 static const static_bookblock _resbook_44u_0
={
79 {&_44u0__p6_0
,&_44u0__p6_1
},
80 {&_44u0__p7_0
,&_44u0__p7_1
,&_44u0__p7_2
}
83 static const static_bookblock _resbook_44u_1
={
91 {&_44u1__p6_0
,&_44u1__p6_1
},
92 {&_44u1__p7_0
,&_44u1__p7_1
,&_44u1__p7_2
}
95 static const static_bookblock _resbook_44u_2
={
103 {&_44u2__p6_0
,&_44u2__p6_1
},
104 {&_44u2__p7_0
,&_44u2__p7_1
,&_44u2__p7_2
}
107 static const static_bookblock _resbook_44u_3
={
115 {&_44u3__p6_0
,&_44u3__p6_1
},
116 {&_44u3__p7_0
,&_44u3__p7_1
,&_44u3__p7_2
}
119 static const static_bookblock _resbook_44u_4
={
127 {&_44u4__p6_0
,&_44u4__p6_1
},
128 {&_44u4__p7_0
,&_44u4__p7_1
,&_44u4__p7_2
}
131 static const static_bookblock _resbook_44u_5
={
140 {&_44u5__p7_0
,&_44u5__p7_1
},
141 {&_44u5__p8_0
,&_44u5__p8_1
},
142 {&_44u5__p9_0
,&_44u5__p9_1
,&_44u5__p9_2
}
145 static const static_bookblock _resbook_44u_6
={
154 {&_44u6__p7_0
,&_44u6__p7_1
},
155 {&_44u6__p8_0
,&_44u6__p8_1
},
156 {&_44u6__p9_0
,&_44u6__p9_1
,&_44u6__p9_2
}
159 static const static_bookblock _resbook_44u_7
={
168 {&_44u7__p7_0
,&_44u7__p7_1
},
169 {&_44u7__p8_0
,&_44u7__p8_1
},
170 {&_44u7__p9_0
,&_44u7__p9_1
,&_44u7__p9_2
}
173 static const static_bookblock _resbook_44u_8
={
180 {&_44u8_p5_0
,&_44u8_p5_1
},
181 {&_44u8_p6_0
,&_44u8_p6_1
},
182 {&_44u8_p7_0
,&_44u8_p7_1
},
183 {&_44u8_p8_0
,&_44u8_p8_1
},
184 {&_44u8_p9_0
,&_44u8_p9_1
,&_44u8_p9_2
}
187 static const static_bookblock _resbook_44u_9
={
194 {&_44u9_p5_0
,&_44u9_p5_1
},
195 {&_44u9_p6_0
,&_44u9_p6_1
},
196 {&_44u9_p7_0
,&_44u9_p7_1
},
197 {&_44u9_p8_0
,&_44u9_p8_1
},
198 {&_44u9_p9_0
,&_44u9_p9_1
,&_44u9_p9_2
}
202 static const vorbis_residue_template _res_44u_n1
[]={
203 {1,0, &_residue_44_low_un
,
204 &_huff_book__44un1__short
,&_huff_book__44un1__short
,
205 &_resbook_44u_n1
,&_resbook_44u_n1
},
207 {1,0, &_residue_44_low_un
,
208 &_huff_book__44un1__long
,&_huff_book__44un1__long
,
209 &_resbook_44u_n1
,&_resbook_44u_n1
}
211 static const vorbis_residue_template _res_44u_0
[]={
212 {1,0, &_residue_44_low_un
,
213 &_huff_book__44u0__short
,&_huff_book__44u0__short
,
214 &_resbook_44u_0
,&_resbook_44u_0
},
216 {1,0, &_residue_44_low_un
,
217 &_huff_book__44u0__long
,&_huff_book__44u0__long
,
218 &_resbook_44u_0
,&_resbook_44u_0
}
220 static const vorbis_residue_template _res_44u_1
[]={
221 {1,0, &_residue_44_low_un
,
222 &_huff_book__44u1__short
,&_huff_book__44u1__short
,
223 &_resbook_44u_1
,&_resbook_44u_1
},
225 {1,0, &_residue_44_low_un
,
226 &_huff_book__44u1__long
,&_huff_book__44u1__long
,
227 &_resbook_44u_1
,&_resbook_44u_1
}
229 static const vorbis_residue_template _res_44u_2
[]={
230 {1,0, &_residue_44_low_un
,
231 &_huff_book__44u2__short
,&_huff_book__44u2__short
,
232 &_resbook_44u_2
,&_resbook_44u_2
},
234 {1,0, &_residue_44_low_un
,
235 &_huff_book__44u2__long
,&_huff_book__44u2__long
,
236 &_resbook_44u_2
,&_resbook_44u_2
}
238 static const vorbis_residue_template _res_44u_3
[]={
239 {1,0, &_residue_44_low_un
,
240 &_huff_book__44u3__short
,&_huff_book__44u3__short
,
241 &_resbook_44u_3
,&_resbook_44u_3
},
243 {1,0, &_residue_44_low_un
,
244 &_huff_book__44u3__long
,&_huff_book__44u3__long
,
245 &_resbook_44u_3
,&_resbook_44u_3
}
247 static const vorbis_residue_template _res_44u_4
[]={
248 {1,0, &_residue_44_low_un
,
249 &_huff_book__44u4__short
,&_huff_book__44u4__short
,
250 &_resbook_44u_4
,&_resbook_44u_4
},
252 {1,0, &_residue_44_low_un
,
253 &_huff_book__44u4__long
,&_huff_book__44u4__long
,
254 &_resbook_44u_4
,&_resbook_44u_4
}
257 static const vorbis_residue_template _res_44u_5
[]={
258 {1,0, &_residue_44_mid_un
,
259 &_huff_book__44u5__short
,&_huff_book__44u5__short
,
260 &_resbook_44u_5
,&_resbook_44u_5
},
262 {1,0, &_residue_44_mid_un
,
263 &_huff_book__44u5__long
,&_huff_book__44u5__long
,
264 &_resbook_44u_5
,&_resbook_44u_5
}
267 static const vorbis_residue_template _res_44u_6
[]={
268 {1,0, &_residue_44_mid_un
,
269 &_huff_book__44u6__short
,&_huff_book__44u6__short
,
270 &_resbook_44u_6
,&_resbook_44u_6
},
272 {1,0, &_residue_44_mid_un
,
273 &_huff_book__44u6__long
,&_huff_book__44u6__long
,
274 &_resbook_44u_6
,&_resbook_44u_6
}
277 static const vorbis_residue_template _res_44u_7
[]={
278 {1,0, &_residue_44_mid_un
,
279 &_huff_book__44u7__short
,&_huff_book__44u7__short
,
280 &_resbook_44u_7
,&_resbook_44u_7
},
282 {1,0, &_residue_44_mid_un
,
283 &_huff_book__44u7__long
,&_huff_book__44u7__long
,
284 &_resbook_44u_7
,&_resbook_44u_7
}
287 static const vorbis_residue_template _res_44u_8
[]={
288 {1,0, &_residue_44_hi_un
,
289 &_huff_book__44u8__short
,&_huff_book__44u8__short
,
290 &_resbook_44u_8
,&_resbook_44u_8
},
292 {1,0, &_residue_44_hi_un
,
293 &_huff_book__44u8__long
,&_huff_book__44u8__long
,
294 &_resbook_44u_8
,&_resbook_44u_8
}
296 static const vorbis_residue_template _res_44u_9
[]={
297 {1,0, &_residue_44_hi_un
,
298 &_huff_book__44u9__short
,&_huff_book__44u9__short
,
299 &_resbook_44u_9
,&_resbook_44u_9
},
301 {1,0, &_residue_44_hi_un
,
302 &_huff_book__44u9__long
,&_huff_book__44u9__long
,
303 &_resbook_44u_9
,&_resbook_44u_9
}
306 static const vorbis_mapping_template _mapres_template_44_uncoupled
[]={
307 { _map_nominal_u
, _res_44u_n1
}, /* -1 */
308 { _map_nominal_u
, _res_44u_0
}, /* 0 */
309 { _map_nominal_u
, _res_44u_1
}, /* 1 */
310 { _map_nominal_u
, _res_44u_2
}, /* 2 */
311 { _map_nominal_u
, _res_44u_3
}, /* 3 */
312 { _map_nominal_u
, _res_44u_4
}, /* 4 */
313 { _map_nominal_u
, _res_44u_5
}, /* 5 */
314 { _map_nominal_u
, _res_44u_6
}, /* 6 */
315 { _map_nominal_u
, _res_44u_7
}, /* 7 */
316 { _map_nominal_u
, _res_44u_8
}, /* 8 */
317 { _map_nominal_u
, _res_44u_9
}, /* 9 */