1 /********************************************************************
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. *
8 * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
9 * by the XIPHOPHORUS Company http://www.xiph.org/ *
11 ********************************************************************
13 function: key psychoacoustic settings for 44.1/48kHz
14 last mod: $Id: psych_44.h,v 1.8 2002/03/17 19:50:49 xiphmont Exp $
16 ********************************************************************/
19 /* preecho trigger settings *****************************************/
21 static vorbis_info_psy_global _psy_global_44[4]={
23 {8, /* lines per eighth octave */
24 /*{990.f,990.f,990.f,990.f}, {-990.f,-990.f,-990.f,-990.f}, -90.f,
25 {0.f,0.f,0.f,0.f}, {-0.f,-0.f,-0.f,-0.f}, -90.f,*/
26 {46.f,40.f,40.f,36.f}, {-990.f,-990.f,-990.f,-990.f}, -100.f,
29 {8, /* lines per eighth octave */
30 /*{990.f,990.f,990.f,990.f}, {-990.f,-990.f,-990.f,-990.f}, -90.f,*/
31 {40.f,36.f,32.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -100.f,
34 {8, /* lines per eighth octave */
35 {40.f,36.f,32.f,30.f}, {-60.f,-40.f,-40.f,-40.f}, -100.f,
38 {8, /* lines per eighth octave */
39 {40.f,36.f,32.f,30.f}, {-40.f,-36.f,-32.f,-30.f}, -100.f,
44 /* noise compander lookups * low, mid, high quality ****************/
46 static float _psy_compand_44_short[3][NOISE_COMPAND_LEVELS]={
49 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */
50 8.f, 9.f,10.f,11.f,12.f,13.f,14.f, 15.f, /* 15dB */
51 16.f,17.f,18.f,19.f,20.f,21.f,22.f, 23.f, /* 23dB */
52 24.f,25.f,26.f,27.f,28.f,29.f,30.f, 31.f, /* 31dB */
53 32.f,33.f,34.f,35.f,36.f,37.f,38.f, 39.f, /* 39dB */
57 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 6.f, /* 7dB */
58 7.f, 7.f, 7.f, 7.f, 6.f, 6.f, 6.f, 7.f, /* 15dB */
59 7.f, 8.f, 9.f,10.f,11.f,12.f,13.f, 14.f, /* 23dB */
60 15.f,16.f,17.f,17.f,17.f,18.f,18.f, 19.f, /* 31dB */
61 19.f,19.f,20.f,21.f,22.f,23.f,24.f, 25.f, /* 39dB */
65 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 5.f, 5.f, /* 7dB */
66 6.f, 6.f, 6.f, 5.f, 4.f, 4.f, 4.f, 4.f, /* 15dB */
67 4.f, 4.f, 5.f, 5.f, 5.f, 6.f, 6.f, 6.f, /* 23dB */
68 7.f, 7.f, 7.f, 8.f, 8.f, 8.f, 9.f, 10.f, /* 31dB */
69 11.f,12.f,13.f,14.f,15.f,16.f,17.f, 18.f, /* 39dB */
73 static float _psy_compand_44[3][NOISE_COMPAND_LEVELS]={
76 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */
77 8.f, 9.f,10.f,11.f,12.f,13.f,14.f, 15.f, /* 15dB */
78 16.f,17.f,18.f,19.f,20.f,21.f,22.f, 23.f, /* 23dB */
79 24.f,25.f,26.f,27.f,28.f,29.f,30.f, 31.f, /* 31dB */
80 32.f,33.f,34.f,35.f,36.f,37.f,38.f, 39.f, /* 39dB */
84 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */
85 8.f, 9.f,10.f,11.f,12.f,12.f,13.f, 13.f, /* 15dB */
86 13.f,14.f,14.f,14.f,15.f,15.f,15.f, 15.f, /* 23dB */
87 16.f,16.f,17.f,17.f,17.f,18.f,18.f, 19.f, /* 31dB */
88 19.f,19.f,20.f,21.f,22.f,23.f,24.f, 25.f, /* 39dB */
92 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */
93 8.f, 8.f, 7.f, 6.f, 5.f, 4.f, 4.f, 4.f, /* 15dB */
94 4.f, 4.f, 5.f, 5.f, 5.f, 6.f, 6.f, 6.f, /* 23dB */
95 7.f, 7.f, 7.f, 8.f, 8.f, 8.f, 9.f, 10.f, /* 31dB */
96 11.f,12.f,13.f,14.f,15.f,16.f,17.f, 18.f, /* 39dB */
100 /* tonal masking curve level adjustments *************************/
101 static vp_adjblock _vp_tonemask_adj_longblock[6]={
102 /* adjust for mode zero */
104 { 10, 10, 5, }, /*63*/
106 { 10, 10, 5, }, /* 125 */
108 { 10, 10, 5, }, /* 250 */
110 { 10, 10, 5, }, /* 500 */
112 { 10, 10, 5, }, /* 1000 */
115 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /* 2000 */
116 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
117 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /* 4000 */
118 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
119 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /* 8000 */
120 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
121 { 16, 16, 14, 12, 12, 15, 15, 15, 15, 15, 10}, /* 16000 */
124 /* adjust for mode two */
126 { 10, 10, 5, }, /*63*/
128 { 10, 10, 5, }, /* 125 */
130 { 10, 10, 5, }, /* 250 */
132 { 10, 10, 5, }, /* 500 */
134 { 10, 10, 5, }, /* 1000 */
139 { 10, 5, 5, }, /* 4000 */
141 { 10, 10, 7, 5, }, /* 8000 */
142 { 10, 10, 7, 7, 5, 5, 10, 10, 10, 5, },
143 { 16, 16, 14, 8, 8, 8, 10, 10, 10, 5, }, /* 16000 */
146 /* adjust for mode four */
148 { 10, 5, 5, }, /*63*/
150 { 10, 5, 5, }, /* 125 */
152 { 10, 5, 5, }, /* 250 */
154 { 10, 5, 5, }, /* 500 */
156 { 10, 5, 5, }, /* 1000 */
163 { 10, 10, 7, 5, }, /* 8000 */
164 { 10, 10, 7, 5, 5, 5, 10, 10, 10, 5, },
165 { 16, 16, 14, 8, 8, 8, 10, 10, 10, 5, }, /* 16000 */
168 /* adjust for mode six */
170 { 10, 5, 5, }, /*63*/
172 { 10, 5, 5, }, /* 125 */
174 { 10, 5, 5, }, /* 250 */
176 { 10, 5, 5, }, /* 500 */
178 { 10, 5, 5, }, /* 1000 */
185 { 10, 10, 7, 5, }, /* 8000 */
186 { 10, 10, 7, 5, 5, 5, 5, 5, 5, },
187 { 12, 10, 10, 5, 5, 5, 5, 5, 5, }, /* 16000 */
190 /* adjust for mode eight */
209 { 5, 5, 5, 5, 5, 5, 5, }, /* 16000 */
212 /* adjust for mode ten */
214 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*63*/
215 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
216 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*125*/
217 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
218 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*250*/
219 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
220 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*500*/
221 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
222 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*1000*/
223 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
224 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*2000*/
225 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
226 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*4000*/
227 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
228 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*8000*/
229 { 0, 0, 0, -5,-10,-10,-10,-15,-15,-15,-15},
230 { 0, 0, 0, 0, 0, -5, -5,-10,-15,-15,-15}, /*16000*/
234 static vp_adjblock _vp_tonemask_adj_otherblock[6]={
235 /* adjust for mode zero */
237 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*63*/
238 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10},
239 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*125*/
240 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10},
241 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*250*/
242 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10},
243 { 5, 5, 5, 0, -5, -5, -5, -5, -5, -5, -5}, /*500*/
244 { 5, 5, 5, 0, -5, -5, -5, -5, -5, -5, -5},
246 { 5, 5, 5, }, /*1000*/
249 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /*2000*/
250 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
251 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /*4000*/
252 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
253 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /*8000*/
254 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
255 { 16, 16, 14, 12, 12, 15, 15, 15, 15, 15, 10}, /*16000*/
258 /* adjust for mode two */
260 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*63*/
261 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10},
262 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*125*/
263 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10},
264 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*250*/
265 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10},
266 { 5, 5, 5, 0, -5, -5, -5, -5, -5, -5, -5}, /*500*/
267 { 5, 5, 5, 0, -5, -5, -5, -5, -5, -5, -5},
269 { 10, 10, 5, }, /* 1000 */
276 { 10, 10, 7, 5, }, /* 8000 */
277 { 10, 10, 7, 7, 5, 5, 10, 10, 10, 5, },
278 { 16, 16, 14, 8, 8, 8, 10, 10, 10, 5, }, /* 16000 */
281 /* adjust for mode four */
283 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*63*/
284 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
285 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*125*/
286 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
287 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*250*/
288 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
289 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*500*/
290 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
292 { 5, 5, 5, }, /* 1000 */
299 { 10, 10, 7, 5, }, /* 8000 */
300 { 10, 10, 7, 5, 5, 5, 10, 10, 10, 5, },
301 { 16, 16, 14, 8, 8, 8, 10, 10, 10, 5, }, /* 16000 */
304 /* adjust for mode six */
306 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*63*/
307 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
308 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*125*/
309 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
310 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*250*/
311 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
312 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*500*/
313 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
315 { 5, 5, 5, }, /* 1000 */
322 { 10, 10, 7, 5, }, /* 8000 */
323 { 10, 10, 7, 5, 5, 5, 5, 5, 5, },
324 { 12, 10, 10, 5, 5, 5, 5, 5, 5, }, /* 16000 */
327 /* adjust for mode eight */
329 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, /*63*/
330 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20},
331 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, /*125*/
332 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20},
333 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, /*250*/
334 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20},
335 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, /*500*/
336 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20},
338 { 0,-10,-10,-15,-15,-15,-15,-15,-15,-15,-15},
339 { 0,-10,-10,-15,-15,-15,-15,-15,-15,-15,-15},
347 { 5, 5, 5, 5, 5, 5, 5, }, /* 16000 */
350 /* adjust for mode ten */
352 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*63*/
353 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20},
354 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*125*/
355 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20},
356 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*250*/
357 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20},
358 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*500*/
359 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20},
360 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*1000*/
361 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20},
362 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*2000*/
363 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
364 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*4000*/
365 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
366 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*8000*/
367 { 0, 0, 0, -5,-10,-10,-10,-15,-15,-15,-15},
368 { 0, 0, 0, 0, 0, -5, -5,-10,-15,-15,-15}, /*16000*/
372 static vp_adjblock _vp_peakguard[6]={
375 {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},/*63*/
376 {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},
377 {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},/*125*/
378 {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},
379 {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},/*250*/
380 {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},
381 {-10,-10,-10,-10,-16,-16,-18,-20,-22,-24,-24},/*500*/
382 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-24,-24},
383 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-24,-24},/*1000*/
384 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-24,-24},
385 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-24,-24},/*2000*/
386 {-10,-10,-10,-12,-16,-16,-16,-20,-22,-24,-24},
387 {-10,-10,-10,-12,-16,-16,-16,-20,-22,-24,-24},/*4000*/
388 {-10,-10,-10,-12,-12,-14,-16,-18,-22,-24,-24},
389 {-10,-10,-10,-10,-10,-14,-16,-18,-22,-24,-24},/*8000*/
390 {-10,-10,-10,-10,-10,-14,-16,-18,-22,-24,-24},
391 {-10,-10,-10,-10,-10,-12,-16,-18,-22,-24,-24},/*16000*/
395 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},/*63*/
396 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},
397 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},/*125*/
398 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},
399 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},/*250*/
400 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},
401 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},/*500*/
402 {-10,-10,-10,-10,-14,-14,-14,-20,-26,-30,-30},
403 {-10,-10,-10,-10,-14,-14,-14,-20,-22,-30,-30},/*1000*/
404 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-30,-30},
405 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-30,-30},/*2000*/
406 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-30,-30},
407 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-30,-30},/*4000*/
408 {-10,-10,-10,-10,-10,-11,-12,-13,-22,-30,-30},
409 {-10,-10,-10,-10,-10,-11,-12,-13,-22,-30,-30},/*8000*/
410 {-10,-10,-10,-10,-10,-10,-10,-11,-22,-30,-30},
411 {-10,-10,-10,-10,-10,-10,-10,-10,-20,-30,-30},/*16000*/
415 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*63*/
416 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},
417 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*125*/
418 {-14,-20,-20,-20,-20,-20,-20,-30,-32,-32,-40},
419 {-14,-20,-20,-20,-20,-20,-20,-30,-32,-32,-40},/*250*/
420 {-14,-20,-20,-20,-20,-20,-20,-24,-32,-32,-40},
421 {-14,-20,-20,-20,-20,-20,-20,-24,-32,-32,-40},/*500*/
422 {-10,-10,-10,-10,-14,-16,-20,-24,-26,-32,-40},
423 {-10,-10,-10,-10,-14,-16,-20,-24,-22,-32,-40},/*1000*/
424 {-10,-10,-10,-10,-14,-16,-20,-24,-22,-32,-40},
425 {-10,-10,-10,-10,-14,-16,-20,-24,-22,-32,-40},/*2000*/
426 {-10,-10,-10,-10,-14,-16,-20,-24,-22,-32,-40},
427 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-32,-40},/*4000*/
428 {-10,-10,-10,-10,-10,-11,-12,-13,-22,-32,-40},
429 {-10,-10,-10,-10,-10,-11,-12,-13,-22,-32,-40},/*8000*/
430 {-10,-10,-10,-10,-10,-10,-10,-11,-22,-32,-40},
431 {-10,-10,-10,-10,-10,-10,-10,-10,-20,-32,-40},/*16000*/
435 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*63*/
436 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},
437 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*125*/
438 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},
439 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*250*/
440 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},
441 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*500*/
442 {-14,-14,-14,-16,-20,-22,-24,-24,-28,-32,-40},
443 {-14,-14,-14,-16,-20,-22,-24,-24,-28,-32,-40},/*1000*/
444 {-14,-14,-14,-16,-20,-22,-24,-24,-28,-32,-40},
445 {-14,-14,-16,-20,-24,-26,-26,-28,-30,-32,-40},/*2000*/
446 {-14,-14,-16,-20,-24,-26,-26,-28,-30,-32,-40},
447 {-14,-14,-16,-20,-24,-26,-26,-28,-30,-32,-40},/*4000*/
448 {-14,-14,-14,-20,-22,-22,-24,-24,-26,-32,-40},
449 {-14,-14,-14,-18,-20,-20,-24,-24,-24,-32,-40},/*8000*/
450 {-14,-14,-14,-18,-20,-20,-24,-24,-24,-32,-40},
451 {-14,-14,-14,-18,-20,-20,-22,-24,-24,-32,-40},/*16000*/
455 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*63*/
456 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*88*/
457 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*125*/
458 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*170*/
459 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*250*/
460 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*350*/
461 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*500*/
462 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*700*/
463 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*1000*/
464 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*1400*/
465 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*2000*/
466 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*2800*/
467 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*4000*/
468 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*5600*/
469 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*8000*/
470 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*11500*/
471 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*16600*/
475 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*63*/
476 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*88*/
477 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*125*/
478 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*170*/
479 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*250*/
480 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*350*/
481 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*500*/
482 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*700*/
483 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*1000*/
484 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*1400*/
485 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*2000*/
486 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*2800*/
487 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*4000*/
488 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*5600*/
489 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*8000*/
490 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*11500*/
491 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*16600*/
495 static int _psy_noisebias_long[11][17]={
496 /*63 125 250 500 1k 2k 4k 8k 16k*/
497 {-20,-20,-18,-18,-18,-16,-14, -8, -6, -2, 0, 2, 3, 3, 4, 4, 10},
498 {-20,-20,-20,-20,-20,-20,-20,-10, -6, -2, -2, -2, 1, 1, 2, 2, 4},
499 {-20,-20,-20,-20,-20,-20,-20,-10, -6, -2, -3, -3, -1, -1, 0, 1, 2},
500 {-20,-20,-20,-20,-20,-20,-20,-10, -6, -2, -3, -3, -1, -1, 0, 1, 2},
501 {-20,-20,-20,-20,-20,-20,-20,-10, -6, -3, -4, -4, -2, -1, 0, 0, 2},
503 {-20,-20,-20,-20,-20,-20,-20,-18,-10, -4, -6, -6, -3, -2, -2, -2, 0},
504 {-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -8, -8, -7, -7, -6, -6, -4},
505 {-24,-24,-24,-24,-24,-24,-24,-18,-14,-14,-16,-16,-14,-12,-10,-10, -8},
507 {-24,-24,-24,-24,-24,-24,-24,-20,-20,-20,-20,-20,-16,-16,-14,-14,-10},
508 {-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-24,-24,-24,-24},
509 {-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-46},
512 static int _psy_noisebias_impulse[11][17]={
513 /*63 125 250 500 1k 2k 4k 8k 16k*/
514 {-20,-20,-20,-20,-20,-18,-14,-10,-10, -2, 2, 2, 2, 2, 2, 3, 6},
515 {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -4, -4, -2, -2, -2, -2, 2},
516 {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
517 {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, -2},
518 {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2},
520 {-30,-30,-30,-30,-30,-30,-24,-20,-10,-12,-14,-14,-10, -9, -8, -6, -4},
521 {-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10, -8},
522 {-34,-34,-34,-34,-30,-30,-30,-24,-20,-20,-20,-20,-20,-18,-16,-16,-14},
524 {-34,-34,-34,-34,-30,-30,-30,-30,-30,-26,-26,-26,-26,-22,-20,-20,-16},
525 {-40,-40,-40,-40,-40,-40,-40,-40,-40,-36,-36,-36,-36,-36,-36,-30,-30},
526 {-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50},
529 static int _psy_noisebias_other[11][17]={
530 /*63 125 250 500 1k 2k 4k 8k 16k*/
531 {-20,-20,-20,-20,-20,-18,-14,-10, -6, -2, 2, 2, 3, 3, 4, 4, 10},
532 {-26,-26,-26,-26,-26,-22,-20,-14,-10, -2, -2, -2, 1, 1, 2, 2, 4},
533 {-30,-30,-30,-30,-26,-22,-20,-14,-10, -2, -3, -3, -1, -1, 0, 1, 2},
534 {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -1, -1, 0, 1, 2},
535 {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -4, -4, -2, -1, 0, 0, 2},
537 {-30,-30,-30,-30,-30,-30,-24,-20,-10, -4, -6, -6, -3, -2, -2, -2, 0},
538 {-34,-34,-34,-34,-30,-30,-24,-20,-14, -8, -8, -8, -7, -7, -6, -6, -4},
539 {-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10, -8},
541 {-34,-34,-34,-34,-30,-30,-30,-20,-20,-20,-20,-20,-16,-16,-14,-14,-10},
542 {-40,-40,-40,-40,-40,-40,-40,-30,-30,-30,-30,-30,-30,-24,-24,-24,-24},
543 {-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-46},
546 static int _psy_noiseguards_short[33]={
559 static int _psy_noiseguards_long[33]={
573 static double _psy_tone_masteratt[11]={
574 3.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
577 static double _psy_tone_masterguard[11]={
578 -18.,-24.,-24.,-24.,-26.,-40.,-40.,-40.,-45.,-45.,-45.,
581 static double _psy_tone_suppress[11]={
582 -10.,-20.,-20.,-20.,-30.,-30.,-40.,-40.,-45.,-45.,-45.,
585 static double _psy_tone_0dB[11]={
586 95.,95.,95.,95.,95.,105.,105.,105.,105.,105.,105.,
589 static double _psy_noise_suppress[11]={
590 -0.,-24.,-24.,-24.,-24.,-30.,-40.,-40.,-45.,-45.,-45.,
593 static int _psy_ehmer_bandlimit[11]={
594 0,0,0,0,4,4,30,30,30,30,30,
597 static vorbis_info_psy _psy_info_template={
599 /* tonemask att,guard,suppr,curves peakattp,curvelimitp,peaksettings*/
600 0.f, -40.f,-40.f, {{{0.}}}, 1, 0, {{{0.}}},
602 /*noisemaskp,supp, low/high window, low/hi guard, minimum */
603 1, -0.f, .5f, .5f, 0,0,0,
604 {-1},{-1},105.f,{{-1,-1,{{-1,-1,-1,-1}}}}
607 /* ath ****************/
609 static double _psy_ath_floater[11]={
610 -100.,-100.,-100.,-100.,-100.,-100.,-105.,-105.,-105.,-110.,-120.,
613 static double _psy_ath_abs[11]={
614 -110.,-110.,-120.,-140.,-140.,-140.,-140.,-140.,-140.,-140.,-150.,
617 static float ATH_Bark_dB[][27]={
619 0.f, 15.f, 15.f, 15.f, 11.f, 10.f, 8.f, 7.f, 7.f, 7.f,
620 6.f, 2.f, 0.f, 0.f, -2.f, -5.f, -6.f, -6.f, -4.f, 4.f,
621 14.f, 20.f, 19.f, 17.f, 30.f, 60.f, 70.f,
624 0.f, 15.f, 15.f, 15.f, 11.f, 10.f, 8.f, 7.f, 7.f, 7.f,
625 6.f, 2.f, 0.f, 0.f, -2.f, -5.f, -6.f, -6.f, -4.f, 0.f,
626 2.f, 6.f, 5.f, 5.f, 15.f, 30.f, 50.f,
629 0.f, 15.f, 15.f, 15.f, 11.f, 10.f, 8.f, 7.f, 7.f, 7.f,
630 6.f, 2.f, 0.f, 0.f, -3.f, -5.f, -6.f, -6.f, -4.5f, -4.f,
631 2.f, 6.f, 5.f, 5.f, 15.f, 20.f, 40.f,
635 /* stereo ****************/
636 static int _psy_stereo_point_dB_44[11]={3, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0};
637 static double _psy_stereo_point_kHz_44[2][11]={
638 {4., 6., 6., 6., 10., 6., 6., 4., 4., 4., 4.},
639 {6., 6., 6., 10., 10., 6., 6., 4., 4., 4., 4.}
642 /* lowpass **************/
643 static double _psy_lowpass_44[11]={
644 15.1,15.8,16.5,17.9,20.5,48.,999.,999.,999.,999.,999.
647 /* management noise offset */
649 static double _bm_max_noise_offset[11]={
650 1.,2.,3.,3.,4.,4.,4.,4.,4.,4.,4.