pkgsrc/audio/toolame/patches/patch-aa
2011-09-04 21:20:06 +00:00

31 lines
1.2 KiB
Text

$NetBSD: patch-aa,v 1.3 2011/09/04 21:20:06 dholland 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
@@ -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