Skip to content
Snippets Groups Projects
Unverified Commit 4b21ff9c authored by Felicia Lim's avatar Felicia Lim
Browse files

Relax comparison to 0 to avoid a floating point divide-by-zero error.

parent dfd6c88a
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,11 @@ int p
#endif
OPUS_CLEAR(lpc, p);
if (ac[0] != 0)
#ifdef FIXED_POINT
if (ac[0] > QCONST32(0.001f, 31))
#else
if (ac[0] > 1e-10f)
#endif
{
for (i = 0; i < p; i++) {
/* Sum up this iteration's reflection coefficient */
......@@ -73,10 +77,10 @@ int p
error = error - MULT32_32_Q31(MULT32_32_Q31(r,r),error);
/* Bail out once we get 30 dB gain */
#ifdef FIXED_POINT
if (error<SHR32(ac[0],10))
if (error<=SHR32(ac[0],10))
break;
#else
if (error<.001f*ac[0])
if (error<=.001f*ac[0])
break;
#endif
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment