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

jm at svn.xiph.org jm at svn.xiph.org
Wed Nov 30 04:01:51 PST 2005


Author: jm
Date: 2005-11-30 04:01:49 -0800 (Wed, 30 Nov 2005)
New Revision: 10502

Modified:
   trunk/speex/libspeex/fixed_generic.h
Log:
Ouch. That bug was completely ruining the quality of the fixed-point. Fixed now.


Modified: trunk/speex/libspeex/fixed_generic.h
===================================================================
--- trunk/speex/libspeex/fixed_generic.h	2005-11-29 19:17:55 UTC (rev 10501)
+++ trunk/speex/libspeex/fixed_generic.h	2005-11-30 12:01:49 UTC (rev 10502)
@@ -35,8 +35,8 @@
 #ifndef FIXED_GENERIC_H
 #define FIXED_GENERIC_H
 
-#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)*(1<<(bits))))
+#define QCONST32(x,bits) ((spx_word32_t)(.5+(x)*(1<<(bits))))
 
 #define NEG16(x) (-(x))
 #define NEG32(x) (-(x))



More information about the commits mailing list