Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLOAT_OVERFLOW issue #46

Open
martinzzrrxx opened this issue Jun 19, 2023 · 0 comments
Open

FLOAT_OVERFLOW issue #46

martinzzrrxx opened this issue Jun 19, 2023 · 0 comments

Comments

@martinzzrrxx
Copy link

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.

Snipaste_2023-06-19_15-53-54

After some debugging, I found the exception comes from the function qcurve:

static inline spx_word16_t qcurve(spx_word16_t x)

return 1.f/(1.f+.15f/(SNR_SCALING_1*x));

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant