[xiph-commits] r11234 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Fri Apr 21 21:57:04 PDT 2006


Author: jm
Date: 2006-04-21 21:57:02 -0700 (Fri, 21 Apr 2006)
New Revision: 11234

Modified:
   trunk/speex/libspeex/fixed_debug.h
Log:
fixed an old bug in QCONST (and made it 16-bit clean)


Modified: trunk/speex/libspeex/fixed_debug.h
===================================================================
--- trunk/speex/libspeex/fixed_debug.h	2006-04-22 04:36:58 UTC (rev 11233)
+++ trunk/speex/libspeex/fixed_debug.h	2006-04-22 04:57:02 UTC (rev 11234)
@@ -40,9 +40,10 @@
 extern long long spx_mips;
 #define MIPS_INC spx_mips++,
 
-#define QCONST16(x,bits) ((spx_word16_t)((x)*(1<<(bits))+(1<<((bits)-1))))
-#define QCONST32(x,bits) ((spx_word32_t)((x)*(1<<(bits))+(1<<((bits)-1))))
+#define QCONST16(x,bits) ((spx_word16_t)(.5+(x)*(((spx_word32_t)1)<<(bits))))
+#define QCONST32(x,bits) ((spx_word32_t)(.5+(x)*(((spx_word32_t)1)<<(bits))))
 
+
 #define VERIFY_SHORT(x) ((x)<=32767&&(x)>=-32768)
 #define VERIFY_INT(x) ((x)<=2147483647LL&&(x)>=-2147483648LL)
 



More information about the commits mailing list