b7cfa95a183580477e4eb661bd6effbde9165e18
[platform/upstream/libvorbis.git] / lib / modes / mode_E.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-2001             *
9  * by the XIPHOPHORUS Company http://www.xiph.org/                  *
10  *                                                                  *
11  ********************************************************************
12
13  function: predefined encoding modes
14  last mod: $Id: mode_E.h,v 1.9 2001/02/15 19:06:02 xiphmont Exp $
15
16  ********************************************************************/
17
18 #ifndef _V_MODES_E_H_
19 #define _V_MODES_E_H_
20
21 #include <stdio.h>
22 #include "vorbis/codec.h"
23 #include "backends.h"
24
25 #include "books/lsp12_0.vqh"
26 #include "books/lsp30_0.vqh"
27 #include "books/lsp12_1.vqh"
28 #include "books/lsp30_1.vqh"
29
30 #include "books/res0_256_128aux.vqh"
31 #include "books/res0_256_1024aux.vqh"
32
33 #include "books/res0_256_128_1.vqh"
34 #include "books/res0_256_128_2.vqh"
35 #include "books/res0_256_128_3.vqh"
36 #include "books/res0_256_128_4.vqh"
37 #include "books/res0_256_128_5.vqh"
38
39 #include "books/res0_256_1024_1.vqh"
40 #include "books/res0_256_1024_2.vqh"
41 #include "books/res0_256_1024_3.vqh"
42 #include "books/res0_256_1024_4.vqh"
43 #include "books/res0_256_1024_5.vqh"
44 #include "books/res0_256_1024_6.vqh"
45 #include "books/res0_256_1024_7.vqh"
46
47
48 static vorbis_info_psy _psy_set_E0={
49   1,/*athp*/
50   0,/*decayp*/
51
52   -100.,
53   -140.,
54
55   8,
56
57   /*     0  1  2   3   4   5   6   7   8   9  10  11  12  13  14  15   16   */
58   /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
59   /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
60
61    1,/* tonemaskp */
62   /*  0   10   20   30   40   50   60   70   80   90   100 */
63   {
64    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*63*/
65    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*88*/
66    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*125*/
67    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*175*/
68    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*250*/
69    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*350*/
70    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*500*/
71    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*700*/
72
73    {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*1000*/
74    {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*1400*/
75    {-45.,-45.,-45.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*2000*/
76    {-45.,-45.,-45.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*2800*/
77    {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*4000*/
78    {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*5600*/
79    {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*8000*/
80    {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*11500*/
81    {-35.,-35.,-35.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*16000*/
82   },
83
84   1,/* peakattp */
85   {{-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*63*/
86    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*88*/
87    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*125*/
88    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*175*/
89    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*250*/
90    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*350*/
91    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*500*/
92    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*700*/
93    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*1000*/
94    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*1400*/
95    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*2000*/
96    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*2800*/
97    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*4000*/
98
99    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*5600*/
100    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*8000*/
101    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*11500*/
102    {-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-24.f,-28.f},/*16000*/
103   },
104
105   1,/*noisemaskp */
106   -30.f,  /* suppress any noise curve over maxspec+n */
107   .5f,   /* low window */
108   .5f,   /* high window */
109   5,
110   5,
111   {.000f, 0.f,/*63*/
112    .000f, 0.f,/*88*/
113    .000f, 0.f,/*125*/
114    .000f, 0.f,/*175*/
115    .000f, 0.f,/*250*/
116    .000f, 0.f,/*350*/
117    .000f, 0.f,/*500*/
118    .000f, 0.f,/*700*/
119    .000f,  0.f,/*1000*/
120    .000f,  0.f,/*1400*/
121    .000f,  0.f,/*2000*/
122    .000f,  0.f,/*2800*/
123    .000f,  0.f,/*4000*/
124    .500f, -6.f,/*5600*/
125    .500f, -6.f,/*8000*/
126    .500f, -5.f,/*11500*/
127    .500f, -4.f,/*16000*/
128   },
129
130   105.f,  /* even decade + 5 is important; saves an rint() later in a
131             tight loop) */
132   -32.,
133
134   -0., -.004   /* attack/decay control */
135 };
136
137 static vorbis_info_psy _psy_set_E={
138   1,/*athp*/
139   0,/*decayp*/
140
141   -100.f,
142   -140.f,
143
144   8,
145
146   /*     0  1  2   3   4   5   6   7   8   9  10  11  12  13  14  15   16   */
147   /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
148   /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
149    1,/* tonemaskp */
150   /*  0   10   20   30   40   50   60   70   80   90   100 */
151   {
152    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*63*/
153    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*88*/
154    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*125*/
155    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*175*/
156    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*250*/
157    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*350*/
158    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*500*/
159    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*700*/
160
161    //   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*63*/
162    //   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*88*/
163    //   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*125*/
164    {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*175*/
165    {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*250*/
166    {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*350*/
167    {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*500*/
168    {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*700*/
169    {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*1000*/
170    {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*1400*/
171    {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*2000*/
172    {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*2800*/
173    {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*4000*/
174    {-45.f,-45.f,-45.f,-45.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*5600*/
175    {-35.f,-45.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*8000*/
176    {-35.f,-45.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*11500*/
177    {-35.f,-35.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*16000*/
178
179   },
180
181   1,
182   {{-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*63*/
183    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*88*/
184    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*125*/
185    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*175*/
186    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*250*/
187    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*350*/
188    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*500*/
189    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*700*/
190    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*1000*/
191    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*1400*/
192    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*2800*/
193    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*2800*/
194    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*4000*/
195    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*5600*/
196    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*8000*/
197    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*11500*/
198    {-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*16000*/
199   },
200
201   0,/*noisemaskp */
202   -15.f,  /* suppress any noise curve over maxspec+n */
203   .5f,   /* low window */
204   .5f,   /* high window */
205   25,
206   25,
207   {.000f, 0.f, /*63*/
208    .000f, 0.f, /*88*/
209    .000f, 0.f, /*125*/
210    .000f, 0.f, /*175*/
211    .000f, 0.f, /*250*/
212    .000f, 0.f, /*350*/
213    .000f, 0.f, /*500*/
214    .000f, 0.f, /*700*/
215    .000f, 0.f, /*1000*/
216    .000f, 0.f, /*1400*/
217    .000f, 0.f, /*2000*/
218    .000f, 0.f, /*2800*/
219    .000f, 0.f, /*4000*/
220    .500f, -12.f, /*5600*/
221    .500f, -12.f, /*8000*/
222    .500f, -10.f, /*11500*/
223    .500f, -10.f, /*16000*/
224   },
225  
226   105.f,  /* even decade + 5 is important; saves an rint() later in a
227             tight loop) */
228   -32.,
229
230   -0.f, -.004f,   /* attack/decay control */
231
232 };
233
234 /* with GNUisms, this could be short and readable. Oh well */
235 static vorbis_info_time0 _time_set0E={0};
236 static vorbis_info_floor0 _floor_set0E={12, 44100,  64, 10,130, 2, {0,1},
237                                         0.199f, .285f};
238 static vorbis_info_floor0 _floor_set1E={30, 44100, 256, 12,150, 2, {2,3}, 
239                                         .082f, .126f};
240 static vorbis_info_residue0 _residue_set0E={0,128,16,6,4,
241                                             {0,1,1,1,1,1},
242                                             {6,7,8,9,10},
243                                             
244                                             {0,99999,9999,9999,9999},
245                                             {999.f,1.5f,2.5f,6.5f,40.5f},
246                                             {4,4,4,4,4},
247                                             {99,99,99,99,99}};
248
249 static vorbis_info_residue0 _residue_set1E={0,1024, 32,8,5,
250                                             {0,1,1,1,1,1,1,1,1,1},
251                                             {11,12,13,14,15,16,17,18,19},
252                                            
253                                             {0,9999,9999,60,9999,
254                                              9999,9999},
255                                             {999.f,2.5f,4.5f,10.5f,10.5f,
256                                              20.5f,40.f},
257                                             {5,5,5,5,5,5,5},
258                                             {99,99,99,99,99,99,99,99,99}};
259
260 static vorbis_info_mapping0 _mapping_set0E={1, {0,0}, {0}, {0}, {0}, {0}};
261 static vorbis_info_mapping0 _mapping_set1E={1, {0,0}, {0}, {1}, {1}, {1}};
262 static vorbis_info_mode _mode_set0E={0,0,0,0};
263 static vorbis_info_mode _mode_set1E={1,0,0,1};
264
265 /* CD quality stereo, no channel coupling */
266 codec_setup_info info_E={
267
268   /* smallblock, largeblock */
269   {256, 2048}, 
270   /* modes,maps,times,floors,residues,books,psys */
271   2,          2,    1,     2,       2,   18,   2,
272   /* modes */
273   {&_mode_set0E,&_mode_set1E},
274   /* maps */
275   {0,0},{&_mapping_set0E,&_mapping_set1E},
276   /* times */
277   {0,0},{&_time_set0E},
278   /* floors */
279   {0,0},{&_floor_set0E,&_floor_set1E},
280   /* residue */
281   {0,0},{&_residue_set0E,&_residue_set1E},
282   /* books */
283   {&_vq_book_lsp12_0,       /* 0 */
284    &_vq_book_lsp12_1,       /* 1 */
285    &_vq_book_lsp30_0,      /* 2 */
286    &_vq_book_lsp30_1,      /* 3 */
287
288    &_huff_book_res0_256_128aux,
289    &_huff_book_res0_256_1024aux,
290
291    &_vq_book_res0_256_128_1,
292    &_vq_book_res0_256_128_2,
293    &_vq_book_res0_256_128_3,
294    &_vq_book_res0_256_128_4,
295    &_vq_book_res0_256_128_5,
296
297    &_vq_book_res0_256_1024_1,
298    &_vq_book_res0_256_1024_2,
299    &_vq_book_res0_256_1024_3,
300    &_vq_book_res0_256_1024_4,
301    &_vq_book_res0_256_1024_5,
302    &_vq_book_res0_256_1024_6,
303    &_vq_book_res0_256_1024_7,
304
305   },
306   /* psy */
307   {&_psy_set_E0,&_psy_set_E},
308   /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
309   256, {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f,
310
311   -15., 
312
313   0,
314 };
315
316 #define PREDEF_INFO_MAX 0
317
318 #endif