Thoughts-in-progress: new noise metrics, cleaned up stereo. There's a
[platform/upstream/libvorbis.git] / lib / modes / mode_44c_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; 44kHz stereo ~64kbps true VBR
14  last mod: $Id: mode_44c_D.h,v 1.2 2001/08/13 11:30:59 xiphmont Exp $
15
16  ********************************************************************/
17
18 #ifndef _V_MODES_44c_D_H_
19 #define _V_MODES_44c_D_H_
20
21 #include <stdio.h>
22 #include "vorbis/codec.h"
23 #include "backends.h"
24
25 #include "books/line_128x19_class1.vqh"
26 #include "books/line_128x19_class2.vqh"
27
28 #include "books/line_128x19_0sub0.vqh"
29 #include "books/line_128x19_1sub1.vqh"
30 #include "books/line_128x19_1sub2.vqh"
31 #include "books/line_128x19_1sub3.vqh"
32 #include "books/line_128x19_2sub1.vqh"
33 #include "books/line_128x19_2sub2.vqh"
34 #include "books/line_128x19_2sub3.vqh"
35
36 #include "books/line_1024x31_class0.vqh"
37 #include "books/line_1024x31_class1.vqh"
38 #include "books/line_1024x31_class2.vqh"
39 #include "books/line_1024x31_class3.vqh"
40
41 #include "books/line_1024x31_0sub0.vqh"
42 #include "books/line_1024x31_0sub1.vqh"
43 #include "books/line_1024x31_1sub0.vqh"
44 #include "books/line_1024x31_1sub1.vqh"
45 #include "books/line_1024x31_2sub1.vqh"
46 #include "books/line_1024x31_2sub2.vqh"
47 #include "books/line_1024x31_2sub3.vqh"
48 #include "books/line_1024x31_3sub1.vqh"
49 #include "books/line_1024x31_3sub2.vqh"
50 #include "books/line_1024x31_3sub3.vqh"
51
52 #include "books/res_44c_C_128aux.vqh"
53 #include "books/res_44c_C_1024aux.vqh"
54
55 #include "books/res_Cc_1.vqh"
56 #include "books/res_Cc_2.vqh"
57 #include "books/res_Cc_3.vqh"
58 #include "books/res_Cc_4.vqh"
59 #include "books/res_Cc_5.vqh"
60 #include "books/res_Cc_6.vqh"
61 #include "books/res_Cc_7.vqh"
62 #include "books/res_Cc_8.vqh"
63 #include "books/res_Cc_8a.vqh"
64 #include "books/res_Cc_9.vqh"
65 #include "books/res_Cc_9a.vqh"
66 #include "books/res_Cc_9b.vqh"
67
68 #include "maskadj_A.h"
69
70 static vorbis_info_psy_global _psy_set_44c_DG={
71   0, /* decaydBpms */
72   8,   /* lines per eighth octave */
73   
74   /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */
75   256, {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f,
76   -6.f, 
77   
78   0,
79 };
80
81 static vp_couple_pass _psy_pass_44c_D[]={
82   {1.f,1.f,
83    {{9999,   0,0,       0,0,      0,0}}
84   }
85 };
86
87 static vorbis_info_psy _psy_set_44c_D0={
88   ATH_Bark_dB_lineconservative,
89   -100.,-140.,
90
91   /* tonemaskp */
92   -6.f, -45.f,&_vp_tonemask_consbass_A,
93   /* peakattp, curvelimitp */
94   1, 30, &_vp_peakatt_D,
95
96   /*noisemaskp */
97   1,-30.f,     /* suppress any noise curve over maxspec+n */
98   .6f, .6f,   /* low/high window */
99   5, 5, 10,
100
101   /*63     125     250     500      1k      2k      4k       8k     16k*/
102   {-30,-30,-30,-30,-30,-30,-20,-10,  0,  0,  0,  0,  0,  0,  0,  0,  1},
103   {.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.4f,.4f,.5f,.5f,.6f,.7f,.7f},
104
105   105.f,  /* even decade + 5 is important; saves an rint() later in a
106             tight loop) */
107   1,
108   _psy_pass_44c_D
109 };
110
111 static vorbis_info_psy _psy_set_44c_DT={
112   ATH_Bark_dB_lineconservative,
113   -100.f,-140.f,
114
115   /* tonemask */
116   -5.f,-45.f,&_vp_tonemask_consbass_A,
117   /* peakattp,curvelimitp */
118   1, 30,  &_vp_peakatt_D,
119
120   /*noisemaskp */
121   1,  -30.f,     /* suppress any noise curve over maxspec+n */
122       .4f,.4f,   /* low/high window */
123       10,10,100,
124
125   /*63     125     250     500      1k      2k      4k       8k     16k*/
126   {-30,-30,-30,-30,-30,-30,-30,-20,-10,-12,-16,-16, -10, -6, -6, -6, -6},
127   {.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.5f,.4f,.4f,.4f,.4f,.4f,.5f,.5f,.6f},
128
129   105.f,  /* even decade + 5 is important; saves an rint() later in a
130             tight loop) */
131   1,_psy_pass_44c_D
132 };
133
134 static vorbis_info_psy _psy_set_44c_D={
135   ATH_Bark_dB_lineconservative,
136   -100.f,  -140.f,
137
138   /* tonemask */
139   -6.f,-45.f,&_vp_tonemask_consbass_A,
140   /* peakattp, curvelimitp */
141   1, 30, &_vp_peakatt_D,
142
143   /*noisemaskp */
144   1,  -30.f,     /* suppress any noise curve over maxspec+n */
145       .4f,.4f,   /* low/high window */
146       10,10,100,
147
148   /*63     125     250     500      1k      2k      4k       8k     16k*/
149   {-30,-30,-30,-30,-30,-30,-20, -3,-10,-10,-12,-12, -6, -3, -2, -1, -0},
150   {.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.4f,.5f,.6f,.7f,.7f},
151
152   105.f,  /* even decade + 5 is important; saves an rint() later in a
153             tight loop) */
154   1,_psy_pass_44c_D
155 };
156
157 static vorbis_info_time0 _time_set_44c_D={0};
158
159 static vorbis_info_floor1 _floor_set_44c_D0={
160   6,
161   {0,1,1,1,2,2},
162   
163   {4,3,3},
164   {0,2,2},
165   {-1,0,1},
166   {{2},{-1,3,4,5},{-1,6,7,8}},
167   
168   4,
169   
170   {0,128,  
171    
172    6,17,30,58,
173    
174    2,1,4, 11,8,14, 23,20,26,
175    41,35,48, 84,69,103},
176   
177   60,30,500,
178   999,999,1,18.,
179   8,70,
180   112};
181
182
183 static vorbis_info_floor1 _floor_set_44c_D={
184   10,
185   {0,1,2,2,2,2,2, 3,3,3},
186   
187   {3,4,3,3},
188   {1,1,2,2},
189   {9,10,11,12},
190   {{13,14},
191    {15,16},
192    {-1,17,18,19},
193    {-1,20,21,22},
194   },
195   
196   4,
197   {0,1024,
198    
199    88,31,243,
200    
201    14,54,143,460,
202    
203    6,3,10, 22,18,26, 41,36,47, 
204    69,61,78, 112,99,126, 185,162,211,  
205    329,282,387, 672,553,825
206   },
207   
208   60,30,400,
209   20,8,1,18.,
210   20,600,
211   896};
212
213 static vorbis_info_residue0 _residue_set_44c_D0={
214 0,256,16,10,23,
215                                             {0,1,1,1,1,1,1,1,3,7},
216                                             {25,
217                                              26,
218                                              27,
219                                              28,
220                                              29,
221                                              30,
222                                              31,32,
223                                              33,34,
224                                              35,36},
225                                             {9999,
226                                              9999,
227                                              12,9999,
228                                              18,9999,
229                                              28,9999,
230                                              9999,9999},
231                                             {.5f,
232                                              1.5f,
233                                              2.5f,2.5f,
234                                              4.5f,4.5,
235                                              16.5f,16.5,
236                                              84.5f},
237                                             {0},
238                                             {99,
239                                              99,
240                                              99,99,
241                                              99,99,
242                                              99,99,
243                                              99,99},
244                                             {3}};
245 static vorbis_info_residue0 _residue_set_44c_D={
246 0,2048, 32,10,24,
247                                             {0,1,1,1,1,1,1,1,3,7},
248                                             {25,
249                                              26,
250                                              27,
251                                              28,
252                                              29,
253                                              30,
254                                              31,
255                                              32,33,
256                                              34,35,36},
257                                             {9999,
258                                              9999,
259                                              22,9999,
260                                              34,9999,
261                                              64,999,
262                                              9999,9999},
263                                             {.5f,
264                                              1.5f,
265                                              2.5f,2.5f,
266                                              4.5f,4.5,
267                                              16.5f,16.5,
268                                              84.f},
269                                             {0},
270                                             {99,
271                                              99,
272                                              99,99,
273                                              99,99,
274                                              99,99,
275                                              99,99},
276                                             {3}};
277
278 static vorbis_info_mapping0 _mapping_set_44c_D0={
279   1, {0,0}, {0}, {0}, {0}, {0,0}, 1,{0},{1}};
280 static vorbis_info_mapping0 _mapping_set_44c_D={
281   1, {0,0}, {0}, {1}, {1}, {1,2}, 1,{0},{1}};
282
283 static vorbis_info_mode _mode_set_44c_D0={0,0,0,0};
284 static vorbis_info_mode _mode_set_44c_D={1,0,0,1};
285
286 codec_setup_info info_44c_D={
287
288   /* smallblock, largeblock */
289   {256, 2048}, 
290   /* modes,maps,times,floors,residues,books,psys */
291   2,          2,    1,     2,       2,   37,   3,
292   /* modes */
293   {&_mode_set_44c_D0,&_mode_set_44c_D},
294   /* maps */
295   {0,0},{&_mapping_set_44c_D0,&_mapping_set_44c_D},
296   /* times */
297   {0,0},{&_time_set_44c_D},
298   /* floors */
299   {1,1},{&_floor_set_44c_D0,&_floor_set_44c_D},
300   /* residue */
301   {2,2},{&_residue_set_44c_D0,&_residue_set_44c_D},
302   /* books */
303   
304   {  
305     &_huff_book_line_128x19_class1,
306     &_huff_book_line_128x19_class2, /* 1 */
307    
308     &_huff_book_line_128x19_0sub0,  /* 2 */
309     &_huff_book_line_128x19_1sub1,  /* 3 */
310     &_huff_book_line_128x19_1sub2,
311     &_huff_book_line_128x19_1sub3,  /* 5 */
312     &_huff_book_line_128x19_2sub1,
313     &_huff_book_line_128x19_2sub2,  /* 7 */
314     &_huff_book_line_128x19_2sub3, 
315     
316     &_huff_book_line_1024x31_class0,
317     &_huff_book_line_1024x31_class1, /* 10 */
318     &_huff_book_line_1024x31_class2,
319     &_huff_book_line_1024x31_class3, /* 12 */
320     
321     &_huff_book_line_1024x31_0sub0,
322     &_huff_book_line_1024x31_0sub1, /* 14 */
323     &_huff_book_line_1024x31_1sub0, 
324     &_huff_book_line_1024x31_1sub1,
325     &_huff_book_line_1024x31_2sub1,  
326     &_huff_book_line_1024x31_2sub2, /* 18 */
327     &_huff_book_line_1024x31_2sub3, 
328     &_huff_book_line_1024x31_3sub1,
329     &_huff_book_line_1024x31_3sub2,
330     &_huff_book_line_1024x31_3sub3, /* 22 */
331
332     &_huff_book_res_44c_C_128aux, 
333     &_huff_book_res_44c_C_1024aux,
334     
335     &_vq_book_res_Cc_1,
336     &_vq_book_res_Cc_2,
337     &_vq_book_res_Cc_3,
338     &_vq_book_res_Cc_4,
339     &_vq_book_res_Cc_5,
340     &_vq_book_res_Cc_6,
341     &_vq_book_res_Cc_7,
342     &_vq_book_res_Cc_8,
343     &_vq_book_res_Cc_8a,
344     &_vq_book_res_Cc_9,
345     &_vq_book_res_Cc_9a,
346     &_vq_book_res_Cc_9b,
347
348   },
349   /* psy */
350   {&_psy_set_44c_D0,&_psy_set_44c_DT,&_psy_set_44c_D},
351   &_psy_set_44c_DG
352 };
353
354 #endif