Accidentally committed some in-progress encoder changes that broke
[platform/upstream/libvorbis.git] / lib / modes / mode_D.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: predefined encoding modes
14  last mod: $Id: mode_D.h,v 1.15 2001/06/18 09:07:32 xiphmont Exp $
15
16  ********************************************************************/
17
18 #ifndef _V_MODES_D_H_
19 #define _V_MODES_D_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_D0={
49   ATH_Bark_dB_lspconservative,
50   1,/*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.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1000*/
74    {-35.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1400*/
75    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2000*/
76    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*2800*/
77    {-35.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*4000*/
78    {-35.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*5600*/
79    {-35.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*8000*/
80    {-35.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*11500*/
81    {-35.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*16000*/
82   },
83
84   1,/* peakattp */
85   {{-16.f,-20.f,-20.f,-22.f,-22.f,-22.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*63*/
86    {-16.f,-20.f,-20.f,-22.f,-22.f,-22.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*88*/
87    {-16.f,-20.f,-20.f,-22.f,-22.f,-22.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*125*/
88    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-26.f,-26.f,-26.f,-26.f},/*175*/
89    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-26.f,-26.f,-26.f,-26.f},/*250*/
90    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-26.f,-26.f,-26.f,-26.f},/*350*/
91    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-26.f,-26.f,-26.f,-26.f},/*500*/
92    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-26.f,-26.f,-26.f,-26.f},/*700*/
93    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-26.f,-26.f,-26.f,-26.f},/*1000*/
94    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-22.f,-26.f,-26.f,-26.f,-26.f},/*2000*/
95    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-22.f,-26.f,-26.f,-26.f,-26.f},/*2000*/
96    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-22.f,-26.f,-26.f,-26.f,-26.f},/*2600*/
97    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-22.f,-26.f,-26.f,-26.f,-26.f},/*4000*/
98    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-26.f,-26.f,-26.f},/*5600*/
99    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-26.f,-26.f,-26.f},/*8000*/
100    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-26.f,-26.f,-26.f},/*11500*/
101    {-16.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-26.f,-26.f},/*16000*/
102   },
103
104   1,/*noisemaskp */
105   -20.f,  /* suppress any noise curve over maxspec+n */
106   .5f,   /* low window */
107   .5f,   /* high window */
108   5,
109   5,
110   10,
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    .100f, 0.f,/*700*/
119    .100f, 0.f,/*1000*/
120    .100f, 0.f,/*1400*/
121    .100f, 0.f,/*2000*/
122    .100f, 0.f,/*2800*/
123    .200f, 0.f,/*4000*/
124    .300f, 0.f,/*5600*/
125    .400f, 0.f,/*8000*/
126    .400f, 0.f,/*11500*/
127    .400f, 0.f,/*16000*/
128   },
129  
130   105.f,  /* even decade + 5 is important; saves an rint() later in a
131             tight loop) */
132   -28.,
133 };
134
135 static vorbis_info_psy _psy_set_D={
136   ATH_Bark_dB_lspconservative,
137   1,/*decayp*/
138
139   -100.f,
140   -140.f,
141
142   8,
143
144   /*     0  1  2   3   4   5   6   7   8   9  10  11  12  13  14  15   16   */
145   /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
146   /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
147    1,/* tonemaskp */
148   /*  0   10   20   30   40   50   60   70   80   90   100 */
149   {
150    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*63*/
151    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*88*/
152    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*125*/
153
154    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*175*/
155    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*250*/
156    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*350*/
157    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*500*/
158    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*700*/
159
160    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
161    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
162    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2000*/
163    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2800*/
164    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
165    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
166
167    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*8000*/
168    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*11500*/
169    {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*16000*/
170
171   },
172
173   1,
174   {{-20.f,-20.f,-20.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*63*/
175    {-20.f,-20.f,-20.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*88*/
176    {-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*125*/
177    {-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*175*/
178    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*250*/
179    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*350*/
180    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-28.f,-24.f,-28.f,-28.f,-28.f},/*500*/
181    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*700*/
182    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*1000*/
183    {-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*1400*/
184    {-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*2000*/
185    {-20.f,-20.f,-20.f,-20.f,-24.f,-24.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*2800*/
186    {-20.f,-20.f,-20.f,-20.f,-22.f,-20.f,-24.f,-24.f,-28.f,-28.f,-28.f},/*4000*/
187    {-20.f,-20.f,-20.f,-20.f,-22.f,-20.f,-22.f,-24.f,-28.f,-28.f,-28.f},/*5600*/
188    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-22.f,-24.f,-28.f,-28.f,-28.f},/*8000*/
189    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-22.f,-24.f,-28.f,-28.f,-28.f},/*11500*/
190    {-20.f,-20.f,-20.f,-20.f,-20.f,-20.f,-22.f,-24.f,-28.f,-28.f,-28.f},/*16000*/
191   },
192
193   1,/*noisemaskp */
194   -28.f,  /* suppress any noise curve over maxspec+n */
195   .5f,   /* low window */
196   .5f,   /* high window */
197   25,
198   25,
199   40,
200   {.000f, 0.f, /*63*/
201    .000f, 0.f, /*88*/
202    .000f, 0.f, /*125*/
203    .000f, 0.f, /*175*/
204    .000f, 0.f, /*250*/
205    .000f, 0.f, /*350*/
206    .000f, 0.f, /*500*/
207    .000f, 0.f, /*700*/
208    .000f, 0.f, /*1000*/
209    .000f, 0.f, /*1400*/
210    .000f, 0.f, /*2000*/
211    .000f, 0.f, /*2800*/
212    .050f, 0.f, /*4000*/
213    .100f, 0.f, /*5600*/
214    .100f, 0.f, /*8000*/
215    .120f, 0.f, /*11500*/
216    .150f, 0.f, /*16000*/
217   },
218  
219   105.f,  /* even decade + 5 is important; saves an rint() later in a
220             tight loop) */
221   -32.,
222
223 };
224
225 /* with GNUisms, this could be short and readable. Oh well */
226 static vorbis_info_time0 _time_set0D={0};
227 static vorbis_info_floor0 _floor_set0D={12, 44100,  64, 10,130, 2, {0,1},
228                                         0.199f, .285f};
229 static vorbis_info_floor0 _floor_set1D={30, 44100, 256, 12,150, 2, {2,3}, 
230                                         .082f, .126f};
231 static vorbis_info_residue0 _residue_set0D={0,128,16,6,4,
232                                             {0,1,1,1,1,1},
233                                             {6,7,8,9,10},
234                                             
235                                             {0,99999,9999,9999,9999},
236                                             {999.f,1.5f,2.5f,6.5f,40.5f},
237                                             {4,4,4,4,4},
238                                             {99,99,99,99,99}};
239
240 static vorbis_info_residue0 _residue_set1D={0,1024, 32,8,5,
241                                             {0,1,1,1,1,1,1,1,1,1},
242                                             {11,12,13,14,15,16,17,18,19},
243                                            
244                                             {0,9999,9999,60,9999,
245                                              9999,9999},
246                                             {999.f,2.5f,4.5f,10.5f,10.5f,
247                                              20.5f,40.f},
248                                             {5,5,5,5,5,5,5},
249                                             {99,99,99,99,99,99,99,99,99}};
250
251 static vorbis_info_mapping0 _mapping_set0D={1, {0,0}, {0}, {0}, {0}, {0}};
252 static vorbis_info_mapping0 _mapping_set1D={1, {0,0}, {0}, {1}, {1}, {1}};
253 static vorbis_info_mode _mode_set0D={0,0,0,0};
254 static vorbis_info_mode _mode_set1D={1,0,0,1};
255
256 /* CD quality stereo, no channel coupling */
257 codec_setup_info info_D={
258
259   /* smallblock, largeblock */
260   {256, 2048}, 
261   /* modes,maps,times,floors,residues,books,psys */
262   2,          2,    1,     2,       2,   18,   2,
263   /* modes */
264   {&_mode_set0D,&_mode_set1D},
265   /* maps */
266   {0,0},{&_mapping_set0D,&_mapping_set1D},
267   /* times */
268   {0,0},{&_time_set0D},
269   /* floors */
270   {0,0},{&_floor_set0D,&_floor_set1D},
271   /* residue */
272   {0,0},{&_residue_set0D,&_residue_set1D},
273   /* books */
274   {&_vq_book_lsp12_0,       /* 0 */
275    &_vq_book_lsp12_1,       /* 1 */
276    &_vq_book_lsp30_0,      /* 2 */
277    &_vq_book_lsp30_1,      /* 3 */
278
279    &_huff_book_res0_256_128aux,
280    &_huff_book_res0_256_1024aux,
281
282    &_vq_book_res0_256_128_1,
283    &_vq_book_res0_256_128_2,
284    &_vq_book_res0_256_128_3,
285    &_vq_book_res0_256_128_4,
286    &_vq_book_res0_256_128_5,
287
288    &_vq_book_res0_256_1024_1,
289    &_vq_book_res0_256_1024_2,
290    &_vq_book_res0_256_1024_3,
291    &_vq_book_res0_256_1024_4,
292    &_vq_book_res0_256_1024_5,
293    &_vq_book_res0_256_1024_6,
294    &_vq_book_res0_256_1024_7,
295
296   },
297   /* psy */
298   {&_psy_set_D0,&_psy_set_D},
299
300   /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
301   256, {26.f,26.f,26.f,30.f}, {-36.f,-36.f,-36.f,-36.f}, -90.f,
302   
303   -10., 
304
305   0,
306 };
307
308 #define PREDEF_INFO_MAX 0
309
310 #endif