From a81bf16bc9363c742ed76e6bc9d77f86d19149ab Mon Sep 17 00:00:00 2001 From: Abramo Bagnara Date: Tue, 9 Jul 2002 20:21:00 +0000 Subject: [PATCH] Fixed normalization --- src/pcm/plugin_ops.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pcm/plugin_ops.h b/src/pcm/plugin_ops.h index 8c5c2b22..9986d063 100644 --- a/src/pcm/plugin_ops.h +++ b/src/pcm/plugin_ops.h @@ -789,14 +789,14 @@ static inline void _norms(const void *src, void *dst, int32_t s; switch (src_wid) { case 8: - s = *(int8_t*)src; + s = *(int32_t*)src; if (s >= 0x7f) goto _max; else if (s <= -0x80) goto _min; break; case 16: - s = *(int16_t*)src; + s = *(int32_t*)src; if (s >= 0x7fff) goto _max; else if (s <= -0x8000) @@ -829,7 +829,7 @@ static inline void _norms(const void *src, void *dst, s *= 1 << bits; } else if (src_wid > dst_wid) { unsigned int bits = src_wid - dst_wid; - s = (s + (1 << (bits - 1)))/ (1 << bits); + s = (s + (1 << (bits - 1))) / (1 << bits); } if (!dst_sign) s += (1U << (dst_wid - 1)); -- 2.47.1