Re: Scaling fix for float input
"Arslan, Fahad" <[email protected]> Tue, 24 Dec 2013 13:04:34 +0000
| Newsgroups | gmane.comp.audio.compression.speex.devel |
|---|---|
| Message-ID | <2B9C97B395470A40B9E9E5D469BCD9FA0155E0B2@EU-MBX-03.mgc.mentorg.com> |
So this means this should be fixed in Pulseaudio then, right? Thanks, Fahad ________________________________________ From: Jean-Marc Valin [[email protected]] Sent: Saturday, December 21, 2013 8:04 AM To: Arslan, Fahad; [email protected] Subject: Re: [Speex-dev] Scaling fix for float input On 20/12/13 08:06 AM, Arslan, Fahad wrote: > Need to adjust scale for floating input. > diff -NaurbB a/libspeex/resample.c b/libspeex/resample.c > --- a/libspeex/resample.c 2013-12-20 17:40:27.326576921 +0500 > +++ b/libspeex/resample.c 2013-12-20 17:40:16.918577087 +0500 > @@ -915,7 +915,7 @@ > if (in) { > for(j=0;j<ichunk;++j) > #ifdef FIXED_POINT > - x[j+st->filt_len-1]=WORD2INT(in[j*istride_save]); > + x[j+st->filt_len-1]=WORD2INT(32768.*in[j*istride_save]); > #else > x[j+st->filt_len-1]=in[j*istride_save]; > #endif You realize that applying this patch would break every application currently using this code? Not using a range of +/-1 in the float API was a mistake, but breaking the API would be worse. Jean-Marc