Bug#617599: audacity: patch for 64 bits systems
jmg
jeanmichel.123 at free.fr
Thu Mar 10 22:25:21 UTC 2011
Package: audacity
Followup-For: Bug #617599
Here is a patch that probably only work on amd 64 bits machines and compatibles as
it assumes sizeof long equals sizeof double.
--- ./lib-src/libnyquist/nyquist/nyqsrc/fft.c.original 2011-03-10 21:44:23.000000000 +0100
+++ ./lib-src/libnyquist/nyquist/nyqsrc/fft.c 2011-03-10 21:58:01.000000000 +0100
@@ -31,7 +31,7 @@
* extra[2] -> INDEX (current sample index in current block)
* extra[3] -> FILLCNT (how many samples in buffer)
* extra[4] -> TERMCNT (how many samples until termination)
- * extra[5 .. 5+len-1] -> samples (stored as floats)
+ * extra[5 .. 5+len-1] -> samples (stored as doubles)
* extra[5+len .. 5+2*len-1] -> array of samples to fft
* extra[5+2*len ... 5+3*len-1] -> window coefficients
*
@@ -56,7 +56,7 @@
#define SAMPLES list->block->samples
/* DEBUGGING PRINT FUNCTION:
- void printfloats(char *caption, float *data, int len)
+ void printdoubles(char *caption, double *data, int len)
{
int i;
printf("%s: ", caption);
@@ -67,7 +67,7 @@
}
*/
-void n_samples_from_sound(sound_type s, long n, float *table)
+void n_samples_from_sound(sound_type s, long n, double *table)
{
long blocklen;
sample_type scale_factor = s->scale;
@@ -78,7 +78,7 @@ void n_samples_from_sound(sound_type s,
long i;
sample_block_values_type sbufp = sampblock->samples;
for (i = 0; i < togo; i++) {
- *table++ = (float) (*sbufp++ * scale_factor);
+ *table++ = (double) (*sbufp++ * scale_factor);
}
n -= togo;
}
@@ -89,9 +89,9 @@ void n_samples_from_sound(sound_type s,
LVAL snd_fft(sound_type s, long len, long step, LVAL winval)
{
long i, m, maxlen, skip, fillptr;
- float *samples;
+ double *samples;
float *temp_fft;
- float *window;
+ double *window;
LVAL result;
if (len < 1) xlfail("len < 1");
@@ -108,10 +108,10 @@ LVAL snd_fft(sound_type s, long len, lon
/* note: any storage required by fft must be allocated here in a
* contiguous block of memory who's size is given by the first long
* in the block. Here, there are 4 more longs after the size, and
- * then room for 3*len floats (assumes that floats and longs take
+ * then room for 3*len doubles (assumes that doubles and longs take
* equal space).
*
- * The reason for 3*len floats is to provide space for:
+ * The reason for 3*len doubles is to provide space for:
* the samples to be transformed (len)
* the complex FFT result (len)
* the window coefficients (len)
@@ -127,7 +127,7 @@ LVAL snd_fft(sound_type s, long len, lon
s->CNT = s->INDEX = s->FILLCNT = 0;
s->TERMCNT = -1;
maxlen = len;
- window = (float *) &(s->extra[OFFSET + 2 * len]);
+ window = (double *) &(s->extra[OFFSET + 2 * len]);
/* fill the window from w */
if (!w) {
for (i = 0; i < len; i++) *window++ = 1.0F;
@@ -138,9 +138,9 @@ LVAL snd_fft(sound_type s, long len, lon
maxlen = ((s->extra[0] / sizeof(long)) - OFFSET) / 3;
if (maxlen != len) xlfail("len changed from initial value");
}
- samples = (float *) &(s->extra[OFFSET]);
+ samples = (double *) &(s->extra[OFFSET]);
temp_fft = samples + len;
- window = temp_fft + len;
+ window = samples + 2* len;
/* step 1: refill buffer with samples */
fillptr = s->FILLCNT;
while (fillptr < maxlen) {
@@ -170,7 +170,7 @@ LVAL snd_fft(sound_type s, long len, lon
xlsave1(result);
result = newvector(len);
- /* first len floats will be real part, second len floats imaginary
+ /* first len doubles will be real part, second len doubles imaginary
* copy buffer to temp_fft with windowing
*/
for (i = 0; i < len; i++) {
-- System Information:
Debian Release: 6.0
APT prefers oldstable
APT policy: (500, 'oldstable'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages audacity depends on:
ii audacity-data 1.3.12-6 A fast, cross-platform audio edito
ii libasound2 1.0.23-2.1 shared library for ALSA applicatio
ii libc6 2.11.2-10 Embedded GNU C Library: Shared lib
ii libexpat1 2.0.1-7 XML parsing C library - runtime li
ii libflac++6 1.2.1-2+b1 Free Lossless Audio Codec - C++ ru
ii libflac8 1.2.1-2+b1 Free Lossless Audio Codec - runtim
ii libgcc1 1:4.4.5-8 GCC support library
ii libglib2.0-0 2.24.2-1 The GLib library of C routines
ii libgtk2.0-0 2.20.1-2 The GTK+ graphical user interface
ii libid3tag0 0.15.1b-10 ID3 tag reading library from the M
ii libjack0 [libjack-0.11 1:0.118+svn3796-7 JACK Audio Connection Kit (librari
ii libmad0 0.15.1b-5 MPEG audio decoder library
ii libogg0 1.2.0~dfsg-1 Ogg bitstream library
ii libsamplerate0 0.1.7-3 Audio sample rate conversion libra
ii libsndfile1 1.0.21-3 Library for reading/writing audio
ii libsoundtouch1c2 1.3.1-2 sound stretching library
ii libstdc++6 4.4.5-8 The GNU Standard C++ Library v3
ii libtwolame0 0.3.12-1 MPEG Audio Layer 2 encoding librar
ii libvamp-hostsdk3 2.1-1 helper library for Vamp hosts writ
ii libvorbis0a 1.3.1-1 The Vorbis General Audio Compressi
ii libvorbisenc2 1.3.1-1 The Vorbis General Audio Compressi
ii libvorbisfile3 1.3.1-1 The Vorbis General Audio Compressi
ii libwxbase2.8-0 2.8.10.1-3+b1 wxBase library (runtime) - non-GUI
ii libwxgtk2.8-0 2.8.10.1-3+b1 wxWidgets Cross-platform C++ GUI t
Versions of packages audacity recommends:
ii libavcodec52 4:0.5.2-6 ffmpeg codec library
ii libavformat52 4:0.5.2-6 ffmpeg file format library
Versions of packages audacity suggests:
pn ladspa-plugin <none> (no description available)
pn libmp3lame0 <none> (no description available)
-- no debconf information
More information about the pkg-multimedia-maintainers
mailing list