From 4b21ff9c5421ac563b57275b99665d721a0b5ed3 Mon Sep 17 00:00:00 2001 From: Felicia Lim Date: Mon, 7 Jun 2021 16:35:27 -0700 Subject: Relax comparison to 0 to avoid a floating point divide-by-zero error. --- celt/celt_lpc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/celt/celt_lpc.c b/celt/celt_lpc.c index 457e7ed0..5ac54b27 100644 --- a/celt/celt_lpc.c +++ b/celt/celt_lpc.c @@ -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