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
Pipeline #2515 passed with stages
in 4 minutes and 50 seconds
...@@ -50,7 +50,11 @@ int p ...@@ -50,7 +50,11 @@ int p
#endif #endif
OPUS_CLEAR(lpc, p); 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++) { for (i = 0; i < p; i++) {
/* Sum up this iteration's reflection coefficient */ /* Sum up this iteration's reflection coefficient */
...@@ -73,10 +77,10 @@ int p ...@@ -73,10 +77,10 @@ int p
error = error - MULT32_32_Q31(MULT32_32_Q31(r,r),error); error = error - MULT32_32_Q31(MULT32_32_Q31(r,r),error);
/* Bail out once we get 30 dB gain */ /* Bail out once we get 30 dB gain */
#ifdef FIXED_POINT #ifdef FIXED_POINT
if (error<SHR32(ac[0],10)) if (error<=SHR32(ac[0],10))
break; break;
#else #else
if (error<.001f*ac[0]) if (error<=.001f*ac[0])
break; break;
#endif #endif
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment