new ectl calls for lowpass and impulse block tweaking
[platform/upstream/libvorbis.git] / lib / modes / residue_44.h
1 /********************************************************************
2  *                                                                  *
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.       *
7  *                                                                  *
8  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
9  * by the XIPHOPHORUS Company http://www.xiph.org/                  *
10  *                                                                  *
11  ********************************************************************
12
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 $
15
16  ********************************************************************/
17
18 #include "vorbis/codec.h"
19 #include "backends.h"
20 #include "books/coupled/res_books_44c.h"
21
22 /***** residue backends *********************************************/
23
24 static vorbis_info_residue0 _residue_44_mid={
25   0,-1, -1, 10,-1,
26   /*  0     1     2     3     4     5     6     7     8  */
27   {0},
28   {-1},
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},
31 };
32
33 static vorbis_info_residue0 _residue_44_high={
34   0,-1, -1, 10,-1,
35   /*  0     1     2     3     4     5     6     7     8  */
36   {0},
37   {-1},
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},
40 };
41
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}}
48 };
49
50 static static_bookblock _resbook_44s_0={
51   {
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}
56    }
57 };
58 static static_bookblock _resbook_44sm_0={
59   {
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}
64    }
65 };
66 static static_bookblock _resbook_44s_1={
67   {
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}
72    }
73 };
74 static static_bookblock _resbook_44sm_1={
75   {
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}
80    }
81 };
82 static static_bookblock _resbook_44s_2={
83   {
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}
88    }
89 };
90 static static_bookblock _resbook_44s_3={
91   {
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}
96    }
97 };
98 static static_bookblock _resbook_44s_4={
99   {
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}
104    }
105 };
106 static static_bookblock _resbook_44s_5={
107   {
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}
112    }
113 };
114 static static_bookblock _resbook_44s_6={
115   {
116     {0},{0,0,&_44c6_s_p1_0},{0,0,&_44c6_s_p2_0},{0,0,&_44c6_s_p3_0},
117     {0,0,&_44c6_s_p4_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}
123    }
124 };
125 static static_bookblock _resbook_44s_7={
126   {
127     {0},{0,0,&_44c7_s_p1_0},{0,0,&_44c7_s_p2_0},{0,0,&_44c7_s_p3_0},
128     {0,0,&_44c7_s_p4_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}
134    }
135 };
136 static static_bookblock _resbook_44s_8={
137   {
138     {0},{0,0,&_44c8_s_p1_0},{0,0,&_44c8_s_p2_0},{0,0,&_44c8_s_p3_0},
139     {0,0,&_44c8_s_p4_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}
145    }
146 };
147 static static_bookblock _resbook_44s_9={
148   {
149     {0},{0,0,&_44c9_s_p1_0},{0,0,&_44c9_s_p2_0},{0,0,&_44c9_s_p3_0},
150     {0,0,&_44c9_s_p4_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}
156    }
157 };
158
159
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},
164
165   {2,0,  &_residue_44_mid,
166    &_huff_book__44c0_s_long,&_huff_book__44c0_sm_long,
167    &_resbook_44s_0,&_resbook_44sm_0}
168 };
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},
173
174   {2,0,  &_residue_44_mid,
175    &_huff_book__44c1_s_long,&_huff_book__44c1_sm_long,
176    &_resbook_44s_1,&_resbook_44sm_1}
177 };
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},
182
183   {2,0,  &_residue_44_mid,
184    &_huff_book__44c2_s_long,&_huff_book__44c2_sm_long,
185    &_resbook_44s_2,&_resbook_44s_2}
186 };
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},
191
192   {2,0,  &_residue_44_mid,
193    &_huff_book__44c3_s_long,&_huff_book__44c3_sm_long,
194    &_resbook_44s_3,&_resbook_44s_3}
195 };
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},
200
201   {2,0,  &_residue_44_mid,
202    &_huff_book__44c4_s_long,&_huff_book__44c4_sm_long,
203    &_resbook_44s_4,&_resbook_44s_4}
204 };
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},
209
210   {2,0,  &_residue_44_mid,
211    &_huff_book__44c5_s_long,&_huff_book__44c5_sm_long,
212    &_resbook_44s_5,&_resbook_44s_5}
213 };
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},
218
219   {2,0,  &_residue_44_high,
220    &_huff_book__44c6_s_long,&_huff_book__44c6_sm_long,
221    &_resbook_44s_6,&_resbook_44s_6}
222 };
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},
227
228   {2,0,  &_residue_44_high,
229    &_huff_book__44c7_s_long,&_huff_book__44c7_sm_long,
230    &_resbook_44s_7,&_resbook_44s_7}
231 };
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},
236
237   {2,0,  &_residue_44_high,
238    &_huff_book__44c8_s_long,&_huff_book__44c8_sm_long,
239    &_resbook_44s_8,&_resbook_44s_8}
240 };
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},
245
246   {2,0,  &_residue_44_high,
247    &_huff_book__44c9_s_long,&_huff_book__44c9_sm_long,
248    &_resbook_44s_9,&_resbook_44s_9}
249 };
250
251
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 */
263 };