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.7 2001/12/22 09:40:40 xiphmont Exp $
16 ********************************************************************/
19 /* preecho trigger settings *****************************************/
21 static vorbis_info_psy_global _psy_global_44[3]={
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 {30.f,30.f,30.f,34.f}, {-990.f,-990.f,-990.f,-990.f}, -90.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 {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f,
34 {8, /* lines per eighth octave */
35 {26.f,26.f,26.f,30.f}, {-26.f,-26.f,-26.f,-30.f}, -90.f,
40 /* noise compander lookups * low, mid, high quality ****************/
42 static float _psy_compand_44_short[3][NOISE_COMPAND_LEVELS]={
45 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */
46 8.f, 9.f,10.f,11.f,12.f,13.f,14.f, 15.f, /* 15dB */
47 16.f,17.f,18.f,19.f,20.f,21.f,22.f, 23.f, /* 23dB */
48 24.f,25.f,26.f,27.f,28.f,29.f,30.f, 31.f, /* 31dB */
49 32.f,33.f,34.f,35.f,36.f,37.f,38.f, 39.f, /* 39dB */
53 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 6.f, /* 7dB */
54 7.f, 7.f, 7.f, 7.f, 6.f, 6.f, 6.f, 7.f, /* 15dB */
55 7.f, 8.f, 9.f,10.f,11.f,12.f,13.f, 14.f, /* 23dB */
56 15.f,16.f,17.f,17.f,17.f,18.f,18.f, 19.f, /* 31dB */
57 19.f,19.f,20.f,21.f,22.f,23.f,24.f, 25.f, /* 39dB */
61 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 5.f, 5.f, /* 7dB */
62 6.f, 6.f, 6.f, 5.f, 4.f, 4.f, 4.f, 4.f, /* 15dB */
63 4.f, 4.f, 5.f, 5.f, 5.f, 6.f, 6.f, 6.f, /* 23dB */
64 7.f, 7.f, 7.f, 8.f, 8.f, 8.f, 9.f, 10.f, /* 31dB */
65 11.f,12.f,13.f,14.f,15.f,16.f,17.f, 18.f, /* 39dB */
69 static float _psy_compand_44[3][NOISE_COMPAND_LEVELS]={
72 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */
73 8.f, 9.f,10.f,11.f,12.f,13.f,14.f, 15.f, /* 15dB */
74 16.f,17.f,18.f,19.f,20.f,21.f,22.f, 23.f, /* 23dB */
75 24.f,25.f,26.f,27.f,28.f,29.f,30.f, 31.f, /* 31dB */
76 32.f,33.f,34.f,35.f,36.f,37.f,38.f, 39.f, /* 39dB */
80 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */
81 8.f, 9.f,10.f,11.f,12.f,12.f,13.f, 13.f, /* 15dB */
82 13.f,14.f,14.f,14.f,15.f,15.f,15.f, 15.f, /* 23dB */
83 16.f,16.f,17.f,17.f,17.f,18.f,18.f, 19.f, /* 31dB */
84 19.f,19.f,20.f,21.f,22.f,23.f,24.f, 25.f, /* 39dB */
88 0.f, 1.f, 2.f, 3.f, 4.f, 5.f, 6.f, 7.f, /* 7dB */
89 8.f, 8.f, 7.f, 6.f, 5.f, 4.f, 4.f, 4.f, /* 15dB */
90 4.f, 4.f, 5.f, 5.f, 5.f, 6.f, 6.f, 6.f, /* 23dB */
91 7.f, 7.f, 7.f, 8.f, 8.f, 8.f, 9.f, 10.f, /* 31dB */
92 11.f,12.f,13.f,14.f,15.f,16.f,17.f, 18.f, /* 39dB */
96 /* tonal masking curve level adjustments *************************/
97 static vp_adjblock _vp_tonemask_adj_longblock[6]={
98 /* adjust for mode zero */
100 { 10, 10, 5, }, /*63*/
102 { 10, 10, 5, }, /* 125 */
104 { 10, 10, 5, }, /* 250 */
106 { 10, 10, 5, }, /* 500 */
108 { 10, 10, 5, }, /* 1000 */
111 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /* 2000 */
112 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
113 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /* 4000 */
114 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
115 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /* 8000 */
116 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
117 { 16, 16, 14, 12, 12, 15, 15, 15, 15, 15, 10}, /* 16000 */
120 /* adjust for mode two */
122 { 10, 10, 5, }, /*63*/
124 { 10, 10, 5, }, /* 125 */
126 { 10, 10, 5, }, /* 250 */
128 { 10, 10, 5, }, /* 500 */
130 { 10, 10, 5, }, /* 1000 */
135 { 10, 5, 5, }, /* 4000 */
137 { 10, 10, 7, 5, }, /* 8000 */
138 { 10, 10, 7, 7, 5, 5, 10, 10, 10, 5, },
139 { 16, 16, 14, 8, 8, 8, 10, 10, 10, 5, }, /* 16000 */
142 /* adjust for mode four */
144 { 10, 5, 5, }, /*63*/
146 { 10, 5, 5, }, /* 125 */
148 { 10, 5, 5, }, /* 250 */
150 { 10, 5, 5, }, /* 500 */
152 { 10, 5, 5, }, /* 1000 */
159 { 10, 10, 7, 5, }, /* 8000 */
160 { 10, 10, 7, 5, 5, 5, 10, 10, 10, 5, },
161 { 16, 16, 14, 8, 8, 8, 10, 10, 10, 5, }, /* 16000 */
164 /* adjust for mode six */
166 { 10, 5, 5, }, /*63*/
168 { 10, 5, 5, }, /* 125 */
170 { 10, 5, 5, }, /* 250 */
172 { 10, 5, 5, }, /* 500 */
174 { 10, 5, 5, }, /* 1000 */
181 { 10, 10, 7, 5, }, /* 8000 */
182 { 10, 10, 7, 5, 5, 5, 5, 5, 5, },
183 { 12, 10, 10, 5, 5, 5, 5, 5, 5, }, /* 16000 */
186 /* adjust for mode eight */
205 { 5, 5, 5, 5, 5, 5, 5, }, /* 16000 */
208 /* adjust for mode ten */
210 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*63*/
211 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
212 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*125*/
213 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
214 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*250*/
215 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
216 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*500*/
217 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
218 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*1000*/
219 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
220 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*2000*/
221 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
222 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*4000*/
223 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
224 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*8000*/
225 { 0, 0, 0, -5,-10,-10,-10,-15,-15,-15,-15},
226 { 0, 0, 0, 0, 0, -5, -5,-10,-15,-15,-15}, /*16000*/
230 static vp_adjblock _vp_tonemask_adj_otherblock[6]={
231 /* adjust for mode zero */
233 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*63*/
234 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10},
235 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*125*/
236 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10},
237 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*250*/
238 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10},
239 { 5, 5, 5, 0, -5, -5, -5, -5, -5, -5, -5}, /*500*/
240 { 5, 5, 5, 0, -5, -5, -5, -5, -5, -5, -5},
242 { 5, 5, 5, }, /*1000*/
245 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /*2000*/
246 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
247 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /*4000*/
248 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
249 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, /*8000*/
250 { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10},
251 { 16, 16, 14, 12, 12, 15, 15, 15, 15, 15, 10}, /*16000*/
254 /* adjust for mode two */
256 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*63*/
257 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10},
258 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*125*/
259 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10},
260 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10}, /*250*/
261 { 0, 0, 0, 0,-10,-10,-10,-10,-10,-10,-10},
262 { 5, 5, 5, 0, -5, -5, -5, -5, -5, -5, -5}, /*500*/
263 { 5, 5, 5, 0, -5, -5, -5, -5, -5, -5, -5},
265 { 10, 10, 5, }, /* 1000 */
272 { 10, 10, 7, 5, }, /* 8000 */
273 { 10, 10, 7, 7, 5, 5, 10, 10, 10, 5, },
274 { 16, 16, 14, 8, 8, 8, 10, 10, 10, 5, }, /* 16000 */
277 /* adjust for mode four */
279 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*63*/
280 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
281 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*125*/
282 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
283 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*250*/
284 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
285 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*500*/
286 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
288 { 5, 5, 5, }, /* 1000 */
295 { 10, 10, 7, 5, }, /* 8000 */
296 { 10, 10, 7, 5, 5, 5, 10, 10, 10, 5, },
297 { 16, 16, 14, 8, 8, 8, 10, 10, 10, 5, }, /* 16000 */
300 /* adjust for mode six */
302 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*63*/
303 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
304 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*125*/
305 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
306 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*250*/
307 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
308 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*500*/
309 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
311 { 5, 5, 5, }, /* 1000 */
318 { 10, 10, 7, 5, }, /* 8000 */
319 { 10, 10, 7, 5, 5, 5, 5, 5, 5, },
320 { 12, 10, 10, 5, 5, 5, 5, 5, 5, }, /* 16000 */
323 /* adjust for mode eight */
325 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, /*63*/
326 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20},
327 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, /*125*/
328 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20},
329 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, /*250*/
330 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20},
331 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20}, /*500*/
332 {-10,-10,-10,-15,-15,-15,-15,-20,-20,-20,-20},
334 { 0,-10,-10,-15,-15,-15,-15,-15,-15,-15,-15},
335 { 0,-10,-10,-15,-15,-15,-15,-15,-15,-15,-15},
343 { 5, 5, 5, 5, 5, 5, 5, }, /* 16000 */
346 /* adjust for mode ten */
348 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*63*/
349 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20},
350 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*125*/
351 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20},
352 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*250*/
353 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20},
354 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*500*/
355 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20},
356 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20}, /*1000*/
357 { 0, 0, 0, -5,-15,-20,-20,-20,-20,-20,-20},
358 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*2000*/
359 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
360 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*4000*/
361 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15},
362 { 0, 0, 0, -5,-15,-15,-15,-15,-15,-15,-15}, /*8000*/
363 { 0, 0, 0, -5,-10,-10,-10,-15,-15,-15,-15},
364 { 0, 0, 0, 0, 0, -5, -5,-10,-15,-15,-15}, /*16000*/
368 static vp_adjblock _vp_peakguard[6]={
371 {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},/*63*/
372 {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},
373 {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},/*125*/
374 {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},
375 {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},/*250*/
376 {-14,-16,-18,-19,-24,-24,-24,-24,-24,-24,-24},
377 {-10,-10,-10,-10,-16,-16,-18,-20,-22,-24,-24},/*500*/
378 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-24,-24},
379 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-24,-24},/*1000*/
380 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-24,-24},
381 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-24,-24},/*2000*/
382 {-10,-10,-10,-12,-16,-16,-16,-20,-22,-24,-24},
383 {-10,-10,-10,-12,-16,-16,-16,-20,-22,-24,-24},/*4000*/
384 {-10,-10,-10,-12,-12,-14,-16,-18,-22,-24,-24},
385 {-10,-10,-10,-10,-10,-14,-16,-18,-22,-24,-24},/*8000*/
386 {-10,-10,-10,-10,-10,-14,-16,-18,-22,-24,-24},
387 {-10,-10,-10,-10,-10,-12,-16,-18,-22,-24,-24},/*16000*/
391 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},/*63*/
392 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},
393 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},/*125*/
394 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},
395 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},/*250*/
396 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},
397 {-14,-20,-20,-20,-26,-30,-30,-30,-30,-30,-30},/*500*/
398 {-10,-10,-10,-10,-14,-14,-14,-20,-26,-30,-30},
399 {-10,-10,-10,-10,-14,-14,-14,-20,-22,-30,-30},/*1000*/
400 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-30,-30},
401 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-30,-30},/*2000*/
402 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-30,-30},
403 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-30,-30},/*4000*/
404 {-10,-10,-10,-10,-10,-11,-12,-13,-22,-30,-30},
405 {-10,-10,-10,-10,-10,-11,-12,-13,-22,-30,-30},/*8000*/
406 {-10,-10,-10,-10,-10,-10,-10,-11,-22,-30,-30},
407 {-10,-10,-10,-10,-10,-10,-10,-10,-20,-30,-30},/*16000*/
411 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*63*/
412 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},
413 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*125*/
414 {-14,-20,-20,-20,-20,-20,-20,-30,-32,-32,-40},
415 {-14,-20,-20,-20,-20,-20,-20,-30,-32,-32,-40},/*250*/
416 {-14,-20,-20,-20,-20,-20,-20,-24,-32,-32,-40},
417 {-14,-20,-20,-20,-20,-20,-20,-24,-32,-32,-40},/*500*/
418 {-10,-10,-10,-10,-14,-16,-20,-24,-26,-32,-40},
419 {-10,-10,-10,-10,-14,-16,-20,-24,-22,-32,-40},/*1000*/
420 {-10,-10,-10,-10,-14,-16,-20,-24,-22,-32,-40},
421 {-10,-10,-10,-10,-14,-16,-20,-24,-22,-32,-40},/*2000*/
422 {-10,-10,-10,-10,-14,-16,-20,-24,-22,-32,-40},
423 {-10,-10,-10,-10,-14,-14,-16,-20,-22,-32,-40},/*4000*/
424 {-10,-10,-10,-10,-10,-11,-12,-13,-22,-32,-40},
425 {-10,-10,-10,-10,-10,-11,-12,-13,-22,-32,-40},/*8000*/
426 {-10,-10,-10,-10,-10,-10,-10,-11,-22,-32,-40},
427 {-10,-10,-10,-10,-10,-10,-10,-10,-20,-32,-40},/*16000*/
431 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*63*/
432 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},
433 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*125*/
434 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},
435 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*250*/
436 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},
437 {-14,-20,-20,-20,-26,-32,-32,-32,-32,-32,-40},/*500*/
438 {-14,-14,-14,-16,-20,-22,-24,-24,-28,-32,-40},
439 {-14,-14,-14,-16,-20,-22,-24,-24,-28,-32,-40},/*1000*/
440 {-14,-14,-14,-16,-20,-22,-24,-24,-28,-32,-40},
441 {-14,-14,-16,-20,-24,-26,-26,-28,-30,-32,-40},/*2000*/
442 {-14,-14,-16,-20,-24,-26,-26,-28,-30,-32,-40},
443 {-14,-14,-16,-20,-24,-26,-26,-28,-30,-32,-40},/*4000*/
444 {-14,-14,-14,-20,-22,-22,-24,-24,-26,-32,-40},
445 {-14,-14,-14,-18,-20,-20,-24,-24,-24,-32,-40},/*8000*/
446 {-14,-14,-14,-18,-20,-20,-24,-24,-24,-32,-40},
447 {-14,-14,-14,-18,-20,-20,-22,-24,-24,-32,-40},/*16000*/
451 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*63*/
452 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*88*/
453 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*125*/
454 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*170*/
455 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*250*/
456 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*350*/
457 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*500*/
458 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*700*/
459 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*1000*/
460 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*1400*/
461 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*2000*/
462 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*2800*/
463 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*4000*/
464 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*5600*/
465 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*8000*/
466 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*11500*/
467 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-40,-40},/*16600*/
471 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*63*/
472 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*88*/
473 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*125*/
474 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*170*/
475 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*250*/
476 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*350*/
477 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*500*/
478 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*700*/
479 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*1000*/
480 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*1400*/
481 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*2000*/
482 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*2800*/
483 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*4000*/
484 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*5600*/
485 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*8000*/
486 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*11500*/
487 {-14,-20,-24,-26,-32,-34,-36,-38,-40,-44,-46},/*16600*/
491 static int _psy_noisebias_long[11][17]={
492 /*63 125 250 500 1k 2k 4k 8k 16k*/
493 {-20,-20,-18,-18,-18,-16,-14, -8, -6, -2, 0, 2, 3, 3, 4, 4, 10},
494 {-20,-20,-20,-20,-20,-20,-20,-10, -6, -2, -2, -2, 1, 1, 2, 2, 4},
495 {-20,-20,-20,-20,-20,-20,-20,-10, -6, -2, -3, -3, -1, -1, 0, 1, 2},
496 {-20,-20,-20,-20,-20,-20,-20,-10, -6, -2, -3, -3, -1, -1, 0, 1, 2},
497 {-20,-20,-20,-20,-20,-20,-20,-10, -6, -3, -4, -4, -2, -1, 0, 0, 2},
499 {-20,-20,-20,-20,-20,-20,-20,-18,-10, -4, -6, -6, -3, -2, -2, -2, 0},
500 {-24,-24,-24,-24,-24,-24,-24,-18,-14, -8, -8, -8, -7, -7, -6, -6, -4},
501 {-24,-24,-24,-24,-24,-24,-24,-18,-14,-14,-16,-16,-14,-12,-10,-10, -8},
503 {-24,-24,-24,-24,-24,-24,-24,-20,-20,-20,-20,-20,-16,-16,-14,-14,-10},
504 {-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-30,-24,-24,-24,-24},
505 {-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-46},
508 static int _psy_noisebias_impulse[11][17]={
509 /*63 125 250 500 1k 2k 4k 8k 16k*/
510 {-20,-20,-20,-20,-20,-18,-14,-10,-10, -2, 2, 2, 2, 2, 2, 3, 6},
511 {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -4, -4, -2, -2, -2, -2, 2},
512 {-30,-30,-30,-30,-26,-22,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, 0},
513 {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -6, -6, -4, -4, -4, -2, -2},
514 {-30,-30,-30,-30,-30,-24,-20,-14,-10, -6, -8, -8, -6, -6, -6, -4, -2},
516 {-30,-30,-30,-30,-30,-30,-24,-20,-10,-12,-14,-14,-10, -9, -8, -6, -4},
517 {-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10, -8},
518 {-34,-34,-34,-34,-30,-30,-30,-24,-20,-20,-20,-20,-20,-18,-16,-16,-14},
520 {-34,-34,-34,-34,-30,-30,-30,-30,-30,-26,-26,-26,-26,-22,-20,-20,-16},
521 {-40,-40,-40,-40,-40,-40,-40,-40,-40,-36,-36,-36,-36,-36,-36,-30,-30},
522 {-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50},
525 static int _psy_noisebias_other[11][17]={
526 /*63 125 250 500 1k 2k 4k 8k 16k*/
527 {-20,-20,-20,-20,-20,-18,-14,-10, -6, -2, 2, 2, 3, 3, 4, 4, 10},
528 {-26,-26,-26,-26,-26,-22,-20,-14,-10, -2, -2, -2, 1, 1, 2, 2, 4},
529 {-30,-30,-30,-30,-26,-22,-20,-14,-10, -2, -3, -3, -1, -1, 0, 1, 2},
530 {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -3, -3, -1, -1, 0, 1, 2},
531 {-30,-30,-30,-30,-26,-22,-20,-14,-10, -4, -4, -4, -2, -1, 0, 0, 2},
533 {-30,-30,-30,-30,-30,-30,-24,-20,-10, -4, -6, -6, -3, -2, -2, -2, 0},
534 {-34,-34,-34,-34,-30,-30,-24,-20,-14, -8, -8, -8, -7, -7, -6, -6, -4},
535 {-34,-34,-34,-34,-30,-30,-24,-20,-14,-14,-16,-16,-14,-12,-10,-10, -8},
537 {-34,-34,-34,-34,-30,-30,-30,-20,-20,-20,-20,-20,-16,-16,-14,-14,-10},
538 {-40,-40,-40,-40,-40,-40,-40,-30,-30,-30,-30,-30,-30,-24,-24,-24,-24},
539 {-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-50,-46},
542 static int _psy_noiseguards_short[33]={
555 static int _psy_noiseguards_long[33]={
569 static double _psy_tone_masteratt[11]={
570 3.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
573 static double _psy_tone_masterguard[11]={
574 -18.,-24.,-24.,-24.,-26.,-40.,-40.,-40.,-45.,-45.,-45.,
577 static double _psy_tone_suppress[11]={
578 -10.,-20.,-20.,-20.,-30.,-30.,-40.,-40.,-45.,-45.,-45.,
581 static double _psy_tone_0dB[11]={
582 95.,95.,95.,95.,95.,105.,105.,105.,105.,105.,105.,
585 static double _psy_noise_suppress[11]={
586 -0.,-24.,-24.,-24.,-24.,-30.,-40.,-40.,-45.,-45.,-45.,
589 static int _psy_ehmer_bandlimit[11]={
590 0,0,0,0,4,4,30,30,30,30,30,
593 static vorbis_info_psy _psy_info_template={
595 /* tonemask att,guard,suppr,curves peakattp,curvelimitp,peaksettings*/
596 0.f, -40.f,-40.f, {{{0.}}}, 1, 0, {{{0.}}},
598 /*noisemaskp,supp, low/high window, low/hi guard, minimum */
599 1, -0.f, .5f, .5f, 0,0,0,
600 {-1},{-1},105.f,{{-1,-1,{{-1,-1,-1,-1}}}}
603 /* ath ****************/
605 static double _psy_ath_floater[11]={
606 -100.,-100.,-100.,-100.,-100.,-100.,-105.,-105.,-105.,-110.,-120.,
609 static double _psy_ath_abs[11]={
610 -110.,-110.,-120.,-140.,-140.,-140.,-140.,-140.,-140.,-140.,-150.,
613 static float ATH_Bark_dB[][27]={
615 0.f, 15.f, 15.f, 15.f, 11.f, 10.f, 8.f, 7.f, 7.f, 7.f,
616 6.f, 2.f, 0.f, 0.f, -2.f, -5.f, -6.f, -6.f, -4.f, 4.f,
617 14.f, 20.f, 19.f, 17.f, 30.f, 60.f, 70.f,
620 0.f, 15.f, 15.f, 15.f, 11.f, 10.f, 8.f, 7.f, 7.f, 7.f,
621 6.f, 2.f, 0.f, 0.f, -2.f, -5.f, -6.f, -6.f, -4.f, 0.f,
622 2.f, 6.f, 5.f, 5.f, 15.f, 30.f, 50.f,
625 0.f, 15.f, 15.f, 15.f, 11.f, 10.f, 8.f, 7.f, 7.f, 7.f,
626 6.f, 2.f, 0.f, 0.f, -3.f, -5.f, -6.f, -6.f, -4.5f, -4.f,
627 2.f, 6.f, 5.f, 5.f, 15.f, 20.f, 40.f,
631 /* stereo ****************/
632 static int _psy_stereo_point_dB_44[11]={3, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0};
633 static double _psy_stereo_point_kHz_44[2][11]={
634 {4., 6., 6., 6., 10., 6., 6., 4., 4., 4., 4.},
635 {6., 6., 6., 10., 10., 6., 6., 4., 4., 4., 4.}
638 /* lowpass **************/
639 static double _psy_lowpass_44[11]={
640 15.1,15.8,16.5,17.9,20.5,48.,999.,999.,999.,999.,999.
643 /* management noise offset */
645 static double _bm_max_noise_offset[11]={
646 1.,2.,3.,3.,4.,4.,4.,4.,4.,4.,4.