[xiph-commits] r11989 - trunk/speex/libspeex
jm at svn.xiph.org
jm at svn.xiph.org
Thu Nov 2 00:37:10 PST 2006
Author: jm
Date: 2006-11-02 00:37:08 -0800 (Thu, 02 Nov 2006)
New Revision: 11989
Modified:
trunk/speex/libspeex/fixed_generic.h
Log:
fixed undefined condition in PSHR/PSHR16/PSHR32 when shifting by zero
Modified: trunk/speex/libspeex/fixed_generic.h
===================================================================
--- trunk/speex/libspeex/fixed_generic.h 2006-11-02 06:42:49 UTC (rev 11988)
+++ trunk/speex/libspeex/fixed_generic.h 2006-11-02 08:37:08 UTC (rev 11989)
@@ -46,14 +46,14 @@
#define SHL16(a,shift) ((a) << (shift))
#define SHR32(a,shift) ((a) >> (shift))
#define SHL32(a,shift) ((a) << (shift))
-#define PSHR16(a,shift) (SHR16((a)+(1<<((shift)-1)),shift))
-#define PSHR32(a,shift) (SHR32((a)+(1<<((shift)-1)),shift))
+#define PSHR16(a,shift) (SHR16((a)+((1<<((shift))>>1)),shift))
+#define PSHR32(a,shift) (SHR32((a)+((1<<((shift))>>1)),shift))
#define SATURATE16(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
#define SATURATE32(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
#define SHR(a,shift) ((a) >> (shift))
#define SHL(a,shift) ((spx_word32_t)(a) << (shift))
-#define PSHR(a,shift) (SHR((a)+(1<<((shift)-1)),shift))
+#define PSHR(a,shift) (SHR((a)+((1<<((shift))>>1)),shift))
#define SATURATE(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
More information about the commits
mailing list