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-2009 *
9 * by the Xiph.Org Foundation http://www.xiph.org/ *
11 ********************************************************************
13 function: toplevel residue templates for 32/44.1/48kHz
14 last mod: $Id: residue_44.h 16962 2010-03-11 07:30:34Z xiphmont $
16 ********************************************************************/
18 #include "vorbis/codec.h"
20 #include "books/coupled/res_books_stereo.h"
22 /***** residue backends *********************************************/
24 static const vorbis_info_residue0 _residue_44_low={
29 { 0, 1, 2, 2, 4, 8, 16, 32},
30 { 0, 0, 0,999, 4, 8, 16, 32},
33 static const vorbis_info_residue0 _residue_44_mid={
35 /* 0 1 2 3 4 5 6 7 8 */
38 { 0, 1, 1, 2, 2, 4, 8, 16, 32},
39 { 0, 0,999, 0,999, 4, 8, 16, 32},
42 static const vorbis_info_residue0 _residue_44_high={
44 /* 0 1 2 3 4 5 6 7 8 */
47 { 0, 1, 2, 4, 8, 16, 32, 71,157},
48 { 0, 1, 2, 3, 4, 8, 16, 71,157},
51 static const static_bookblock _resbook_44s_n1={
53 {0},{0,0,&_44cn1_s_p1_0},{0,0,&_44cn1_s_p2_0},
54 {0,0,&_44cn1_s_p3_0},{0,0,&_44cn1_s_p4_0},{0,0,&_44cn1_s_p5_0},
55 {&_44cn1_s_p6_0,&_44cn1_s_p6_1},{&_44cn1_s_p7_0,&_44cn1_s_p7_1},
56 {&_44cn1_s_p8_0,&_44cn1_s_p8_1,&_44cn1_s_p8_2}
59 static const static_bookblock _resbook_44sm_n1={
61 {0},{0,0,&_44cn1_sm_p1_0},{0,0,&_44cn1_sm_p2_0},
62 {0,0,&_44cn1_sm_p3_0},{0,0,&_44cn1_sm_p4_0},{0,0,&_44cn1_sm_p5_0},
63 {&_44cn1_sm_p6_0,&_44cn1_sm_p6_1},{&_44cn1_sm_p7_0,&_44cn1_sm_p7_1},
64 {&_44cn1_sm_p8_0,&_44cn1_sm_p8_1,&_44cn1_sm_p8_2}
68 static const static_bookblock _resbook_44s_0={
70 {0},{0,0,&_44c0_s_p1_0},{0,0,&_44c0_s_p2_0},
71 {0,0,&_44c0_s_p3_0},{0,0,&_44c0_s_p4_0},{0,0,&_44c0_s_p5_0},
72 {&_44c0_s_p6_0,&_44c0_s_p6_1},{&_44c0_s_p7_0,&_44c0_s_p7_1},
73 {&_44c0_s_p8_0,&_44c0_s_p8_1,&_44c0_s_p8_2}
76 static const static_bookblock _resbook_44sm_0={
78 {0},{0,0,&_44c0_sm_p1_0},{0,0,&_44c0_sm_p2_0},
79 {0,0,&_44c0_sm_p3_0},{0,0,&_44c0_sm_p4_0},{0,0,&_44c0_sm_p5_0},
80 {&_44c0_sm_p6_0,&_44c0_sm_p6_1},{&_44c0_sm_p7_0,&_44c0_sm_p7_1},
81 {&_44c0_sm_p8_0,&_44c0_sm_p8_1,&_44c0_sm_p8_2}
85 static const static_bookblock _resbook_44s_1={
87 {0},{0,0,&_44c1_s_p1_0},{0,0,&_44c1_s_p2_0},
88 {0,0,&_44c1_s_p3_0},{0,0,&_44c1_s_p4_0},{0,0,&_44c1_s_p5_0},
89 {&_44c1_s_p6_0,&_44c1_s_p6_1},{&_44c1_s_p7_0,&_44c1_s_p7_1},
90 {&_44c1_s_p8_0,&_44c1_s_p8_1,&_44c1_s_p8_2}
93 static const static_bookblock _resbook_44sm_1={
95 {0},{0,0,&_44c1_sm_p1_0},{0,0,&_44c1_sm_p2_0},
96 {0,0,&_44c1_sm_p3_0},{0,0,&_44c1_sm_p4_0},{0,0,&_44c1_sm_p5_0},
97 {&_44c1_sm_p6_0,&_44c1_sm_p6_1},{&_44c1_sm_p7_0,&_44c1_sm_p7_1},
98 {&_44c1_sm_p8_0,&_44c1_sm_p8_1,&_44c1_sm_p8_2}
102 static const static_bookblock _resbook_44s_2={
104 {0},{0,0,&_44c2_s_p1_0},{0,0,&_44c2_s_p2_0},{0,0,&_44c2_s_p3_0},
105 {0,0,&_44c2_s_p4_0},{0,0,&_44c2_s_p5_0},{0,0,&_44c2_s_p6_0},
106 {&_44c2_s_p7_0,&_44c2_s_p7_1},{&_44c2_s_p8_0,&_44c2_s_p8_1},
107 {&_44c2_s_p9_0,&_44c2_s_p9_1,&_44c2_s_p9_2}
110 static const static_bookblock _resbook_44s_3={
112 {0},{0,0,&_44c3_s_p1_0},{0,0,&_44c3_s_p2_0},{0,0,&_44c3_s_p3_0},
113 {0,0,&_44c3_s_p4_0},{0,0,&_44c3_s_p5_0},{0,0,&_44c3_s_p6_0},
114 {&_44c3_s_p7_0,&_44c3_s_p7_1},{&_44c3_s_p8_0,&_44c3_s_p8_1},
115 {&_44c3_s_p9_0,&_44c3_s_p9_1,&_44c3_s_p9_2}
118 static const static_bookblock _resbook_44s_4={
120 {0},{0,0,&_44c4_s_p1_0},{0,0,&_44c4_s_p2_0},{0,0,&_44c4_s_p3_0},
121 {0,0,&_44c4_s_p4_0},{0,0,&_44c4_s_p5_0},{0,0,&_44c4_s_p6_0},
122 {&_44c4_s_p7_0,&_44c4_s_p7_1},{&_44c4_s_p8_0,&_44c4_s_p8_1},
123 {&_44c4_s_p9_0,&_44c4_s_p9_1,&_44c4_s_p9_2}
126 static const static_bookblock _resbook_44s_5={
128 {0},{0,0,&_44c5_s_p1_0},{0,0,&_44c5_s_p2_0},{0,0,&_44c5_s_p3_0},
129 {0,0,&_44c5_s_p4_0},{0,0,&_44c5_s_p5_0},{0,0,&_44c5_s_p6_0},
130 {&_44c5_s_p7_0,&_44c5_s_p7_1},{&_44c5_s_p8_0,&_44c5_s_p8_1},
131 {&_44c5_s_p9_0,&_44c5_s_p9_1,&_44c5_s_p9_2}
134 static const static_bookblock _resbook_44s_6={
136 {0},{0,0,&_44c6_s_p1_0},{0,0,&_44c6_s_p2_0},{0,0,&_44c6_s_p3_0},
138 {&_44c6_s_p5_0,&_44c6_s_p5_1},
139 {&_44c6_s_p6_0,&_44c6_s_p6_1},
140 {&_44c6_s_p7_0,&_44c6_s_p7_1},
141 {&_44c6_s_p8_0,&_44c6_s_p8_1},
142 {&_44c6_s_p9_0,&_44c6_s_p9_1,&_44c6_s_p9_2}
145 static const static_bookblock _resbook_44s_7={
147 {0},{0,0,&_44c7_s_p1_0},{0,0,&_44c7_s_p2_0},{0,0,&_44c7_s_p3_0},
149 {&_44c7_s_p5_0,&_44c7_s_p5_1},
150 {&_44c7_s_p6_0,&_44c7_s_p6_1},
151 {&_44c7_s_p7_0,&_44c7_s_p7_1},
152 {&_44c7_s_p8_0,&_44c7_s_p8_1},
153 {&_44c7_s_p9_0,&_44c7_s_p9_1,&_44c7_s_p9_2}
156 static const static_bookblock _resbook_44s_8={
158 {0},{0,0,&_44c8_s_p1_0},{0,0,&_44c8_s_p2_0},{0,0,&_44c8_s_p3_0},
160 {&_44c8_s_p5_0,&_44c8_s_p5_1},
161 {&_44c8_s_p6_0,&_44c8_s_p6_1},
162 {&_44c8_s_p7_0,&_44c8_s_p7_1},
163 {&_44c8_s_p8_0,&_44c8_s_p8_1},
164 {&_44c8_s_p9_0,&_44c8_s_p9_1,&_44c8_s_p9_2}
167 static const static_bookblock _resbook_44s_9={
169 {0},{0,0,&_44c9_s_p1_0},{0,0,&_44c9_s_p2_0},{0,0,&_44c9_s_p3_0},
171 {&_44c9_s_p5_0,&_44c9_s_p5_1},
172 {&_44c9_s_p6_0,&_44c9_s_p6_1},
173 {&_44c9_s_p7_0,&_44c9_s_p7_1},
174 {&_44c9_s_p8_0,&_44c9_s_p8_1},
175 {&_44c9_s_p9_0,&_44c9_s_p9_1,&_44c9_s_p9_2}
179 static const vorbis_residue_template _res_44s_n1[]={
180 {2,0,32, &_residue_44_low,
181 &_huff_book__44cn1_s_short,&_huff_book__44cn1_sm_short,
182 &_resbook_44s_n1,&_resbook_44sm_n1},
184 {2,0,32, &_residue_44_low,
185 &_huff_book__44cn1_s_long,&_huff_book__44cn1_sm_long,
186 &_resbook_44s_n1,&_resbook_44sm_n1}
188 static const vorbis_residue_template _res_44s_0[]={
189 {2,0,16, &_residue_44_low,
190 &_huff_book__44c0_s_short,&_huff_book__44c0_sm_short,
191 &_resbook_44s_0,&_resbook_44sm_0},
193 {2,0,32, &_residue_44_low,
194 &_huff_book__44c0_s_long,&_huff_book__44c0_sm_long,
195 &_resbook_44s_0,&_resbook_44sm_0}
197 static const vorbis_residue_template _res_44s_1[]={
198 {2,0,16, &_residue_44_low,
199 &_huff_book__44c1_s_short,&_huff_book__44c1_sm_short,
200 &_resbook_44s_1,&_resbook_44sm_1},
202 {2,0,32, &_residue_44_low,
203 &_huff_book__44c1_s_long,&_huff_book__44c1_sm_long,
204 &_resbook_44s_1,&_resbook_44sm_1}
207 static const vorbis_residue_template _res_44s_2[]={
208 {2,0,16, &_residue_44_mid,
209 &_huff_book__44c2_s_short,&_huff_book__44c2_s_short,
210 &_resbook_44s_2,&_resbook_44s_2},
212 {2,0,32, &_residue_44_mid,
213 &_huff_book__44c2_s_long,&_huff_book__44c2_s_long,
214 &_resbook_44s_2,&_resbook_44s_2}
216 static const vorbis_residue_template _res_44s_3[]={
217 {2,0,16, &_residue_44_mid,
218 &_huff_book__44c3_s_short,&_huff_book__44c3_s_short,
219 &_resbook_44s_3,&_resbook_44s_3},
221 {2,0,32, &_residue_44_mid,
222 &_huff_book__44c3_s_long,&_huff_book__44c3_s_long,
223 &_resbook_44s_3,&_resbook_44s_3}
225 static const vorbis_residue_template _res_44s_4[]={
226 {2,0,16, &_residue_44_mid,
227 &_huff_book__44c4_s_short,&_huff_book__44c4_s_short,
228 &_resbook_44s_4,&_resbook_44s_4},
230 {2,0,32, &_residue_44_mid,
231 &_huff_book__44c4_s_long,&_huff_book__44c4_s_long,
232 &_resbook_44s_4,&_resbook_44s_4}
234 static const vorbis_residue_template _res_44s_5[]={
235 {2,0,16, &_residue_44_mid,
236 &_huff_book__44c5_s_short,&_huff_book__44c5_s_short,
237 &_resbook_44s_5,&_resbook_44s_5},
239 {2,0,32, &_residue_44_mid,
240 &_huff_book__44c5_s_long,&_huff_book__44c5_s_long,
241 &_resbook_44s_5,&_resbook_44s_5}
243 static const vorbis_residue_template _res_44s_6[]={
244 {2,0,16, &_residue_44_high,
245 &_huff_book__44c6_s_short,&_huff_book__44c6_s_short,
246 &_resbook_44s_6,&_resbook_44s_6},
248 {2,0,32, &_residue_44_high,
249 &_huff_book__44c6_s_long,&_huff_book__44c6_s_long,
250 &_resbook_44s_6,&_resbook_44s_6}
252 static const vorbis_residue_template _res_44s_7[]={
253 {2,0,16, &_residue_44_high,
254 &_huff_book__44c7_s_short,&_huff_book__44c7_s_short,
255 &_resbook_44s_7,&_resbook_44s_7},
257 {2,0,32, &_residue_44_high,
258 &_huff_book__44c7_s_long,&_huff_book__44c7_s_long,
259 &_resbook_44s_7,&_resbook_44s_7}
261 static const vorbis_residue_template _res_44s_8[]={
262 {2,0,16, &_residue_44_high,
263 &_huff_book__44c8_s_short,&_huff_book__44c8_s_short,
264 &_resbook_44s_8,&_resbook_44s_8},
266 {2,0,32, &_residue_44_high,
267 &_huff_book__44c8_s_long,&_huff_book__44c8_s_long,
268 &_resbook_44s_8,&_resbook_44s_8}
270 static const vorbis_residue_template _res_44s_9[]={
271 {2,0,16, &_residue_44_high,
272 &_huff_book__44c9_s_short,&_huff_book__44c9_s_short,
273 &_resbook_44s_9,&_resbook_44s_9},
275 {2,0,32, &_residue_44_high,
276 &_huff_book__44c9_s_long,&_huff_book__44c9_s_long,
277 &_resbook_44s_9,&_resbook_44s_9}
280 static const vorbis_mapping_template _mapres_template_44_stereo[]={
281 { _map_nominal, _res_44s_n1 }, /* -1 */
282 { _map_nominal, _res_44s_0 }, /* 0 */
283 { _map_nominal, _res_44s_1 }, /* 1 */
284 { _map_nominal, _res_44s_2 }, /* 2 */
285 { _map_nominal, _res_44s_3 }, /* 3 */
286 { _map_nominal, _res_44s_4 }, /* 4 */
287 { _map_nominal, _res_44s_5 }, /* 5 */
288 { _map_nominal, _res_44s_6 }, /* 6 */
289 { _map_nominal, _res_44s_7 }, /* 7 */
290 { _map_nominal, _res_44s_8 }, /* 8 */
291 { _map_nominal, _res_44s_9 }, /* 9 */