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-2001 *
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.13 2002/07/01 11:20:19 xiphmont Exp $
16 ********************************************************************/
18 #include "vorbis/codec.h"
20 #include "books/coupled/res_books_44c.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 /* mapping conventions:
43 only one submap (this would change for efficient 5.1 support for example)*/
44 /* Four psychoacoustic profiles are used, one for each blocktype */
45 static vorbis_info_mapping0 _map_nominal[2]={
46 {1, {0,0}, {0}, {0}, 1,{0},{1}},
47 {1, {0,0}, {1}, {1}, 1,{0},{1}}
50 static static_bookblock _resbook_44s_0={
52 {0},{0,0,&_44c0_s_p1_0},{0,0,&_44c0_s_p2_0},{0,0,&_44c0_s_p3_0},
53 {0,0,&_44c0_s_p4_0},{0,0,&_44c0_s_p5_0},{0,0,&_44c0_s_p6_0},
54 {&_44c0_s_p7_0,&_44c0_s_p7_1},{&_44c0_s_p8_0,&_44c0_s_p8_1},
55 {&_44c0_s_p9_0,&_44c0_s_p9_1,&_44c0_s_p9_2}
58 static static_bookblock _resbook_44sm_0={
60 {0},{0,0,&_44c0_sm_p1_0},{0,0,&_44c0_sm_p2_0},{0,0,&_44c0_sm_p3_0},
61 {0,0,&_44c0_sm_p4_0},{0,0,&_44c0_sm_p5_0},{0,0,&_44c0_sm_p6_0},
62 {&_44c0_sm_p7_0,&_44c0_sm_p7_1},{&_44c0_sm_p8_0,&_44c0_sm_p8_1},
63 {&_44c0_sm_p9_0,&_44c0_sm_p9_1,&_44c0_sm_p9_2}
66 static static_bookblock _resbook_44s_1={
68 {0},{0,0,&_44c1_s_p1_0},{0,0,&_44c1_s_p2_0},{0,0,&_44c1_s_p3_0},
69 {0,0,&_44c1_s_p4_0},{0,0,&_44c1_s_p5_0},{0,0,&_44c1_s_p6_0},
70 {&_44c1_s_p7_0,&_44c1_s_p7_1},{&_44c1_s_p8_0,&_44c1_s_p8_1},
71 {&_44c1_s_p9_0,&_44c1_s_p9_1,&_44c1_s_p9_2}
74 static static_bookblock _resbook_44sm_1={
76 {0},{0,0,&_44c1_sm_p1_0},{0,0,&_44c1_sm_p2_0},{0,0,&_44c1_sm_p3_0},
77 {0,0,&_44c1_sm_p4_0},{0,0,&_44c1_sm_p5_0},{0,0,&_44c1_sm_p6_0},
78 {&_44c1_sm_p7_0,&_44c1_sm_p7_1},{&_44c1_sm_p8_0,&_44c1_sm_p8_1},
79 {&_44c1_sm_p9_0,&_44c1_sm_p9_1,&_44c1_sm_p9_2}
82 static static_bookblock _resbook_44s_2={
84 {0},{0,0,&_44c2_s_p1_0},{0,0,&_44c2_s_p2_0},{0,0,&_44c2_s_p3_0},
85 {0,0,&_44c2_s_p4_0},{0,0,&_44c2_s_p5_0},{0,0,&_44c2_s_p6_0},
86 {&_44c2_s_p7_0,&_44c2_s_p7_1},{&_44c2_s_p8_0,&_44c2_s_p8_1},
87 {&_44c2_s_p9_0,&_44c2_s_p9_1,&_44c2_s_p9_2}
90 static static_bookblock _resbook_44s_3={
92 {0},{0,0,&_44c3_s_p1_0},{0,0,&_44c3_s_p2_0},{0,0,&_44c3_s_p3_0},
93 {0,0,&_44c3_s_p4_0},{0,0,&_44c3_s_p5_0},{0,0,&_44c3_s_p6_0},
94 {&_44c3_s_p7_0,&_44c3_s_p7_1},{&_44c3_s_p8_0,&_44c3_s_p8_1},
95 {&_44c3_s_p9_0,&_44c3_s_p9_1,&_44c3_s_p9_2}
98 static static_bookblock _resbook_44s_4={
100 {0},{0,0,&_44c4_s_p1_0},{0,0,&_44c4_s_p2_0},{0,0,&_44c4_s_p3_0},
101 {0,0,&_44c4_s_p4_0},{0,0,&_44c4_s_p5_0},{0,0,&_44c4_s_p6_0},
102 {&_44c4_s_p7_0,&_44c4_s_p7_1},{&_44c4_s_p8_0,&_44c4_s_p8_1},
103 {&_44c4_s_p9_0,&_44c4_s_p9_1,&_44c4_s_p9_2}
106 static static_bookblock _resbook_44s_5={
108 {0},{0,0,&_44c5_s_p1_0},{0,0,&_44c5_s_p2_0},{0,0,&_44c5_s_p3_0},
109 {0,0,&_44c5_s_p4_0},{0,0,&_44c5_s_p5_0},{0,0,&_44c5_s_p6_0},
110 {&_44c5_s_p7_0,&_44c5_s_p7_1},{&_44c5_s_p8_0,&_44c5_s_p8_1},
111 {&_44c5_s_p9_0,&_44c5_s_p9_1,&_44c5_s_p9_2}
114 static static_bookblock _resbook_44s_6={
116 {0},{0,0,&_44c6_s_p1_0},{0,0,&_44c6_s_p2_0},{0,0,&_44c6_s_p3_0},
118 {&_44c6_s_p5_0,&_44c6_s_p5_1},
119 {&_44c6_s_p6_0,&_44c6_s_p6_1},
120 {&_44c6_s_p7_0,&_44c6_s_p7_1},
121 {&_44c6_s_p8_0,&_44c6_s_p8_1},
122 {&_44c6_s_p9_0,&_44c6_s_p9_1,&_44c6_s_p9_2}
125 static static_bookblock _resbook_44s_7={
127 {0},{0,0,&_44c7_s_p1_0},{0,0,&_44c7_s_p2_0},{0,0,&_44c7_s_p3_0},
129 {&_44c7_s_p5_0,&_44c7_s_p5_1},
130 {&_44c7_s_p6_0,&_44c7_s_p6_1},
131 {&_44c7_s_p7_0,&_44c7_s_p7_1},
132 {&_44c7_s_p8_0,&_44c7_s_p8_1},
133 {&_44c7_s_p9_0,&_44c7_s_p9_1,&_44c7_s_p9_2}
136 static static_bookblock _resbook_44s_8={
138 {0},{0,0,&_44c8_s_p1_0},{0,0,&_44c8_s_p2_0},{0,0,&_44c8_s_p3_0},
140 {&_44c8_s_p5_0,&_44c8_s_p5_1},
141 {&_44c8_s_p6_0,&_44c8_s_p6_1},
142 {&_44c8_s_p7_0,&_44c8_s_p7_1},
143 {&_44c8_s_p8_0,&_44c8_s_p8_1},
144 {&_44c8_s_p9_0,&_44c8_s_p9_1,&_44c8_s_p9_2}
147 static static_bookblock _resbook_44s_9={
149 {0},{0,0,&_44c9_s_p1_0},{0,0,&_44c9_s_p2_0},{0,0,&_44c9_s_p3_0},
151 {&_44c9_s_p5_0,&_44c9_s_p5_1},
152 {&_44c9_s_p6_0,&_44c9_s_p6_1},
153 {&_44c9_s_p7_0,&_44c9_s_p7_1},
154 {&_44c9_s_p8_0,&_44c9_s_p8_1},
155 {&_44c9_s_p9_0,&_44c9_s_p9_1,&_44c9_s_p9_2}
160 static vorbis_residue_template _res_44s_0[]={
161 {2,0, &_residue_44_mid,
162 &_huff_book__44c0_s_short,&_huff_book__44c0_sm_short,
163 &_resbook_44s_0,&_resbook_44sm_0},
165 {2,0, &_residue_44_mid,
166 &_huff_book__44c0_s_long,&_huff_book__44c0_sm_long,
167 &_resbook_44s_0,&_resbook_44sm_0}
169 static vorbis_residue_template _res_44s_1[]={
170 {2,0, &_residue_44_mid,
171 &_huff_book__44c1_s_short,&_huff_book__44c1_sm_short,
172 &_resbook_44s_1,&_resbook_44sm_1},
174 {2,0, &_residue_44_mid,
175 &_huff_book__44c1_s_long,&_huff_book__44c1_sm_long,
176 &_resbook_44s_1,&_resbook_44sm_1}
178 static vorbis_residue_template _res_44s_2[]={
179 {2,0, &_residue_44_mid,
180 &_huff_book__44c2_s_short,&_huff_book__44c2_sm_short,
181 &_resbook_44s_2,&_resbook_44s_2},
183 {2,0, &_residue_44_mid,
184 &_huff_book__44c2_s_long,&_huff_book__44c2_sm_long,
185 &_resbook_44s_2,&_resbook_44s_2}
187 static vorbis_residue_template _res_44s_3[]={
188 {2,0, &_residue_44_mid,
189 &_huff_book__44c3_s_short,&_huff_book__44c3_sm_short,
190 &_resbook_44s_3,&_resbook_44s_3},
192 {2,0, &_residue_44_mid,
193 &_huff_book__44c3_s_long,&_huff_book__44c3_sm_long,
194 &_resbook_44s_3,&_resbook_44s_3}
196 static vorbis_residue_template _res_44s_4[]={
197 {2,0, &_residue_44_mid,
198 &_huff_book__44c4_s_short,&_huff_book__44c4_sm_short,
199 &_resbook_44s_4,&_resbook_44s_4},
201 {2,0, &_residue_44_mid,
202 &_huff_book__44c4_s_long,&_huff_book__44c4_sm_long,
203 &_resbook_44s_4,&_resbook_44s_4}
205 static vorbis_residue_template _res_44s_5[]={
206 {2,0, &_residue_44_mid,
207 &_huff_book__44c5_s_short,&_huff_book__44c5_sm_short,
208 &_resbook_44s_5,&_resbook_44s_5},
210 {2,0, &_residue_44_mid,
211 &_huff_book__44c5_s_long,&_huff_book__44c5_sm_long,
212 &_resbook_44s_5,&_resbook_44s_5}
214 static vorbis_residue_template _res_44s_6[]={
215 {2,0, &_residue_44_high,
216 &_huff_book__44c6_s_short,&_huff_book__44c6_sm_short,
217 &_resbook_44s_6,&_resbook_44s_6},
219 {2,0, &_residue_44_high,
220 &_huff_book__44c6_s_long,&_huff_book__44c6_sm_long,
221 &_resbook_44s_6,&_resbook_44s_6}
223 static vorbis_residue_template _res_44s_7[]={
224 {2,0, &_residue_44_high,
225 &_huff_book__44c7_s_short,&_huff_book__44c7_sm_short,
226 &_resbook_44s_7,&_resbook_44s_7},
228 {2,0, &_residue_44_high,
229 &_huff_book__44c7_s_long,&_huff_book__44c7_sm_long,
230 &_resbook_44s_7,&_resbook_44s_7}
232 static vorbis_residue_template _res_44s_8[]={
233 {2,0, &_residue_44_high,
234 &_huff_book__44c8_s_short,&_huff_book__44c8_sm_short,
235 &_resbook_44s_8,&_resbook_44s_8},
237 {2,0, &_residue_44_high,
238 &_huff_book__44c8_s_long,&_huff_book__44c8_sm_long,
239 &_resbook_44s_8,&_resbook_44s_8}
241 static vorbis_residue_template _res_44s_9[]={
242 {2,0, &_residue_44_high,
243 &_huff_book__44c9_s_short,&_huff_book__44c9_sm_short,
244 &_resbook_44s_9,&_resbook_44s_9},
246 {2,0, &_residue_44_high,
247 &_huff_book__44c9_s_long,&_huff_book__44c9_sm_long,
248 &_resbook_44s_9,&_resbook_44s_9}
252 static vorbis_mapping_template _mapres_template_44_stereo[]={
253 { _map_nominal, _res_44s_0 }, /* 0 */
254 { _map_nominal, _res_44s_1 }, /* 1 */
255 { _map_nominal, _res_44s_2 }, /* 2 */
256 { _map_nominal, _res_44s_3 }, /* 3 */
257 { _map_nominal, _res_44s_4 }, /* 4 */
258 { _map_nominal, _res_44s_5 }, /* 5 */
259 { _map_nominal, _res_44s_6 }, /* 6 */
260 { _map_nominal, _res_44s_7 }, /* 7 */
261 { _map_nominal, _res_44s_8 }, /* 8 */
262 { _map_nominal, _res_44s_9 }, /* 9 */