Oops, fixed the sqrt(2) constant for anti_collapse()
authorJean-Marc Valin <jean-marc.valin@octasic.com>
Tue, 25 Jan 2011 20:58:58 +0000 (15:58 -0500)
committerJean-Marc Valin <jean-marc.valin@octasic.com>
Tue, 25 Jan 2011 21:01:27 +0000 (16:01 -0500)
libcelt/bands.c

index 31aee84..d9b259c 100644 (file)
@@ -258,7 +258,7 @@ void anti_collapse(const CELTMode *m, celt_norm *_X, unsigned char *collapse_mas
          else
             r = 0;
          if (LM==3)
-            r = MULT16_16_Q15(QCONST16(.70710678f,15), r);
+            r = MULT16_16_Q14(QCONST16(1.41421356f,14), r);
          r = SHR16(MIN16(thresh, r),1);
          r = SHR32(MULT16_16_Q15(sqrt_1, r),shift);
 #else
@@ -266,7 +266,7 @@ void anti_collapse(const CELTMode *m, celt_norm *_X, unsigned char *collapse_mas
             short blocks don't have the same energy as long */
          r = 2.f*celt_exp2(-Ediff);
          if (LM==3)
-            r *= .70710678f;
+            r *= 1.41421356f;
          r = MIN16(thresh, r);
          r = r*sqrt_1;
 #endif