fixing a floating point bug for very small signals
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Wed, 1 Jul 2009 05:27:48 +0000 (01:27 -0400)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Wed, 1 Jul 2009 05:27:48 +0000 (01:27 -0400)
libcelt/vq.c

index e5be457..7071c22 100644 (file)
@@ -154,11 +154,11 @@ void alg_quant(celt_norm_t *X, celt_mask_t *W, int N, int K, celt_norm_t *P, ec_
       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)));