ref: 9faea25d29ab18e4d67e50f58da47a5f1753d738
parent: 37e135677afb86a7b0136d038e534553e34e243e
author: Jean-Marc Valin <[email protected]>
date: Tue May 8 09:58:57 EDT 2012
Fixes a (harmless) float overflow in the pitch search
--- a/celt/pitch.c
+++ b/celt/pitch.c
@@ -74,6 +74,11 @@
opus_val16 num;
opus_val32 xcorr16;
xcorr16 = EXTRACT16(VSHR32(xcorr[i], xshift));
+#ifndef FIXED_POINT
+ /* Considering the range of xcorr16, this should avoid both underflows
+ and overflows (inf) when squaring xcorr16 */
+ xcorr16 *= 1e-12;
+#endif
num = MULT16_16_Q15(xcorr16,xcorr16);
if (MULT16_32_Q15(num,best_den[1]) > MULT16_32_Q15(best_num[1],Syy))
{