shithub: opus

Download patch

ref: da1156af1c7af797f806a4ce086f0b8d0d748431
parent: 63396f3904ac03379372f64d337c5f4038797841
author: Jean-Marc Valin <[email protected]>
date: Tue Jun 30 21:27:48 EDT 2009

fixing a floating point bug for very small signals

--- a/libcelt/vq.c
+++ b/libcelt/vq.c
@@ -154,11 +154,11 @@
       if (sum <= EPSILON)
 #endif
       {
-         X[0] = 16384;
+         X[0] = QCONST16(1.f,14);
          j=1; do
             X[j]=0;
          while (++j<N);
-         sum = 16384;
+         sum = QCONST16(1.f,14);
       }
       /* Do we have sufficient accuracy here? */
       rcp = EXTRACT16(MULT16_32_Q16(K-1, celt_rcp(sum)));