Fixes a fixed-point overflow in anti-collapse
authorJean-Marc Valin <jean-marc.valin@octasic.com>
Thu, 27 Jan 2011 14:53:09 +0000 (09:53 -0500)
committerJean-Marc Valin <jean-marc.valin@octasic.com>
Thu, 27 Jan 2011 14:53:09 +0000 (09:53 -0500)
libcelt/bands.c

index ffb8f2a..1e3fc28 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_Q14(QCONST16(1.41421356f,14), r);
+            r = MULT16_16_Q14(23170, MIN32(23169, r));
          r = SHR16(MIN16(thresh, r),1);
          r = SHR32(MULT16_16_Q15(sqrt_1, r),shift);
 #else