Add modes Dc and Ec
[platform/upstream/libvorbis.git] / lib / modes / mode_Za.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_Za.h,v 1.2 2001/08/13 01:37:14 xiphmont Exp $
15
16  ********************************************************************/
17
18 #ifndef _V_MODES_ZA_H_
19 #define _V_MODES_ZA_H_
20
21 #include <stdio.h>
22 #include "vorbis/codec.h"
23 #include "backends.h"
24
25 #include "books/line0_class1.vqh"
26 #include "books/line0_class2.vqh"
27 #include "books/line1_class0.vqh"
28 #include "books/line1_class1.vqh"
29 #include "books/line1_class2.vqh"
30 #include "books/line1_class3.vqh"
31
32 #include "books/line0_0sub0.vqh"
33 #include "books/line0_1sub1.vqh"
34 #include "books/line0_1sub2.vqh"
35 #include "books/line0_1sub3.vqh"
36 #include "books/line0_2sub1.vqh"
37 #include "books/line0_2sub2.vqh"
38 #include "books/line0_2sub3.vqh"
39
40 #include "books/line1_0sub0.vqh"
41 #include "books/line1_0sub1.vqh"
42 #include "books/line1_1sub0.vqh"
43 #include "books/line1_1sub1.vqh"
44 #include "books/line1_2sub1.vqh"
45 #include "books/line1_2sub2.vqh"
46 #include "books/line1_2sub3.vqh"
47 #include "books/line1_3sub1.vqh"
48 #include "books/line1_3sub2.vqh"
49 #include "books/line1_3sub3.vqh"
50
51 #include "books/res0_128_128aux.vqh"
52 #include "books/res0_128_1024aux.vqh"
53
54 #include "books/res0_128_1024_1.vqh"
55 #include "books/res0_128_1024_2.vqh"
56 #include "books/res0_128_1024_3.vqh"
57 #include "books/res0_128_1024_4.vqh"
58 #include "books/res0_128_1024_5.vqh"
59 #include "books/res0_128_1024_5a.vqh"
60 #include "books/res0_128_1024_5b.vqh"
61
62
63 static vorbis_info_psy_global _psy_set_ZaG={
64   0, /* decaydBpms */
65   8,   /* lines per eighth octave */
66   
67   /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
68   256, {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f,
69   -6.f, 
70   
71   0,
72 };
73
74 static struct vp_couple_pass _psy_passZa0[]={
75   {1.f,1.f,
76     {{24,    0,0,        0,0,      0,0},
77      {9999,  0,0,   12.5f,12,  4.5f,0}}
78   },
79 };
80
81 static vp_couple_pass _psy_passZa[]={
82   {1.f,1.f,
83     {{288,   0,0,       0,0,      0,0},
84      {9999,  0,0,   12.5f,12,  4.5f,0}}
85   }
86 };
87
88 static vp_attenblock _vp_tonemask_consbass_Za={
89
90   {
91     {-30.f,-30.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*63*/
92     {-30.f,-30.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, 
93     {-30.f,-30.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*125*/
94
95     {-30.f,-30.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, 
96     {-30.f,-30.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, /*250*/
97     {-30.f,-30.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f,-110.f}, 
98   
99   {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*500*/
100   {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*700*/
101   {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
102   {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
103   {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2000*/
104   {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2800*/
105   {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
106   
107   {-30.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
108   
109   {-30.f,-30.f,-33.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*8000*/
110   {-30.f,-30.f,-33.f,-35.f,-40.f,-45.f,-50.f,-60.f,-70.f,-85.f,-100.f}, /*11500*/
111   {-24.f,-24.f,-26.f,-32.f,-32.f,-42.f,-50.f,-60.f,-70.f,-85.f,-100.f}, /*16000*/
112 }};
113
114 static vp_attenblock _vp_tonemask_Za={
115
116   {{-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*63*/
117   {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*88*/
118   {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*125*/
119   
120   
121   {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*175*/
122   {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*250*/
123   {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*350*/
124   {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*500*/
125   {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*700*/
126   {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1000*/
127   {-30.f,-30.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*1400*/
128   {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2000*/
129   {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*2800*/
130   {-40.f,-40.f,-40.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*4000*/
131   
132   {-30.f,-35.f,-35.f,-40.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*5600*/
133   
134   {-30.f,-30.f,-33.f,-35.f,-40.f,-50.f,-60.f,-70.f,-80.f,-90.f,-100.f}, /*8000*/
135   {-30.f,-30.f,-33.f,-35.f,-40.f,-45.f,-50.f,-60.f,-70.f,-85.f,-100.f}, /*11500*/
136   {-24.f,-24.f,-26.f,-32.f,-32.f,-42.f,-50.f,-60.f,-70.f,-85.f,-100.f}, /*16000*/
137 }};
138
139 static vp_attenblock _vp_peakatt_Za={
140   {{-14.f,-20.f,-20.f,-20.f,-26.f,-22.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*63*/
141   {-14.f,-20.f,-20.f,-20.f,-26.f,-22.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*88*/
142   {-14.f,-20.f,-20.f,-20.f,-26.f,-22.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*125*/
143   {-14.f,-20.f,-20.f,-20.f,-26.f,-22.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*175*/
144   {-14.f,-20.f,-20.f,-20.f,-26.f,-22.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*250*/
145   {-14.f,-20.f,-20.f,-20.f,-26.f,-22.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*350*/
146   {-14.f,-20.f,-20.f,-20.f,-26.f,-22.f,-22.f,-22.f,-22.f,-22.f,-22.f},/*500*/
147   {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-14.f,-20.f,-26.f,-22.f,-22.f},/*700*/
148   {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-14.f,-20.f,-22.f,-22.f,-22.f},/*1000*/
149   {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*1400*/
150   {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-22.f,-22.f},/*2000*/
151   {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-30.f,-30.f},/*2400*/
152   {-10.f,-10.f,-10.f,-10.f,-14.f,-14.f,-16.f,-20.f,-22.f,-30.f,-30.f},/*4000*/
153   {-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-12.f,-13.f,-22.f,-30.f,-30.f},/*5600*/
154   {-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-12.f,-13.f,-22.f,-30.f,-30.f},/*8000*/
155   {-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-11.f,-22.f,-30.f,-30.f},/*11500*/
156   {-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-10.f,-20.f,-30.f,-30.f},/*16000*/
157 }};
158
159 static vorbis_info_psy _psy_set_Za0={
160   ATH_Bark_dB_lineaggressive,
161
162   -100.,
163   -140.,
164
165   /* tonemaskp */
166   0.f, -20.f,&_vp_tonemask_consbass_Za,
167
168   /* peakattp */
169   1, &_vp_peakatt_Za,
170
171   /*noisemaskp */
172   1,-20.f,     /* suppress any noise curve over absolute dB */
173   .6f, .6f,   /* low/high window */
174   5, 5, -1,
175
176   /*63     125     250     500      1k      2k      4k       8k     16k*/
177   {-30,-30,-30,-30,-30,-20,-20,-10,-10,-10,-10,-10, -3,  1,  2,  3,  6},
178   {.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f},
179
180   95.f,  /* even decade + 5 is important; saves an rint() later in a
181             tight loop) */
182   1,
183   _psy_passZa0
184 };
185
186 static vorbis_info_psy _psy_set_Za={
187   ATH_Bark_dB_lineaggressive,
188
189   -100.f,
190   -140.f,
191
192   /* tonemask */
193   0.f,-20.f,&_vp_tonemask_Za,
194   /* peakattp */
195   1,  &_vp_peakatt_Za,
196
197   /*noisemaskp */
198   1,  -20.f,     /* suppress any noise curve over maxspec+n */
199       .4f,.4f,   /* low/high window */
200       10,10,-1,
201
202   /*63     125     250     500      1k      2k      4k       8k     16k*/
203   {-6,-6,-6,-6,-6,-6, -6, -6,-10,-10,-10,-10,-3, -1,  1,  2,  3},
204   {.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f},
205
206   95.f,  /* even decade + 5 is important; saves an rint() later in a
207             tight loop) */
208   1,_psy_passZa
209 };
210
211 static vorbis_info_psy _psy_set_ZaT={
212   ATH_Bark_dB_lineaggressive,
213
214   -100.f,
215   -140.f,
216
217   /* tonemask */
218   0.f,-20.f,&_vp_tonemask_Za,
219   /* peakattp */
220   1,  &_vp_peakatt_Za,
221
222   /*noisemaskp */
223   1,  -20.f,     /* suppress any noise curve over maxspec+n */
224       .4f,.4f,   /* low/high window */
225       10,10,-1,
226
227   /*63     125     250     500      1k      2k      4k       8k     16k*/
228   {-30,-30,-30,-30,-30,-20, -6,-6,-10,-10,-10,-10, -3, -1,  1,  2,  3},
229   {.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f,.9f},
230
231   95.f,  /* even decade + 5 is important; saves an rint() later in a
232             tight loop) */
233   1,_psy_passZa
234 };
235
236 /* with GNUisms, this could be short and readable. Oh well */
237 static vorbis_info_time0 _time_set0Za={0};
238 /*static vorbis_info_floor0 _floor_set0A={9, 44100,  64, 10,130, 2, {0,1},
239   0.246f, .387f};*/
240 /*static vorbis_info_floor0 _floor_set1A={30, 44100, 256, 12,150, 2, {2,3}, 
241   .082f, .126f};*/
242
243 static vorbis_info_floor1 _floor_set0Zc={3,
244                                         {0,1,2},
245                                         
246                                         {1,3,3},
247                                         {0,2,2},
248                                         {-1,0,1},
249                                         {{2},{-1,3,4,5},{-1,6,7,8}},
250
251                                         4,
252
253                                         {0,128,  
254
255                                          7,
256
257                                          2,1,4,
258                                          23,13,45},
259
260                                         60,30,500,
261                                         999,999,0,18.,
262                                         8,70,
263                                         90};
264
265
266 static vorbis_info_floor1 _floor_set1Za={10,
267                                         {0,1,2,2,2,2,2, 3,3,3},
268                                         
269                                         {3,4,3,3},
270                                         {1,1,2,2},
271                                         {9,10,11,12},
272                                         {{13,14},
273                                          {15,16},
274                                          {-1,17,18,19},
275                                          {-1,20,21,22},
276                                         },
277
278                                         4,
279                                         {0,1024,
280
281                                          88,31,243,
282
283                                          14,54,143,460,
284                                          
285                                          6,3,10, 22,18,26, 41,36,47, 
286                                          69,61,78, 112,99,126, 185,162,211,  
287                                          329,282,387, 672,553,825
288                                          },
289                                         
290                                         60,30,500,
291                                         20,8,1,18.,
292                                         20,600,
293                                         704};
294
295 static vorbis_info_residue0 _residue_set0Za={0,192,16,5,23,
296                                             {1,1,1,1,7},
297                                             {25,
298                                              26,
299                                              27,
300                                              28,
301                                              29,30,31},
302                                             {9999,
303                                              9999,
304                                              9999,
305                                              9999,
306                                              9999},
307                                             {4.5,
308                                              12.5,
309                                              1.5f,
310                                              7.5f},
311                                             {0},
312                                              {3,3,99,99,99},
313                                             {3}};
314
315 static vorbis_info_residue0 _residue_set1Za={0,1408, 32,5,24,
316                                              {1,1,1,1,7},
317                                             {25,
318                                              26,
319                                              27,
320                                              28,
321                                              29,30,31},
322                                              {9999,
323                                               9999,
324                                               9999,
325                                               9999,
326                                               9999},
327                                              {4.5f,
328                                               12.5,
329                                               1.5,
330                                               7.5},
331                                              {0},
332                                              {18,18,99,99,99},
333                                              {3}};
334
335 static vorbis_info_mapping0 _mapping_set0Za={1, {0,0}, {0}, {0}, {0}, {0,0},
336                                             1,{0},{1}};
337 static vorbis_info_mapping0 _mapping_set1Za={1, {0,0}, {0}, {1}, {1}, {1,2},
338                                             1,{0},{1}};
339 static vorbis_info_mode _mode_set0Za={0,0,0,0};
340 static vorbis_info_mode _mode_set1Za={1,0,0,1};
341
342 /* CD quality stereo, no channel coupling */
343 codec_setup_info info_Za={
344
345   /* smallblock, largeblock */
346   {256, 2048}, 
347   /* modes,maps,times,floors,residues,books,psys */
348   2,          2,    1,     2,       2,   32,   3,
349   /* modes */
350   {&_mode_set0Za,&_mode_set1Za},
351   /* maps */
352   {0,0},{&_mapping_set0Za,&_mapping_set1Za},
353   /* times */
354   {0,0},{&_time_set0Za},
355   /* floors */
356   {1,1},{&_floor_set0Za,&_floor_set1Za},
357   /* residue */
358   {2,2},{&_residue_set0Za,&_residue_set1Za},
359   /* books */
360     
361   {  
362    &_huff_book_line0_class1,
363    &_huff_book_line0_class2, /* 1 */
364    
365    &_huff_book_line0_0sub0,  /* 2 */
366    &_huff_book_line0_1sub1,  /* 3 */
367    &_huff_book_line0_1sub2,
368    &_huff_book_line0_1sub3,  /* 5 */
369    &_huff_book_line0_2sub1,
370    &_huff_book_line0_2sub2,  /* 7 */
371    &_huff_book_line0_2sub3, 
372
373    &_huff_book_line1_class0,
374    &_huff_book_line1_class1, /* 10 */
375    &_huff_book_line1_class2,
376    &_huff_book_line1_class3, /* 12 */
377
378    &_huff_book_line1_0sub0,
379    &_huff_book_line1_0sub1, /* 14 */
380    &_huff_book_line1_1sub0, 
381    &_huff_book_line1_1sub1,
382    &_huff_book_line1_2sub1,  
383    &_huff_book_line1_2sub2, /* 18 */
384    &_huff_book_line1_2sub3, 
385    &_huff_book_line1_3sub1,
386    &_huff_book_line1_3sub2,
387    &_huff_book_line1_3sub3, /* 22 */
388
389    &_huff_book_res0_128_128aux, 
390    &_huff_book_res0_128_1024aux,
391
392    &_vq_book_res0_128_1024_1,
393    &_vq_book_res0_128_1024_2,
394    &_vq_book_res0_128_1024_3,
395    &_vq_book_res0_128_1024_4,
396    &_vq_book_res0_128_1024_5,
397    &_vq_book_res0_128_1024_5a,
398    &_vq_book_res0_128_1024_5b,
399
400   },
401   /* psy */
402   {&_psy_set_Za0,&_psy_set_ZaT,&_psy_set_Za},
403   &_psy_set_ZaG
404 };
405
406 #endif