Accidentally committed some in-progress encoder changes that broke
[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 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_E.h,v 1.14 2001/06/18 09:07:32 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_350_1024_7.vqh"
46
47
48 static vorbis_info_psy _psy_set_E0={
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    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1000*/
74    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*1400*/
75    {-40.,-45.,-45.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*2000*/
76    {-40.,-45.,-45.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*2800*/
77    {-40.,-45.,-45.,-45.,-45.,-55.,-65.,-75.,-85.,-95.,-105.}, /*4000*/
78    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*5600*/
79    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*8000*/
80    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*11500*/
81    {-40.,-40.,-40.,-40.,-40.,-50.,-60.,-70.,-80.,-90.,-100.}, /*16000*/
82   },
83
84   1,/* peakattp */
85   {{-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*63*/
86    {-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*88*/
87    {-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*125*/
88    {-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*175*/
89    {-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*250*/
90    {-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*350*/
91    {-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*500*/
92    {-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*700*/
93    {-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*1000*/
94    {-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*1400*/
95    {-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*2000*/
96    {-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*2600*/
97    {-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*4000*/
98    {-20.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*5600*/
99    {-20.f,-22.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*8000*/
100    {-20.f,-22.f,-22.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*11500*/
101    {-16.f,-20.f,-22.f,-22.f,-24.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f},/*16000*/
102   },
103
104   0,/*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   {0.f},
112  
113   105.f,  /* even decade + 5 is important; saves an rint() later in a
114             tight loop) */
115   -28.,
116 };
117
118 static vorbis_info_psy _psy_set_E={
119   ATH_Bark_dB_lspconservative,
120   1,/*decayp*/
121
122   -100.f,
123   -140.f,
124
125   8,
126
127   /*     0  1  2   3   4   5   6   7   8   9  10  11  12  13  14  15   16   */
128   /* x: 63 88 125 175 250 350 500 700 1k 1.4k 2k 2.8k 4k 5.6k 8k 11.5k 16k Hz */
129   /* y: 0 10 20 30 40 50 60 70 80 90 100 dB */
130    1,/* tonemaskp */
131   /*  0   10   20   30   40   50   60   70   80   90   100 */
132   {
133    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*63*/
134    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*88*/
135    {-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f,-999.f}, /*125*/
136
137    {-40.f,-45.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*175*/
138    {-40.f,-45.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*250*/
139    {-40.f,-45.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*350*/
140    {-40.f,-45.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*500*/
141    {-40.f,-45.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*700*/
142
143    {-40.f,-45.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*1000*/
144    {-40.f,-45.f,-50.f,-50.f,-50.f,-60.f,-70.f,-80.f,-90.f,-99.f,-110.f}, /*1400*/
145    {-40.f,-45.f,-50.f,-50.f,-50.f,-60.f,-70.f,-80.f,-90.f,-99.f,-110.f}, /*2000*/
146    {-40.f,-45.f,-50.f,-50.f,-50.f,-60.f,-70.f,-80.f,-90.f,-99.f,-110.f}, /*2800*/
147    {-40.f,-45.f,-50.f,-50.f,-50.f,-60.f,-70.f,-80.f,-90.f,-99.f,-110.f}, /*4000*/
148    {-40.f,-45.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*5600*/
149
150    {-40.f,-45.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*8000*/
151    {-40.f,-45.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*11500*/
152    {-40.f,-40.f,-45.f,-45.f,-45.f,-55.f,-65.f,-75.f,-85.f,-95.f,-105.f}, /*16000*/
153
154   },
155
156   1,
157   {{-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*63*/
158    {-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*88*/
159    {-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*125*/
160    {-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*175*/
161    {-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*250*/
162    {-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*350*/
163    {-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*500*/
164    {-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*700*/
165    {-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*1000*/
166    {-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*1400*/
167    {-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*2000*/
168    {-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*2800*/
169    {-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f,-28.f},/*4000*/
170    {-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f},/*5600*/
171    {-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f},/*8000*/
172    {-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f},/*11500*/
173    {-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-26.f,-28.f,-28.f,-28.f,-28.f},/*16000*/
174   },
175
176   0,/*noisemaskp */
177   -28.f,  /* suppress any noise curve over maxspec+n */
178   .5f,   /* low window */
179   .5f,   /* high window */
180   25,
181   25,
182   40,
183   {0.f},
184  
185   105.f,  /* even decade + 5 is important; saves an rint() later in a
186             tight loop) */
187   -32.,
188
189 };
190
191 /* with GNUisms, this could be short and readable. Oh well */
192 static vorbis_info_time0 _time_set0E={0};
193 static vorbis_info_floor0 _floor_set0E={12, 44100,  64, 10,130, 2, {0,1},
194                                         0.199f, .285f};
195 static vorbis_info_floor0 _floor_set1E={30, 44100, 256, 12,150, 2, {2,3}, 
196                                         .082f, .126f};
197 static vorbis_info_residue0 _residue_set0E={0,128,16,6,4,
198                                             {0,1,1,1,1,1},
199                                             {6,7,8,9,10},
200                                             
201                                             {0,99999,9999,9999,9999},
202                                             {999.f,1.5f,2.5f,6.5f,40.5f},
203                                             {4,4,4,4,4},
204                                             {99,99,99,99,99}};
205
206 static vorbis_info_residue0 _residue_set1E={0,1024, 32,8,5,
207                                             {0,1,1,1,1,1,1,1,1,1},
208                                             {11,12,13,14,15,16,17,18,19},
209                                            
210                                             {0,9999,9999,60,9999,
211                                              9999,9999},
212                                             {999.f,2.5f,4.5f,10.5f,10.5f,
213                                              20.5f,40.f},
214                                             {5,5,5,5,5,5,5},
215                                             {99,99,99,99,99,99,99,99,99}};
216
217 static vorbis_info_mapping0 _mapping_set0E={1, {0,0}, {0}, {0}, {0}, {0}};
218 static vorbis_info_mapping0 _mapping_set1E={1, {0,0}, {0}, {1}, {1}, {1}};
219 static vorbis_info_mode _mode_set0E={0,0,0,0};
220 static vorbis_info_mode _mode_set1E={1,0,0,1};
221
222 /* CD quality stereo, no channel coupling */
223 codec_setup_info info_E={
224
225   /* smallblock, largeblock */
226   {256, 2048}, 
227   /* modes,maps,times,floors,residues,books,psys */
228   2,          2,    1,     2,       2,   18,   2,
229   /* modes */
230   {&_mode_set0E,&_mode_set1E},
231   /* maps */
232   {0,0},{&_mapping_set0E,&_mapping_set1E},
233   /* times */
234   {0,0},{&_time_set0E},
235   /* floors */
236   {0,0},{&_floor_set0E,&_floor_set1E},
237   /* residue */
238   {0,0},{&_residue_set0E,&_residue_set1E},
239   /* books */
240   {&_vq_book_lsp12_0,       /* 0 */
241    &_vq_book_lsp12_1,       /* 1 */
242    &_vq_book_lsp30_0,      /* 2 */
243    &_vq_book_lsp30_1,      /* 3 */
244
245    &_huff_book_res0_256_128aux,
246    &_huff_book_res0_256_1024aux,
247
248    &_vq_book_res0_256_128_1,
249    &_vq_book_res0_256_128_2,
250    &_vq_book_res0_256_128_3,
251    &_vq_book_res0_256_128_4,
252    &_vq_book_res0_256_128_5,
253
254    &_vq_book_res0_256_1024_1,
255    &_vq_book_res0_256_1024_2,
256    &_vq_book_res0_256_1024_3,
257    &_vq_book_res0_256_1024_4,
258    &_vq_book_res0_256_1024_5,
259    &_vq_book_res0_256_1024_6,
260    &_vq_book_res0_350_1024_7,
261
262   },
263   /* psy */
264   {&_psy_set_E0,&_psy_set_E},
265
266   /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
267   256, {26.f,26.f,26.f,30.f}, {-36.f,-36.f,-36.f,-36.f}, -90.f,
268   
269   -10., 
270
271   0,
272 };
273
274 #define PREDEF_INFO_MAX 0
275
276 #endif