a1b65715e4
- don't use static variables in inline functions fixes build with sunpro.
40 lines
1.5 KiB
Text
40 lines
1.5 KiB
Text
$NetBSD: patch-aa,v 1.2 2005/07/30 11:30:03 grant Exp $
|
|
|
|
these patches correct invalid C code that declares variables after statements.
|
|
|
|
--- psycho_3.c.orig 2003-03-01 20:35:14.000000000 +1100
|
|
+++ psycho_3.c
|
|
@@ -22,7 +22,7 @@
|
|
|
|
/* Keep a table to fudge the adding of dB */
|
|
#define DBTAB 1000
|
|
-static double dbtable[DBTAB];
|
|
+double dbtable[DBTAB];
|
|
|
|
#define CRITBANDMAX 32 /* this is much higher than it needs to be. really only about 24 */
|
|
int cbands=0; /* How many critical bands there really are */
|
|
@@ -133,8 +133,8 @@ void psycho_3_fft(FLOAT sample[BLKSIZE],
|
|
static FLOAT *window;
|
|
|
|
if (!init) { /* calculate window function for the Fourier transform */
|
|
- window = (FLOAT *) mem_alloc (sizeof (DFFT), "window");
|
|
register FLOAT sqrt_8_over_3 = pow (8.0 / 3.0, 0.5);
|
|
+ window = (FLOAT *) mem_alloc (sizeof (DFFT), "window");
|
|
for (i = 0; i < BLKSIZE; i++) {
|
|
window[i] = sqrt_8_over_3 * 0.5 * (1 - cos (2.0 * PI * i / (BLKSIZE))) / BLKSIZE;
|
|
}
|
|
@@ -441,12 +441,14 @@ void psycho_3_init(options *glopts) {
|
|
psycho_3_init_add_db();
|
|
|
|
/* For each spectral line calculate the bark and the ATH (in dB) */
|
|
+ {
|
|
FLOAT sfreq = (FLOAT) s_freq[header->version][header->sampling_frequency] * 1000;
|
|
for (i=1;i<HBLKSIZE; i++) {
|
|
FLOAT freq = i * sfreq/BLKSIZE;
|
|
bark[i] = freq2bark(freq);
|
|
ath[i] = ATH_dB(freq,glopts->athlevel);
|
|
}
|
|
+ }
|
|
|
|
{ /* Work out the critical bands
|
|
Starting from line 0, all lines within 1 bark of the starting
|