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-2002 *
9 * by the XIPHOPHORUS Company http://www.xiph.org/ *
11 ********************************************************************
13 function: toplevel residue templates for 32/44.1/48kHz
14 last mod: $Id: residue_44.h,v 1.16 2002/07/11 06:41:04 xiphmont Exp $
16 ********************************************************************/
18 #include "vorbis/codec.h"
20 #include "books/coupled/res_books_stereo.h"
22 /***** residue backends *********************************************/
24 static vorbis_info_residue0 _residue_44_mid={
26 /* 0 1 2 3 4 5 6 7 8 */
29 { .5, 1.5, 1.5, 2.5, 2.5, 4.5, 8.5, 16.5, 32.5},
30 { .5, .5, 999., .5, 999., 4.5, 8.5, 16.5, 32.5},
33 static vorbis_info_residue0 _residue_44_high={
35 /* 0 1 2 3 4 5 6 7 8 */
38 { .5, 1.5, 2.5, 4.5, 8.5, 16.5, 32.5, 71.5,157.5},
39 { .5, 1.5, 2.5, 3.5, 4.5, 8.5, 16.5, 71.5,157.5},
42 static static_bookblock _resbook_44s_0={
44 {0},{0,0,&_44c0_s_p1_0},{0,0,&_44c0_s_p2_0},{0,0,&_44c0_s_p3_0},
45 {0,0,&_44c0_s_p4_0},{0,0,&_44c0_s_p5_0},{0,0,&_44c0_s_p6_0},
46 {&_44c0_s_p7_0,&_44c0_s_p7_1},{&_44c0_s_p8_0,&_44c0_s_p8_1},
47 {&_44c0_s_p9_0,&_44c0_s_p9_1,&_44c0_s_p9_2}
50 static static_bookblock _resbook_44sm_0={
52 {0},{0,0,&_44c0_sm_p1_0},{0,0,&_44c0_sm_p2_0},{0,0,&_44c0_sm_p3_0},
53 {0,0,&_44c0_sm_p4_0},{0,0,&_44c0_sm_p5_0},{0,0,&_44c0_sm_p6_0},
54 {&_44c0_sm_p7_0,&_44c0_sm_p7_1},{&_44c0_sm_p8_0,&_44c0_sm_p8_1},
55 {&_44c0_sm_p9_0,&_44c0_sm_p9_1,&_44c0_sm_p9_2}
58 static static_bookblock _resbook_44s_1={
60 {0},{0,0,&_44c1_s_p1_0},{0,0,&_44c1_s_p2_0},{0,0,&_44c1_s_p3_0},
61 {0,0,&_44c1_s_p4_0},{0,0,&_44c1_s_p5_0},{0,0,&_44c1_s_p6_0},
62 {&_44c1_s_p7_0,&_44c1_s_p7_1},{&_44c1_s_p8_0,&_44c1_s_p8_1},
63 {&_44c1_s_p9_0,&_44c1_s_p9_1,&_44c1_s_p9_2}
66 static static_bookblock _resbook_44sm_1={
68 {0},{0,0,&_44c1_sm_p1_0},{0,0,&_44c1_sm_p2_0},{0,0,&_44c1_sm_p3_0},
69 {0,0,&_44c1_sm_p4_0},{0,0,&_44c1_sm_p5_0},{0,0,&_44c1_sm_p6_0},
70 {&_44c1_sm_p7_0,&_44c1_sm_p7_1},{&_44c1_sm_p8_0,&_44c1_sm_p8_1},
71 {&_44c1_sm_p9_0,&_44c1_sm_p9_1,&_44c1_sm_p9_2}
74 static static_bookblock _resbook_44s_2={
76 {0},{0,0,&_44c2_s_p1_0},{0,0,&_44c2_s_p2_0},{0,0,&_44c2_s_p3_0},
77 {0,0,&_44c2_s_p4_0},{0,0,&_44c2_s_p5_0},{0,0,&_44c2_s_p6_0},
78 {&_44c2_s_p7_0,&_44c2_s_p7_1},{&_44c2_s_p8_0,&_44c2_s_p8_1},
79 {&_44c2_s_p9_0,&_44c2_s_p9_1,&_44c2_s_p9_2}
82 static static_bookblock _resbook_44s_3={
84 {0},{0,0,&_44c3_s_p1_0},{0,0,&_44c3_s_p2_0},{0,0,&_44c3_s_p3_0},
85 {0,0,&_44c3_s_p4_0},{0,0,&_44c3_s_p5_0},{0,0,&_44c3_s_p6_0},
86 {&_44c3_s_p7_0,&_44c3_s_p7_1},{&_44c3_s_p8_0,&_44c3_s_p8_1},
87 {&_44c3_s_p9_0,&_44c3_s_p9_1,&_44c3_s_p9_2}
90 static static_bookblock _resbook_44s_4={
92 {0},{0,0,&_44c4_s_p1_0},{0,0,&_44c4_s_p2_0},{0,0,&_44c4_s_p3_0},
93 {0,0,&_44c4_s_p4_0},{0,0,&_44c4_s_p5_0},{0,0,&_44c4_s_p6_0},
94 {&_44c4_s_p7_0,&_44c4_s_p7_1},{&_44c4_s_p8_0,&_44c4_s_p8_1},
95 {&_44c4_s_p9_0,&_44c4_s_p9_1,&_44c4_s_p9_2}
98 static static_bookblock _resbook_44s_5={
100 {0},{0,0,&_44c5_s_p1_0},{0,0,&_44c5_s_p2_0},{0,0,&_44c5_s_p3_0},
101 {0,0,&_44c5_s_p4_0},{0,0,&_44c5_s_p5_0},{0,0,&_44c5_s_p6_0},
102 {&_44c5_s_p7_0,&_44c5_s_p7_1},{&_44c5_s_p8_0,&_44c5_s_p8_1},
103 {&_44c5_s_p9_0,&_44c5_s_p9_1,&_44c5_s_p9_2}
106 static static_bookblock _resbook_44s_6={
108 {0},{0,0,&_44c6_s_p1_0},{0,0,&_44c6_s_p2_0},{0,0,&_44c6_s_p3_0},
110 {&_44c6_s_p5_0,&_44c6_s_p5_1},
111 {&_44c6_s_p6_0,&_44c6_s_p6_1},
112 {&_44c6_s_p7_0,&_44c6_s_p7_1},
113 {&_44c6_s_p8_0,&_44c6_s_p8_1},
114 {&_44c6_s_p9_0,&_44c6_s_p9_1,&_44c6_s_p9_2}
117 static static_bookblock _resbook_44s_7={
119 {0},{0,0,&_44c7_s_p1_0},{0,0,&_44c7_s_p2_0},{0,0,&_44c7_s_p3_0},
121 {&_44c7_s_p5_0,&_44c7_s_p5_1},
122 {&_44c7_s_p6_0,&_44c7_s_p6_1},
123 {&_44c7_s_p7_0,&_44c7_s_p7_1},
124 {&_44c7_s_p8_0,&_44c7_s_p8_1},
125 {&_44c7_s_p9_0,&_44c7_s_p9_1,&_44c7_s_p9_2}
128 static static_bookblock _resbook_44s_8={
130 {0},{0,0,&_44c8_s_p1_0},{0,0,&_44c8_s_p2_0},{0,0,&_44c8_s_p3_0},
132 {&_44c8_s_p5_0,&_44c8_s_p5_1},
133 {&_44c8_s_p6_0,&_44c8_s_p6_1},
134 {&_44c8_s_p7_0,&_44c8_s_p7_1},
135 {&_44c8_s_p8_0,&_44c8_s_p8_1},
136 {&_44c8_s_p9_0,&_44c8_s_p9_1,&_44c8_s_p9_2}
139 static static_bookblock _resbook_44s_9={
141 {0},{0,0,&_44c9_s_p1_0},{0,0,&_44c9_s_p2_0},{0,0,&_44c9_s_p3_0},
143 {&_44c9_s_p5_0,&_44c9_s_p5_1},
144 {&_44c9_s_p6_0,&_44c9_s_p6_1},
145 {&_44c9_s_p7_0,&_44c9_s_p7_1},
146 {&_44c9_s_p8_0,&_44c9_s_p8_1},
147 {&_44c9_s_p9_0,&_44c9_s_p9_1,&_44c9_s_p9_2}
152 static vorbis_residue_template _res_44s_0[]={
153 {2,0, &_residue_44_mid,
154 &_huff_book__44c0_s_short,&_huff_book__44c0_sm_short,
155 &_resbook_44s_0,&_resbook_44sm_0},
157 {2,0, &_residue_44_mid,
158 &_huff_book__44c0_s_long,&_huff_book__44c0_sm_long,
159 &_resbook_44s_0,&_resbook_44sm_0}
161 static vorbis_residue_template _res_44s_1[]={
162 {2,0, &_residue_44_mid,
163 &_huff_book__44c1_s_short,&_huff_book__44c1_sm_short,
164 &_resbook_44s_1,&_resbook_44sm_1},
166 {2,0, &_residue_44_mid,
167 &_huff_book__44c1_s_long,&_huff_book__44c1_sm_long,
168 &_resbook_44s_1,&_resbook_44sm_1}
170 static vorbis_residue_template _res_44s_2[]={
171 {2,0, &_residue_44_mid,
172 &_huff_book__44c2_s_short,&_huff_book__44c2_s_short,
173 &_resbook_44s_2,&_resbook_44s_2},
175 {2,0, &_residue_44_mid,
176 &_huff_book__44c2_s_long,&_huff_book__44c2_s_long,
177 &_resbook_44s_2,&_resbook_44s_2}
179 static vorbis_residue_template _res_44s_3[]={
180 {2,0, &_residue_44_mid,
181 &_huff_book__44c3_s_short,&_huff_book__44c3_s_short,
182 &_resbook_44s_3,&_resbook_44s_3},
184 {2,0, &_residue_44_mid,
185 &_huff_book__44c3_s_long,&_huff_book__44c3_s_long,
186 &_resbook_44s_3,&_resbook_44s_3}
188 static vorbis_residue_template _res_44s_4[]={
189 {2,0, &_residue_44_mid,
190 &_huff_book__44c4_s_short,&_huff_book__44c4_s_short,
191 &_resbook_44s_4,&_resbook_44s_4},
193 {2,0, &_residue_44_mid,
194 &_huff_book__44c4_s_long,&_huff_book__44c4_s_long,
195 &_resbook_44s_4,&_resbook_44s_4}
197 static vorbis_residue_template _res_44s_5[]={
198 {2,0, &_residue_44_mid,
199 &_huff_book__44c5_s_short,&_huff_book__44c5_s_short,
200 &_resbook_44s_5,&_resbook_44s_5},
202 {2,0, &_residue_44_mid,
203 &_huff_book__44c5_s_long,&_huff_book__44c5_s_long,
204 &_resbook_44s_5,&_resbook_44s_5}
206 static vorbis_residue_template _res_44s_6[]={
207 {2,0, &_residue_44_high,
208 &_huff_book__44c6_s_short,&_huff_book__44c6_s_short,
209 &_resbook_44s_6,&_resbook_44s_6},
211 {2,0, &_residue_44_high,
212 &_huff_book__44c6_s_long,&_huff_book__44c6_s_long,
213 &_resbook_44s_6,&_resbook_44s_6}
215 static vorbis_residue_template _res_44s_7[]={
216 {2,0, &_residue_44_high,
217 &_huff_book__44c7_s_short,&_huff_book__44c7_s_short,
218 &_resbook_44s_7,&_resbook_44s_7},
220 {2,0, &_residue_44_high,
221 &_huff_book__44c7_s_long,&_huff_book__44c7_s_long,
222 &_resbook_44s_7,&_resbook_44s_7}
224 static vorbis_residue_template _res_44s_8[]={
225 {2,0, &_residue_44_high,
226 &_huff_book__44c8_s_short,&_huff_book__44c8_s_short,
227 &_resbook_44s_8,&_resbook_44s_8},
229 {2,0, &_residue_44_high,
230 &_huff_book__44c8_s_long,&_huff_book__44c8_s_long,
231 &_resbook_44s_8,&_resbook_44s_8}
233 static vorbis_residue_template _res_44s_9[]={
234 {2,0, &_residue_44_high,
235 &_huff_book__44c9_s_short,&_huff_book__44c9_s_short,
236 &_resbook_44s_9,&_resbook_44s_9},
238 {2,0, &_residue_44_high,
239 &_huff_book__44c9_s_long,&_huff_book__44c9_s_long,
240 &_resbook_44s_9,&_resbook_44s_9}
243 static vorbis_mapping_template _mapres_template_44_stereo[]={
244 { _map_nominal, _res_44s_0 }, /* 0 */
245 { _map_nominal, _res_44s_1 }, /* 1 */
246 { _map_nominal, _res_44s_2 }, /* 2 */
247 { _map_nominal, _res_44s_3 }, /* 3 */
248 { _map_nominal, _res_44s_4 }, /* 4 */
249 { _map_nominal, _res_44s_5 }, /* 5 */
250 { _map_nominal, _res_44s_6 }, /* 6 */
251 { _map_nominal, _res_44s_7 }, /* 7 */
252 { _map_nominal, _res_44s_8 }, /* 8 */
253 { _map_nominal, _res_44s_9 }, /* 9 */