23c4e5ca527659027587b3965880804302b4f95b
[platform/upstream/libvorbis.git] / lib / modes / mode_C.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_C.h,v 1.10 2001/02/15 19:06:02 xiphmont Exp $
15
16  ********************************************************************/
17
18 #ifndef _V_MODES_C_H_
19 #define _V_MODES_C_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_192_128aux.vqh"
31 #include "books/res0_192_1024aux.vqh"
32
33 #include "books/res0_192_128_1.vqh"
34 #include "books/res0_192_128_2.vqh"
35 #include "books/res0_192_128_3.vqh"
36 #include "books/res0_192_128_4.vqh"
37 #include "books/res0_192_128_5.vqh"
38
39 #include "books/res0_192_1024_1.vqh"
40 #include "books/res0_192_1024_2.vqh"
41 #include "books/res0_192_1024_3.vqh"
42 #include "books/res0_192_1024_4.vqh"
43 #include "books/res0_192_1024_5.vqh"
44 #include "books/res0_192_1024_6.vqh"
45 #include "books/res0_192_1024_7.vqh"
46 #include "books/res0_192_1024_8.vqh"
47 #include "books/res0_192_1024_9.vqh"
48
49
50 static vorbis_info_psy _psy_set_C0={
51   1,/*athp*/
52   0,/*decayp*/
53
54   -100.,
55   -140.,
56
57   8,
58
59   /*     0  1  2   3   4   5   6   7   8   9  10  11  12  13  14  15   16   */
60   /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
61   /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
62
63    1,/* tonemaskp */
64   /*  0   10   20   30   40   50   60   70   80   90   100 */
65   {
66    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*63*/
67    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*88*/
68    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*125*/
69    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*175*/
70    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*250*/
71    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*350*/
72    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*500*/
73    {-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.,-999.}, /*700*/
74
75    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1000*/
76    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1400*/
77    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2000*/
78    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2800*/
79    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*4000*/
80    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*5600*/
81    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*8000*/
82    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*11500*/
83    {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*16000*/
84   },
85
86   1,/* peakattp */
87   {{-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*63*/
88    {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*88*/
89    {-14.f,-16.f,-18.f,-19.f,-20.f,-21.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*125*/
90    {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*175*/
91    {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*250*/
92    {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*350*/
93    {-14.f,-14.f,-14.f,-14.f,-16.f,-16.f,-20.f,-24.f,-28.f,-28.f,-28.f},/*500*/
94    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*700*/
95    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-24.f,-28.f,-28.f,-28.f},/*1000*/
96    {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*1400*/
97    {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*2000*/
98    {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*2400*/
99    {-14.f,-14.f,-14.f,-14.f,-14.f,-16.f,-18.f,-24.f,-28.f,-28.f,-28.f},/*4000*/
100    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-12.f,-20.f,-28.f,-28.f,-28.f},/*5600*/
101    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-28.f,-28.f,-28.f},/*8000*/
102    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-28.f,-28.f,-28.f},/*11500*/
103    {-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-14.f,-20.f,-24.f,-28.f},/*16000*/
104   },
105
106   1,/*noisemaskp */
107   -10.f,  /* suppress any noise curve over maxspec+n */
108   .5f,   /* low window */
109   .5f,   /* high window */
110   5,
111   5,
112   {.000f, 0.f,/*63*/
113    .000f, 0.f,/*88*/
114    .000f, 0.f,/*125*/
115    .000f, 0.f,/*175*/
116    .000f, 0.f,/*250*/
117    .000f, 0.f,/*350*/
118    .000f, 0.f,/*500*/
119    .000f, 0.f,/*700*/
120    .200f, 0.f,/*1000*/
121    .300f, 0.f,/*1400*/
122    .400f, 0.f,/*2000*/
123    .600f, -2.f,/*2800*/
124    .600f, -2.f,/*4000*/
125    .700f, -2.f,/*5600*/
126    .850f, -2.f,/*8000*/
127    .850f, -1.f,/*11500*/
128    .850f,  0.f,/*16000*/
129   },
130
131   105.f,  /* even decade + 5 is important; saves an rint() later in a
132             tight loop) */
133   -28.,
134
135   -0., -.004   /* attack/decay control */
136 };
137
138 static vorbis_info_psy _psy_set_C={
139   1,/*athp*/
140   0,/*decayp*/
141
142   -100.f,
143   -140.f,
144
145   8,
146
147   /*     0  1  2   3   4   5   6   7   8   9  10  11  12  13  14  15   16   */
148   /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
149   /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
150    1,/* tonemaskp */
151   /*  0   10   20   30   40   50   60   70   80   90   100 */
152   {
153    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*63*/
154    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*88*/
155    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*125*/
156    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*175*/
157    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*250*/
158    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*350*/
159    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*500*/
160    //   {-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-99.,-100.}, /*700*/
161
162    //   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*63*/
163    //   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*88*/
164    //   {-30.,-35.,-35.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*125*/
165    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*175*/
166    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*250*/
167    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*350*/
168    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*500*/
169    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*700*/
170
171    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
172    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
173    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2000*/
174    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2800*/
175    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
176    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
177
178    {-30.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*8000*/
179    {-30.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*11500*/
180    {-30.f,-35.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*16000*/
181
182   },
183
184   1,
185   {{-20.f,-20.f,-20.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*63*/
186    {-20.f,-20.f,-20.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*88*/
187    {-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*125*/
188    {-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*175*/
189    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*250*/
190    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*350*/
191    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-28.f,-24.f,-28.f,-28.f,-28.f},/*500*/
192    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*700*/
193    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*1000*/
194    {-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*1400*/
195    {-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*2000*/
196    {-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*2800*/
197    {-20.f,-20.f,-20.f,-20.f,-22.f,-20.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*4000*/
198    {-20.f,-20.f,-20.f,-20.f,-22.f,-20.f,-22.f,-24.f,-28.f,-28.f,-28.f},/*5600*/
199    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-22.f,-24.f,-28.f,-28.f,-28.f},/*8000*/
200    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-22.f,-24.f,-28.f,-28.f,-28.f},/*11500*/
201    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-22.f,-24.f,-28.f,-28.f,-28.f},/*16000*/
202   },
203
204   1,/*noisemaskp */
205   -15.f,  /* suppress any noise curve over maxspec+n */
206   .5f,   /* low window */
207   .5f,   /* high window */
208   25,
209   25,
210   {.000f, 0.f, /*63*/
211    .000f, 0.f, /*88*/
212    .000f, 0.f, /*125*/
213    .000f, 0.f, /*175*/
214    .000f, 0.f, /*250*/
215    .000f, 0.f, /*350*/
216    .000f, 0.f, /*500*/
217    .200f, -6.f, /*700*/
218    .300f, -6.f, /*1000*/
219    .400f, -6.f, /*1400*/
220    .400f, -6.f, /*2000*/
221    .400f, -6.f, /*2800*/
222    .700f, -6.f, /*4000*/
223    .850f, -6.f, /*5600*/
224    .850f, -5.f, /*8000*/
225    .850f, -4.f, /*11500*/
226    .850f, -3.f, /*16000*/
227   },
228  
229   105.f,  /* even decade + 5 is important; saves an rint() later in a
230             tight loop) */
231   -32.,
232
233   -0.f, -.004f,   /* attack/decay control */
234
235 };
236
237 /* with GNUisms, this could be short and readable. Oh well */
238 static vorbis_info_time0 _time_set0C={0};
239 static vorbis_info_floor0 _floor_set0C={12, 44100,  64, 10,130, 2, {0,1},
240                                         0.199f, .285f};
241 static vorbis_info_floor0 _floor_set1C={30, 44100, 256, 12,150, 2, {2,3}, 
242                                         .082f, .126f};
243 static vorbis_info_residue0 _residue_set0C={0,128,16,6,4,
244                                             {0,1,1,1,1,1},
245                                             {6,7,8,9,10},
246                                             
247                                             {0,99999,9999,9999,9999},
248                                             {999.f,1.5f,3.5f,15.5f,26.5f},
249                                             {4,4,4,4,4},
250                                             {99,99,99,99,99}};
251
252 static vorbis_info_residue0 _residue_set1C={0,1024, 32,10,5,
253                                             {0,1,1,1,1,1,1,1,1,1},
254                                             {11,12,13,14,15,16,17,18,19},
255                                            
256                                             {0,8,9999,18,9999,
257                                              24,9999,9999,9999},
258                                             {999.f,1.5f,1.5f,2.5f,2.5f,
259                                              6.5f,6.5f,14.5f,30.f},
260                                             {5,5,5,5,5,5,5,5,5},
261                                             {99,99,99,99,99,99,99,99,99}};
262
263 static vorbis_info_mapping0 _mapping_set0C={1, {0,0}, {0}, {0}, {0}, {0}};
264 static vorbis_info_mapping0 _mapping_set1C={1, {0,0}, {0}, {1}, {1}, {1}};
265 static vorbis_info_mode _mode_set0C={0,0,0,0};
266 static vorbis_info_mode _mode_set1C={1,0,0,1};
267
268 /* CD quality stereo, no channel coupling */
269 codec_setup_info info_C={
270
271   /* smallblock, largeblock */
272   {256, 2048}, 
273   /* modes,maps,times,floors,residues,books,psys */
274   2,          2,    1,     2,       2,   20,   2,
275   /* modes */
276   {&_mode_set0C,&_mode_set1C},
277   /* maps */
278   {0,0},{&_mapping_set0C,&_mapping_set1C},
279   /* times */
280   {0,0},{&_time_set0C},
281   /* floors */
282   {0,0},{&_floor_set0C,&_floor_set1C},
283   /* residue */
284   {0,0},{&_residue_set0C,&_residue_set1C},
285   /* books */
286   {&_vq_book_lsp12_0,       /* 0 */
287    &_vq_book_lsp12_1,       /* 1 */
288    &_vq_book_lsp30_0,      /* 2 */
289    &_vq_book_lsp30_1,      /* 3 */
290
291    &_huff_book_res0_192_128aux,
292    &_huff_book_res0_192_1024aux,
293
294    &_vq_book_res0_192_128_1,
295    &_vq_book_res0_192_128_2,
296    &_vq_book_res0_192_128_3,
297    &_vq_book_res0_192_128_4,
298    &_vq_book_res0_192_128_5,
299
300    &_vq_book_res0_192_1024_1,
301    &_vq_book_res0_192_1024_2,
302    &_vq_book_res0_192_1024_3,
303    &_vq_book_res0_192_1024_4,
304    &_vq_book_res0_192_1024_5,
305    &_vq_book_res0_192_1024_6,
306    &_vq_book_res0_192_1024_7,
307    &_vq_book_res0_192_1024_8,
308    &_vq_book_res0_192_1024_9,
309
310   },
311   /* psy */
312   {&_psy_set_C0,&_psy_set_C},
313   /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
314   256, {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f,
315
316   -15., 
317
318   0,
319 };
320
321 #define PREDEF_INFO_MAX 0
322
323 #endif