From ec4ee483181d01d14444e4431159282ecd92a2c5 Mon Sep 17 00:00:00 2001 From: Mohamed Tarek Date: Mon, 12 Jul 2010 15:41:10 +0000 Subject: Complete the conversion of WMA Pro to fixed point. Floating point code is still there for better history and to have a returning point in svn should something go wrong. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27402 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libwmapro/wmapro_math.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'apps/codecs/libwmapro/wmapro_math.h') diff --git a/apps/codecs/libwmapro/wmapro_math.h b/apps/codecs/libwmapro/wmapro_math.h index 83fbb40a66..b339d8616d 100644 --- a/apps/codecs/libwmapro/wmapro_math.h +++ b/apps/codecs/libwmapro/wmapro_math.h @@ -1,8 +1,13 @@ +#ifndef _WMAPRO_MATH_H_ +#define _WMAPRO_MATH_H_ + #include #include "types.h" #define fixtof16(x) (float)((float)(x) / (float)(1 << 16)) +#define fixtof31(x) (float)((float)(x) / (float)(1 << 31)) #define ftofix16(x) ((int32_t)((x) * (float)(1 << 16) + ((x) < 0 ? -0.5:0.5))) +#define ftofix31(x) ((int32_t)((x) * (float)(1 << 31) + ((x) < 0 ? -0.5:0.5))) static inline FIXED fixmulshift(FIXED x, FIXED y, int shamt) { @@ -36,11 +41,11 @@ static inline void vector_fixmul_window(FIXED *dst, const FIXED *src0, } static inline void vector_fixmul_scalar(FIXED *dst, const FIXED *src, FIXED mul, - int len) + int len, int shift) { int i; - for(i=0; i