Skip to content

FLOAT_OVERFLOW issue #46

Open
Open
@martinzzrrxx

Description

@martinzzrrxx

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions