summaryrefslogtreecommitdiff
path: root/apps/codecs/libwmapro/wmapro_math.h
diff options
context:
space:
mode:
authorMohamed Tarek <mt@rockbox.org>2010-07-17 08:00:13 +0000
committerMohamed Tarek <mt@rockbox.org>2010-07-17 08:00:13 +0000
commitb3399635671a0f3664d09bb04ec954bc65b4a986 (patch)
treec3aa5ea7c2c0e437ce57229e095c4aa46022800f /apps/codecs/libwmapro/wmapro_math.h
parent0f947104100131069fbfa9e53c8ef129c4716a30 (diff)
libwmapro : Rename all FIXED occurrances to int32_t and remove types.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27454 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwmapro/wmapro_math.h')
-rw-r--r--apps/codecs/libwmapro/wmapro_math.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/apps/codecs/libwmapro/wmapro_math.h b/apps/codecs/libwmapro/wmapro_math.h
index 4614bcbe56..823c002c09 100644
--- a/apps/codecs/libwmapro/wmapro_math.h
+++ b/apps/codecs/libwmapro/wmapro_math.h
@@ -2,14 +2,13 @@
#define _WMAPRO_MATH_H_
#include <inttypes.h>
-#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)
+static inline int32_t fixmulshift(int32_t x, int32_t y, int shamt)
{
int64_t temp;
temp = x;
@@ -21,26 +20,26 @@ static inline FIXED fixmulshift(FIXED x, FIXED y, int shamt)
}
-static inline void vector_fixmul_window(FIXED *dst, const FIXED *src0,
- const FIXED *src1, const FIXED *win,
- FIXED add_bias, int len)
+static inline void vector_fixmul_window(int32_t *dst, const int32_t *src0,
+ const int32_t *src1, const int32_t *win,
+ int32_t add_bias, int len)
{
int i, j;
dst += len;
win += len;
src0+= len;
for(i=-len, j=len-1; i<0; i++, j--) {
- FIXED s0 = src0[i];
- FIXED s1 = src1[j];
- FIXED wi = win[i];
- FIXED wj = win[j];
+ int32_t s0 = src0[i];
+ int32_t s1 = src1[j];
+ int32_t wi = win[i];
+ int32_t wj = win[j];
dst[i] = fixmulshift(s0,-1*wj,31) - fixmulshift(s1,-1*wi,31) + (add_bias<<16);
dst[j] = fixmulshift(s0,-1*wi,31) + fixmulshift(s1,-1*wj,31) + (add_bias<<16);
}
}
-static inline void vector_fixmul_scalar(FIXED *dst, const FIXED *src, FIXED mul,
+static inline void vector_fixmul_scalar(int32_t *dst, const int32_t *src, int32_t mul,
int len, int shift)
{
int i;