doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
psych_44.h
Go to the documentation of this file.
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-2002 *
9  * by the XIPHOPHORUS Company http://www.xiph.org/ *
10  * *
11  ********************************************************************
12 
13  function: key psychoacoustic settings for 44.1/48kHz
14  last mod: $Id: psych_44.h,v 1.29 2003/09/02 07:32:17 xiphmont Exp $
15 
16  ********************************************************************/
17 
18 
19 /* preecho trigger settings *****************************************/
20 
21 static vorbis_info_psy_global _psy_global_44[5]={
22 
23  {8, /* lines per eighth octave */
24  {20.f,14.f,12.f,12.f,12.f,12.f,12.f},
25  {-60.f,-30.f,-40.f,-40.f,-40.f,-40.f,-40.f}, 2,-75.f,
26  -6.f,
27  {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
28  },
29  {8, /* lines per eighth octave */
30  {14.f,10.f,10.f,10.f,10.f,10.f,10.f},
31  {-40.f,-30.f,-25.f,-25.f,-25.f,-25.f,-25.f}, 2,-80.f,
32  -6.f,
33  {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
34  },
35  {8, /* lines per eighth octave */
36  {12.f,10.f,10.f,10.f,10.f,10.f,10.f},
37  {-20.f,-20.f,-15.f,-15.f,-15.f,-15.f,-15.f}, 0,-80.f,
38  -6.f,
39  {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
40  },
41  {8, /* lines per eighth octave */
42  {10.f,8.f,8.f,8.f,8.f,8.f,8.f},
43  {-20.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-80.f,
44  -6.f,
45  {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
46  },
47  {8, /* lines per eighth octave */
48  {10.f,6.f,6.f,6.f,6.f,6.f,6.f},
49  {-15.f,-15.f,-12.f,-12.f,-12.f,-12.f,-12.f}, 0,-85.f,
50  -6.f,
51  {99.},{{99.},{99.}},{0},{0},{{0.},{0.}}
52  },
53 };
54 
55 /* noise compander lookups * low, mid, high quality ****************/
56 static compandblock _psy_compand_44[6]={
57  /* sub-mode Z short */
58  {{
59  0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
60  8, 9,10,11,12,13,14, 15, /* 15dB */
61  16,17,18,19,20,21,22, 23, /* 23dB */
62  24,25,26,27,28,29,30, 31, /* 31dB */
63  32,33,34,35,36,37,38, 39, /* 39dB */
64  }},
65  /* mode_Z nominal short*/
66  {{
67  0, 1, 2, 3, 4, 5, 6, 6, /* 7dB */
68  7, 7, 7, 7, 6, 6, 6, 7, /* 15dB */
69  7, 8, 9,10,11,12,13, 14, /* 23dB */
70  15,16,17,17,17,18,18, 19, /* 31dB */
71  19,19,20,21,22,23,24, 25, /* 39dB */
72  }},
73  /* mode A short */
74  {{
75  0, 1, 2, 3, 4, 5, 5, 5, /* 7dB */
76  6, 6, 6, 5, 4, 4, 4, 4, /* 15dB */
77  4, 4, 5, 5, 5, 6, 6, 6, /* 23dB */
78  7, 7, 7, 8, 8, 8, 9, 10, /* 31dB */
79  11,12,13,14,15,16,17, 18, /* 39dB */
80  }},
81  /* sub-mode Z long */
82  {{
83  0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
84  8, 9,10,11,12,13,14, 15, /* 15dB */
85  16,17,18,19,20,21,22, 23, /* 23dB */
86  24,25,26,27,28,29,30, 31, /* 31dB */
87  32,33,34,35,36,37,38, 39, /* 39dB */
88  }},
89  /* mode_Z nominal long */
90  {{
91  0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
92  8, 9,10,11,12,12,13, 13, /* 15dB */
93  13,14,14,14,15,15,15, 15, /* 23dB */
94  16,16,17,17,17,18,18, 19, /* 31dB */
95  19,19,20,21,22,23,24, 25, /* 39dB */
96  }},
97  /* mode A long */
98  {{
99  0, 1, 2, 3, 4, 5, 6, 7, /* 7dB */
100  8, 8, 7, 6, 5, 4, 4, 4, /* 15dB */
101  4, 4, 5, 5, 5, 6, 6, 6, /* 23dB */
102  7, 7, 7, 8, 8, 8, 9, 10, /* 31dB */
103  11,12,13,14,15,16,17, 18, /* 39dB */
104  }}
105 };
106 
107 /* tonal masking curve level adjustments *************************/
108 static vp_adjblock _vp_tonemask_adj_longblock[11]={
109  /* adjust for mode zero */
110  /* 63 125 250 500 1 2 4 8 16 */
111  {{-15,-15,-15,-15,-10, -8, -4,-2, 0, 0, 0,10, 0, 0, 0, 0, 0}}, /* 0 */
112  {{-15,-15,-15,-15,-15,-12,-10,-8, 0, 0, 0, 5, 0, 0, 0, 0, 0}}, /* 1 */
113  {{-15,-15,-15,-15,-15,-12,-10,-8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 2 */
114  {{-15,-15,-15,-15,-15,-12,-10,-8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 3 */
115  {{-15,-15,-15,-15,-15,-12,-10,-8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 4 */
116  {{-15,-15,-15,-15,-15,-12,-10,-8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 5 */
117  {{-15,-15,-15,-15,-15,-12,-10,-8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 6 */
118  {{-15,-15,-15,-15,-15,-12,-10,-8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 7 */
119  {{-15,-15,-15,-15,-15,-12,-10,-8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 8 */
120  {{-15,-15,-15,-15,-15,-12,-10,-8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 9 */
121  {{-15,-15,-15,-15,-15,-12,-10,-8, 0, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 10 */
122 };
123 static vp_adjblock _vp_tonemask_adj_otherblock[11]={
124  /* adjust for mode zero */
125  /* 63 125 250 500 1 2 4 8 16 */
126  {{-20,-20,-20,-20,-14,-12,-10, -8, -4, 0, 0,10, 0, 0, 0, 0, 0}}, /* 0 */
127  {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 5, 0, 0, 0, 0, 0}}, /* 1 */
128  {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 2 */
129  {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 3 */
130  {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 4 */
131  {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 5 */
132  {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 6 */
133  {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 7 */
134  {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 8 */
135  {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 9 */
136  {{-20,-20,-20,-20,-20,-18,-16,-14,-10, 0, 0, 0, 0, 0, 0, 0, 0}}, /* 10 */
137 };
138 
139 static noise3 _psy_noisebias_trans_low[2]={
140  /* 63 125 250 500 1k 2k 4k 8k 16k*/
141  /* 0 */
142  {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
143  {-30,-30,-30,-30,-26,-20,-16, -8, -6, -6, -2, 2, 2, 4, 8, 8, 15},
144  {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
145  /* 1 */
146  {{{-15,-15,-15,-15,-15,-10, -5, 0, 2, 2, 6, 6, 6, 8, 10, 12, 15},
147  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, 0, 0, 0, 2, 4, 10},
148  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4, -2}}},
149 };
150 static noise3 _psy_noisebias_long_low[2]={
151  /*63 125 250 500 1k 2k 4k 8k 16k*/
152  /* 0 */
153  {{{-10,-10,-10,-10,-10, -4, 0, 0, 0, 6, 6, 6, 6, 10, 10, 12, 20},
154  {-20,-20,-20,-20,-20,-20,-10, -2, 0, 0, 0, 0, 0, 2, 4, 6, 15},
155  {-20,-20,-20,-20,-20,-20,-20,-10, -6, -6, -6, -6, -6, -4, -4, -4, -2}}},
156  /* 1 */
157  {{{-10,-10,-10,-10,-10,-10, -8, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10},
158  {-20,-20,-20,-20,-20,-20,-20,-14, -8, -2, 0, 0, 0, 0, 2, 4, 10},
159  {-20,-20,-20,-20,-20,-20,-20,-14, -6, -6, -6, -6, -6, -4, -4, -4, -2}}},
160 };
161 
162 static noise3 _psy_noisebias_trans[11]={
163  /* 63 125 250 500 1k 2k 4k 8k 16k*/
164  /* 0 */
165  {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10},
166  {-30,-30,-30,-30,-26,-22,-20,-14, -8, -4, 0, 0, 0, 0, 2, 4, 10},
167  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -4, -4, -4, -2}}},
168  /* 1 */
169  {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 4, 4, 5, 5, 5, 8, 10},
170  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 8},
171  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},
172  /* 2 */
173  {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
174  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 6},
175  {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
176  /* 3 */
177  {{{-15,-15,-15,-15,-15,-12,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
178  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 6},
179  {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
180  /* 4 */
181  {{{-20,-20,-20,-20,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
182  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 5},
183  {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
184  /* 5 */
185  {{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
186  {-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -4, -4, -4, -4, -2, -1, 2},
187  {-34,-34,-34,-34,-30,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}},
188  /* 6 */
189  {{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
190  {-32,-32,-32,-32,-28,-24,-24,-18,-14, -8, -6, -6, -6, -6, -4, -2, 1},
191  {-34,-34,-34,-34,-30,-26,-24,-18,-17,-15,-15,-15,-15,-13,-13,-12, -8}}},
192  /* 7 */
193  {{{-24,-24,-24,-24,-20,-18,-14, -8, -1, 1, 1, 1, 2, 3, 3, 4, 7},
194  {-32,-32,-32,-32,-28,-24,-24,-18,-14,-12,-10, -8, -8, -8, -6, -4, 0},
195  {-34,-34,-34,-34,-30,-26,-26,-24,-22,-19,-19,-19,-19,-18,-17,-16,-12}}},
196  /* 8 */
197  {{{-24,-24,-24,-24,-22,-20,-15,-10, -8, -2, 0, 0, 0, 1, 2, 3, 7},
198  {-36,-36,-36,-36,-30,-30,-30,-24,-18,-14,-12,-10,-10,-10, -8, -6, -2},
199  {-36,-36,-36,-36,-34,-30,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
200  /* 9 */
201  {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
202  {-36,-36,-36,-36,-34,-32,-32,-28,-20,-16,-16,-16,-16,-14,-12,-10, -7},
203  {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
204  /* 10 */
205  {{{-30,-30,-30,-30,-30,-30,-30,-28,-20,-14,-14,-14,-14,-14,-14,-12,-10},
206  {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-20},
207  {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
208 };
209 
210 static noise3 _psy_noisebias_long[11]={
211  /*63 125 250 500 1k 2k 4k 8k 16k*/
212  /* 0 */
213  {{{-10,-10,-10,-10,-10,-10, -8, 2, 2, 2, 4, 4, 5, 5, 5, 8, 10},
214  {-20,-20,-20,-20,-20,-20,-20,-14, -6, 0, 0, 0, 0, 0, 2, 4, 10},
215  {-20,-20,-20,-20,-20,-20,-20,-14, -8, -6, -6, -6, -6, -4, -4, -4, -2}}},
216  /* 1 */
217  {{{-10,-10,-10,-10,-10,-10, -8, -4, 0, 2, 4, 4, 5, 5, 5, 8, 10},
218  {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 8},
219  {-20,-20,-20,-20,-20,-20,-20,-14,-10, -8, -8, -8, -8, -6, -6, -6, -4}}},
220  /* 2 */
221  {{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 5, 6, 10},
222  {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -2, -2, -2, -2, 0, 2, 6},
223  {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
224  /* 3 */
225  {{{-10,-10,-10,-10,-10,-10,-10, -8, 0, 2, 2, 2, 4, 4, 4, 5, 8},
226  {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 6},
227  {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
228  /* 4 */
229  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
230  {-20,-20,-20,-20,-20,-20,-20,-14,-10, -4, -3, -3, -3, -3, -1, 1, 5},
231  {-20,-20,-20,-20,-20,-20,-20,-14,-10,-10,-10,-10,-10, -8, -8, -8, -4}}},
232  /* 5 */
233  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
234  {-22,-22,-22,-22,-22,-22,-22,-16,-12, -6, -4, -4, -4, -4, -2, -1, 2},
235  {-24,-24,-24,-24,-24,-24,-24,-18,-14,-12,-12,-12,-12,-10,-10, -9, -5}}},
236  /* 6 */
237  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
238  {-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -6, -6, -6, -6, -4, -2, 1},
239  {-26,-26,-26,-26,-26,-26,-26,-18,-16,-15,-15,-15,-15,-13,-13,-12, -8}}},
240  /* 7 */
241  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 1, 1, 1, 2, 3, 3, 4, 7},
242  {-24,-24,-24,-24,-24,-24,-24,-18,-14,-10, -8, -8, -8, -8, -6, -4, 0},
243  {-26,-26,-26,-26,-26,-26,-26,-22,-20,-19,-19,-19,-19,-18,-17,-16,-12}}},
244  /* 8 */
245  {{{-15,-15,-15,-15,-15,-15,-15,-10, -4, 0, 0, 0, 0, 1, 2, 3, 7},
246  {-26,-26,-26,-26,-26,-26,-26,-20,-16,-12,-10,-10,-10,-10, -8, -6, -2},
247  {-28,-28,-28,-28,-28,-28,-28,-26,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
248  /* 9 */
249  {{{-22,-22,-22,-22,-22,-22,-22,-18,-14, -8, -4, -4, -4, -4, -4, -2, 2},
250  {-26,-26,-26,-26,-26,-26,-26,-22,-18,-16,-16,-16,-16,-14,-12,-10, -7},
251  {-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
252  /* 10 */
253  {{{-24,-24,-24,-24,-24,-24,-24,-24,-24,-18,-14,-14,-14,-14,-14,-12,-10},
254  {-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-20},
255  {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
256 };
257 
258 static noise3 _psy_noisebias_impulse[11]={
259  /* 63 125 250 500 1k 2k 4k 8k 16k*/
260  /* 0 */
261  {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 4, 8, 8, 8, 10, 12, 14, 20},
262  {-30,-30,-30,-30,-26,-22,-20,-14, -6, -2, 0, 0, 0, 0, 2, 4, 10},
263  {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2}}},
264  /* 1 */
265  {{{-12,-12,-12,-12,-12, -8, -6, -4, 0, 4, 4, 4, 4, 10, 12, 14, 20},
266  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -4, -4, -2, -2, -2, -2, 2},
267  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8,-10,-10, -8, -8, -8, -6, -4}}},
268  /* 2 */
269  {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16},
270  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
271  {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
272  /* 3 */
273  {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 6, 8, 8, 14},
274  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
275  {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
276  /* 4 */
277  {{{-16,-16,-16,-16,-16,-12,-10, -6, -2, 0, 0, 0, 0, 4, 6, 6, 12},
278  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
279  {-30,-30,-30,-30,-26,-22,-20,-14,-10,-10,-10,-10,-10,-10,-10, -8, -4}}},
280  /* 5 */
281  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11},
282  {-32,-32,-32,-32,-28,-24,-22,-16,-10, -6, -8, -8, -6, -6, -6, -4, -2},
283  {-34,-34,-34,-34,-30,-26,-24,-18,-14,-12,-12,-12,-12,-12,-10, -9, -5}}},
284  /* 6 */
285  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 4, 6, 11},
286  {-34,-34,-34,-34,-30,-30,-24,-20,-12,-12,-14,-14,-10, -9, -8, -6, -4},
287  {-34,-34,-34,-34,-34,-30,-26,-20,-16,-15,-15,-15,-15,-15,-13,-12, -8}}},
288  /* 7 */
289  {{{-22,-22,-22,-22,-22,-20,-14,-10, -6, 0, 0, 0, 0, 4, 4, 6, 11},
290  {-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10,-10},
291  {-34,-34,-34,-34,-32,-32,-30,-24,-20,-19,-19,-19,-19,-19,-17,-16,-12}}},
292  /* 8 */
293  {{{-24,-24,-24,-24,-24,-22,-14,-10, -6, -1, -1, -1, -1, 3, 3, 5, 10},
294  {-34,-34,-34,-34,-30,-30,-30,-24,-20,-20,-20,-20,-20,-18,-16,-16,-14},
295  {-36,-36,-36,-36,-36,-34,-28,-24,-24,-24,-24,-24,-24,-24,-24,-20,-16}}},
296  /* 9 */
297  {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -4, -4, -4, -4, -4, -2, 2},
298  {-36,-36,-36,-36,-34,-32,-32,-30,-26,-26,-26,-26,-26,-22,-20,-20,-18},
299  {-40,-40,-40,-40,-40,-40,-40,-32,-30,-30,-30,-30,-30,-30,-30,-24,-20}}},
300  /* 10 */
301  {{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-16,-16,-16,-16,-16,-14,-12},
302  {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-30,-30,-30,-30,-30,-30,-26},
303  {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
304 };
305 
306 
307 static noise3 _psy_noisebias_padding[11]={
308  /* 63 125 250 500 1k 2k 4k 8k 16k*/
309  /* 0 */
310  {{{-10,-10,-10,-10,-10, -4, 0, 0, 4, 8, 8, 8, 8, 10, 12, 14, 20},
311  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -2, 2, 3, 6, 6, 8, 10},
312  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -4, -4, -4, -4, -2, 0, 2}}},
313  /* 1 */
314  {{{-12,-12,-12,-12,-12, -8, -6, -4, 0, 4, 4, 4, 4, 10, 12, 14, 20},
315  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, 0, 0, 0, 2, 2, 4, 8},
316  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -6, -6, -4, -2, 0}}},
317  /* 2 */
318  {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 8, 10, 10, 16},
319  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, 0, 0, 0, 2, 2, 4, 8},
320  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
321  /* 3 */
322  {{{-14,-14,-14,-14,-14,-10, -8, -6, -2, 2, 2, 2, 2, 6, 8, 8, 14},
323  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, 0, 0, 2, 6},
324  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
325  /* 4 */
326  {{{-16,-16,-16,-16,-16,-12,-10, -6, -2, 0, 0, 0, 0, 4, 6, 6, 12},
327  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -1, -1, -1, -1, 0, 2, 6},
328  {-30,-30,-30,-30,-26,-22,-20,-14,-10, -8, -8, -8, -8, -8, -6, -4, -2}}},
329  /* 5 */
330  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12},
331  {-32,-32,-32,-32,-28,-24,-22,-16,-12, -6, -3, -3, -3, -3, -2, 0, 4},
332  {-34,-34,-34,-34,-30,-26,-24,-18,-14,-10,-10,-10,-10,-10, -8, -5, -3}}},
333  /* 6 */
334  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12},
335  {-34,-34,-34,-34,-30,-30,-24,-20,-14, -8, -4, -4, -4, -4, -3, -1, 4},
336  {-34,-34,-34,-34,-34,-30,-26,-20,-16,-13,-13,-13,-13,-13,-11, -8, -6}}},
337  /* 7 */
338  {{{-20,-20,-20,-20,-20,-18,-14,-10, -4, 0, 0, 0, 0, 4, 6, 6, 12},
339  {-34,-34,-34,-34,-30,-30,-30,-24,-16,-10, -8, -6, -6, -6, -5, -3, 1},
340  {-34,-34,-34,-34,-32,-32,-28,-22,-18,-16,-16,-16,-16,-16,-14,-12,-10}}},
341  /* 8 */
342  {{{-22,-22,-22,-22,-22,-20,-14,-10, -4, 0, 0, 0, 0, 3, 5, 5, 11},
343  {-34,-34,-34,-34,-30,-30,-30,-24,-16,-12,-10, -8, -8, -8, -7, -5, -2},
344  {-36,-36,-36,-36,-36,-34,-28,-22,-20,-20,-20,-20,-20,-20,-20,-16,-14}}},
345  /* 9 */
346  {{{-28,-28,-28,-28,-28,-28,-28,-20,-14, -8, -2, -2, -2, -2, 0, 2, 6},
347  {-36,-36,-36,-36,-34,-32,-32,-24,-16,-12,-12,-12,-12,-12,-10, -8, -5},
348  {-40,-40,-40,-40,-40,-40,-40,-32,-26,-24,-24,-24,-24,-24,-24,-20,-18}}},
349  /* 10 */
350  {{{-30,-30,-30,-30,-30,-26,-24,-24,-24,-20,-12,-12,-12,-12,-12,-10, -8},
351  {-40,-40,-40,-40,-40,-40,-40,-40,-35,-30,-25,-25,-25,-25,-25,-25,-15},
352  {-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40,-40}}},
353 };
354 
355 static noiseguard _psy_noiseguards_44[4]={
356  {3,3,15},
357  {3,3,15},
358  {10,10,100},
359  {10,10,100},
360 };
361 
362 static int _psy_tone_suppress[11]={
363  -20,-20,-20,-20,-24,-30,-40,-40,-45,-45,-45,
364 };
365 
366 static int _psy_tone_0dB[11]={
367  90,95,95,95,95,105,105,105,105,105,105,
368 };
369 
370 static int _psy_noise_suppress[11]={
371  -20,-24,-24,-24,-24,-30,-40,-40,-45,-45,-45,
372 };
373 
374 static vorbis_info_psy _psy_info_template={
375  -1,
376  -140.,-140.,
377  /* tonemask att boost/decay,suppr,curves */
378  {0.f,0.f,0.f}, 0.,0., -40.f, {0.},
379 
380  /*noisemaskp,supp, low/high window, low/hi guard, minimum */
381  1, -0.f, .5f, .5f, 0,0,0,
382  {{-1},{-1},{-1}},{-1},105.f,
383 
384  0,0,-1,-1,0.,
385 };
386 
387 /* ath ****************/
388 
389 static int _psy_ath_floater[11]={
390  -100,-100,-100,-100,-100,-105,-105,-105,-105,-110,-120,
391 };
392 
393 static int _psy_ath_abs[11]={
394  -130,-130,-130,-140,-140,-140,-140,-140,-140,-140,-150,
395 };
396 
397 /* stereo setup. These don't map directly to quality level, there's
398  an additional indirection as several of the below may be used in a
399  single bitmanaged stream
400 
401 ****************/
402 
403 /* various stereo possibilities */
404 
405 /* stereo mode by base quality level */
406 static adj_stereo _psy_stereo_modes_44_low[2]={
407  /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 */
408  {{ 4, 4, 4, 4, 4, 4, 4, 3, 2, 2, 1, 0, 0, 0, 0},
409  { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 4, 3},
410  { 1, 2, 3, 4, 4, 4, 4, 4, 4, 5, 6, 7, 8, 8, 8},
411  { 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},
412  /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 */
413  {{ 4, 4, 4, 4, 4, 4, 4, 3, 2, 2, 1, 0, 0, 0, 0},
414  { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 4, 3},
415  { 1, 2, 3, 4, 5, 5, 6, 6, 6, 6, 6, 7, 8, 8, 8},
416  { 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},
417 };
418 
419 static adj_stereo _psy_stereo_modes_44[11]={
420  /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 */
421  {{ 4, 4, 4, 4, 4, 4, 4, 3, 2, 2, 1, 0, 0, 0, 0},
422  { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 5, 4, 3},
423  { 1, 2, 3, 4, 5, 5, 6, 6, 6, 6, 6, 7, 8, 8, 8},
424  { 12,12.5, 13,13.5, 14,14.5, 15, 99, 99, 99, 99, 99, 99, 99, 99}},
425  /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 */
426  {{ 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 0, 0, 0, 0},
427  { 8, 8, 8, 8, 6, 6, 5, 5, 5, 5, 5, 5, 5, 4, 3},
428  { 1, 2, 3, 4, 4, 5, 6, 6, 6, 6, 6, 8, 8, 8, 8},
429  { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
430  /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 */
431  {{ 3, 3, 3, 3, 3, 3, 2, 2, 2, 1, 0, 0, 0, 0, 0},
432  { 8, 8, 8, 6, 5, 5, 5, 5, 5, 5, 5, 4, 3, 2, 1},
433  { 3, 4, 4, 4, 5, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8},
434  { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
435  /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 */
436  {{ 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
437  { 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 2, 1},
438  { 4, 4, 5, 6, 6, 6, 6, 6, 8, 8, 10, 10, 10, 10, 10},
439  { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
440  /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 */
441  {{ 2, 2, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
442  { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 2, 1, 0},
443  { 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10},
444  { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
445  /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 */
446  {{ 2, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
447  { 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0},
448  { 6, 6, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10},
449  { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
450  /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 6 */
451  {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
452  { 3, 3, 3, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0},
453  { 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
454  { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
455  /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 */
456  {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
457  { 3, 3, 3, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
458  { 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
459  { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
460  /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 */
461  {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
462  { 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
463  { 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
464  { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
465  /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 9 */
466  {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
467  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
468  { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
469  { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
470  /* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 10 */
471  {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
472  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
473  { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4},
474  { 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99}},
475 };
476 
477 /* tone master attenuation by base quality mode and bitrate tweak */
478 
479 static att3 _psy_tone_masteratt_44_low[2]={
480  {{ 34, 20, 8}, 0, 1.25}, /* 0 */
481  {{ 34, 20, 8}, -2, 1.25}, /* 1 */
482 };
483 static att3 _psy_tone_masteratt_44[11]={
484  {{ 30, 20, 8}, -2, 1.25}, /* 0 */
485  {{ 25, 14, 4}, 0, 0}, /* 1 */
486  {{ 20, 10, -2}, 0, 0}, /* 2 */
487  {{ 20, 9, -4}, 0, 0}, /* 3 */
488  {{ 20, 9, -4}, 0, 0}, /* 4 */
489  {{ 20, 6, -6}, 0, 0}, /* 5 */
490  {{ 20, 3, -10}, 0, 0}, /* 6 */
491  {{ 18, 1, -14}, 0, 0}, /* 7 */
492  {{ 18, 0, -16}, 0, 0}, /* 8 */
493  {{ 18, -2, -16}, 0, 0}, /* 9 */
494  {{ 12, -2, -20}, 0, 0}, /* 10 */
495 };
496 
497 /* lowpass by mode **************/
498 static double _psy_lowpass_44_low[2]={
499  15.1,15.1,
500 };
501 static double _psy_lowpass_44[11]={
502  15.1,15.8,16.5,17.9,20.5,48.,999.,999.,999.,999.,999.
503 };
504 
505 /* noise normalization **********/
506 
507 static int _noise_start_short_44[10]={
508  16,16,16,16,32,32,9999,9999,9999,9999
509 };
510 static int _noise_start_long_44[10]={
511  128,128,128,256,512,512,9999,9999,9999,9999
512 };
513 static int _noise_part_short_44[10]={
514  8,8,8,8,8,8,8,8,8,8
515 };
516 static int _noise_part_long_44[10]={
517  32,32,32,32,32,32,32,32,32,32
518 };
519 static double _noise_thresh_44[10]={
520  .2,.2,.3,.4,.5,.5,9999.,9999.,9999.,9999.,
521 };
522 static double _noise_thresh_44_2[2]={
523  .5,.5,
524 };
525 
526 
527 static int _noise_start_short_44_low[2]={
528  32,32
529 };
530 static int _noise_start_long_44_low[2]={
531  256,256
532 };
Definition: vorbisenc.c:68