Oops, had postecho turned up too high
[platform/upstream/libvorbis.git] / lib / modes / mode_B.h
1 /********************************************************************
2  *                                                                  *
3  * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
4  * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5  * THE GNU LESSER/LIBRARY PUBLIC LICENSE, WHICH IS INCLUDED WITH    *
6  * THIS SOURCE. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.        *
7  *                                                                  *
8  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2000             *
9  * by Monty <monty@xiph.org> and the XIPHOPHORUS Company            *
10  * http://www.xiph.org/                                             *
11  *                                                                  *
12  ********************************************************************
13
14  function: predefined encoding modes
15  last mod: $Id: mode_B.h,v 1.9 2001/02/01 01:05:09 xiphmont Exp $
16
17  ********************************************************************/
18
19 #ifndef _V_MODES_B_H_
20 #define _V_MODES_B_H_
21
22 #include <stdio.h>
23 #include "vorbis/codec.h"
24 #include "backends.h"
25
26 #include "books/lsp12_0.vqh"
27 #include "books/lsp30_0.vqh"
28 #include "books/lsp12_1.vqh"
29 #include "books/lsp30_1.vqh"
30
31 #include "books/res0_160_128aux.vqh"
32 #include "books/res0_160_1024aux.vqh"
33
34 #include "books/res0_160_128_1.vqh"
35 #include "books/res0_160_128_2.vqh"
36 #include "books/res0_160_128_3.vqh"
37 #include "books/res0_160_128_4.vqh"
38 #include "books/res0_160_128_5.vqh"
39
40 #include "books/res0_160_1024_1.vqh"
41 #include "books/res0_160_1024_2.vqh"
42 #include "books/res0_160_1024_3.vqh"
43 #include "books/res0_160_1024_4.vqh"
44 #include "books/res0_160_1024_5.vqh"
45 #include "books/res0_160_1024_6.vqh"
46 #include "books/res0_160_1024_7.vqh"
47 #include "books/res0_160_1024_8.vqh"
48 #include "books/res0_160_1024_9.vqh"
49
50
51 static vorbis_info_psy _psy_set_B0={
52   1,/*athp*/
53   1,/*decayp*/
54
55   -100.,
56   -140.,
57
58   8,
59
60   /*     0  1  2   3   4   5   6   7   8   9  10  11  12  13  14  15   16   */
61   /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
62   /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
63
64    1,/* tonemaskp */
65   /*  0   10   20   30   40   50   60   70   80   90   100 */
66   {
67    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*63*/
68    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*88*/
69    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*125*/
70    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*175*/
71    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*250*/
72    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*350*/
73    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*500*/
74    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*700*/
75
76    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1000*/
77    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1400*/
78    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2000*/
79    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2800*/
80    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*4000*/
81    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*5600*/
82    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*8000*/
83    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*11500*/
84    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*16000*/
85   },
86
87   1,/* peakattp */
88   {{-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*63*/
89    {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*88*/
90    {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*125*/
91    {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*175*/
92    {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*250*/
93    {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*350*/
94    {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*500*/
95    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*700*/
96    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-24.f,-28.f,-28.f,-28.f},/*1000*/
97    {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*1400*/
98    {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*2000*/
99    {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*2400*/
100    {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*4000*/
101    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-12.f,-20.f,-28.f,-28.f,-28.f},/*5600*/
102    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-28.f,-28.f,-28.f},/*8000*/
103    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-28.f,-28.f,-28.f},/*11500*/
104    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-24.f,-28.f},/*16000*/
105   },
106
107   1,/*noisemaskp */
108   -10.f,  /* suppress any noise curve over maxspec+n */
109   .5f,   /* low window */
110   .5f,   /* high window */
111   5,
112   5,
113   {.000f, 0.f,/*63*/
114    .000f, 0.f,/*88*/
115    .000f, 0.f,/*125*/
116    .000f, 0.f,/*175*/
117    .000f, 0.f,/*250*/
118    .000f, 0.f,/*350*/
119    .000f, 0.f,/*500*/
120    .300f, 0.f,/*700*/
121    .500f, 0.f,/*1000*/
122    .500f, 0.f,/*1400*/
123    .500f, 0.f,/*2000*/
124    .500f, 0.f,/*2800*/
125    .600f, 0.f,/*4000*/
126    .700f, 0.f,/*5600*/
127    .850f, 0.f,/*8000*/
128    .900f, 0.f,/*11500*/
129    .900f, 0.f,/*16000*/
130   },
131  
132   105.f,  /* even decade + 5 is important; saves an rint() later in a
133             tight loop) */
134   -28.,
135
136   -0., -.004   /* attack/decay control */
137 };
138
139 static vorbis_info_psy _psy_set_B={
140   1,/*athp*/
141   1,/*decayp*/
142
143   -100.f,
144   -140.f,
145
146   8,
147
148   /*     0  1  2   3   4   5   6   7   8   9  10  11  12  13  14  15   16   */
149   /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
150   /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
151    1,/* tonemaskp */
152   /*  0   10   20   30   40   50   60   70   80   90   100 */
153   {
154    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*63*/
155    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*88*/
156    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*125*/
157    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*175*/
158    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*250*/
159    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*350*/
160    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*500*/
161    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*700*/
162
163    //   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*63*/
164    //   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*88*/
165    //   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*125*/
166    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*175*/
167    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*250*/
168    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*350*/
169    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*500*/
170    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*700*/
171
172    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
173    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
174    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2000*/
175    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2800*/
176    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
177    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
178
179    {-30.f,-35.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*8000*/
180    {-30.f,-35.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*11500*/
181    {-30.f,-34.f,-36.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*16000*/
182
183   },
184
185   1,/* peakattp */
186   {{-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*63*/
187    {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*88*/
188    {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*125*/
189    {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*175*/
190    {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*250*/
191    {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*350*/
192    {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*500*/
193    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*700*/
194    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-24.f,-28.f,-28.f,-28.f},/*1000*/
195    {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*1400*/
196    {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*2000*/
197    {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*2400*/
198    {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*4000*/
199    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-12.f,-20.f,-28.f,-28.f,-28.f},/*5600*/
200    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-28.f,-28.f,-28.f},/*8000*/
201    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-28.f,-28.f,-28.f},/*11500*/
202    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-24.f,-28.f},/*16000*/
203   },
204
205   1,/*noisemaskp */
206   -10.f,  /* suppress any noise curve over maxspec+n */
207   .5f,   /* low window */
208   .5f,   /* high window */
209   25,
210   25,
211   {.000f, 0.f, /*63*/
212    .000f, 0.f, /*88*/
213    .000f, 0.f, /*125*/
214    .000f, 0.f, /*175*/
215    .000f, 0.f, /*250*/
216    .000f, 0.f, /*350*/
217    .000f, 0.f, /*500*/
218    .200f, -2.f, /*700*/
219    .300f, -2.f, /*1000*/
220    .400f, -2.f, /*1400*/
221    .400f, -2.f, /*2000*/
222    .400f, -2.f, /*2800*/
223    .700f, -2.f, /*4000*/
224    .850f, -3.f, /*5600*/
225    .900f, -3.f, /*8000*/
226    .900f, -3.f, /*11500*/
227    .900f, -3.f, /*16000*/
228   },
229  
230   105.f,  /* even decade + 5 is important; saves an rint() later in a
231             tight loop) */
232   -32.,
233
234   -0.f, -.004f,   /* attack/decay control */
235
236 };
237
238 /* with GNUisms, this could be short and readable. Oh well */
239 static vorbis_info_time0 _time_set0B={0};
240 static vorbis_info_floor0 _floor_set0B={12, 44100,  64, 10,130, 2, {0,1},
241                                         0.199f, .285f};
242 static vorbis_info_floor0 _floor_set1B={30, 44100, 256, 12,150, 2, {2,3}, 
243                                         .082f, .126f};
244 static vorbis_info_residue0 _residue_set0B={0,96,16,6,4,
245                                             {0,1,1,1,1,1},
246                                             {6,7,8,9,10},
247                                             
248                                             {0,99999,9999,9999,9999},
249                                             {999.f,1.5f,3.5f,15.5f,26.5f},
250                                             {4,4,4,4,4},
251                                             {99,99,99,99,99}};
252
253 static vorbis_info_residue0 _residue_set1B={0,1024, 32,10,5,
254                                             {0,1,1,1,1,1,1,1,1,1},
255                                             {11,12,13,14,15,16,17,18,19},
256                                            
257                                             {0,8,9999,18,9999,
258                                              24,9999,9999,9999},
259                                             {999.f,1.5f,1.5f,2.5f,2.5f,
260                                              6.5f,6.5f,14.5f,30.f},
261                                             {5,5,5,5,5,5,5,5,5},
262                                             {99,99,99,99,99,99,99,99,99}};
263
264 static vorbis_info_mapping0 _mapping_set0B={1, {0,0}, {0}, {0}, {0}, {0}};
265 static vorbis_info_mapping0 _mapping_set1B={1, {0,0}, {0}, {1}, {1}, {1}};
266 static vorbis_info_mode _mode_set0B={0,0,0,0};
267 static vorbis_info_mode _mode_set1B={1,0,0,1};
268
269 /* CD quality stereo, no channel coupling */
270 codec_setup_info info_B={
271
272   /* smallblock, largeblock */
273   {256, 2048}, 
274   /* modes,maps,times,floors,residues,books,psys */
275   2,          2,    1,     2,       2,   20,   2,
276   /* modes */
277   {&_mode_set0B,&_mode_set1B},
278   /* maps */
279   {0,0},{&_mapping_set0B,&_mapping_set1B},
280   /* times */
281   {0,0},{&_time_set0B},
282   /* floors */
283   {0,0},{&_floor_set0B,&_floor_set1B},
284   /* residue */
285   {0,0},{&_residue_set0B,&_residue_set1B},
286   /* books */
287   {&_vq_book_lsp12_0,       /* 0 */
288    &_vq_book_lsp12_1,       /* 1 */
289    &_vq_book_lsp30_0,      /* 2 */
290    &_vq_book_lsp30_1,      /* 3 */
291
292    &_huff_book_res0_160_128aux,
293    &_huff_book_res0_160_1024aux,
294
295    &_vq_book_res0_160_128_1,
296    &_vq_book_res0_160_128_2,
297    &_vq_book_res0_160_128_3,
298    &_vq_book_res0_160_128_4,
299    &_vq_book_res0_160_128_5,
300
301    &_vq_book_res0_160_1024_1,
302    &_vq_book_res0_160_1024_2,
303    &_vq_book_res0_160_1024_3,
304    &_vq_book_res0_160_1024_4,
305    &_vq_book_res0_160_1024_5,
306    &_vq_book_res0_160_1024_6,
307    &_vq_book_res0_160_1024_7,
308    &_vq_book_res0_160_1024_8,
309    &_vq_book_res0_160_1024_9,
310
311   },
312   /* psy */
313   {&_psy_set_B0,&_psy_set_B},
314   /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
315   256, 20.f, -24.f, -96.f,
316
317   -10., 
318
319   0,
320 };
321
322 #define PREDEF_INFO_MAX 0
323
324 #endif