ref: 4b21ff9c5421ac563b57275b99665d721a0b5ed3
parent: dfd6c88aaa54a03a61434c413e30c217eb98f1d5
author: Felicia Lim <[email protected]>
date: Mon Jun 7 12:35:27 EDT 2021
Relax comparison to 0 to avoid a floating point divide-by-zero error.
--- a/celt/celt_lpc.c
+++ b/celt/celt_lpc.c
@@ -50,7 +50,11 @@
#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 @@
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
}