Open
Description
Hi,
I'm using SpeexDSP in a VoIP project to support Noise suppression. It works well on the Windows C++ application but failed with a "FLOAT_OVERFLOW" exception when I tried to use it in a Windows Delphi application.
After some debugging, I found the exception comes from the function qcurve
:
speexdsp/libspeexdsp/preprocess.c
Line 371 in 738e179
speexdsp/libspeexdsp/preprocess.c
Line 373 in 738e179
When the input argument x
is 0.000000
, it MAY crash with the FLOAT_OVERFLOW exception(Sometimes, even if the x is zero, no error is reported).
I was able to make it work as expected like this:
static inline spx_word16_t qcurve(spx_word16_t x)
{
//return 1.f/(1.f+.15f/(SNR_SCALING_1*x));
return (SNR_SCALING_1*x) / ((SNR_SCALING_1*x)+0.15f);
}
Let me know what you think, and if you need more information.
Thanks.
Metadata
Metadata
Assignees
Labels
No labels
Activity