From 965113ed5051d3e9e4b563b8da1f5523c5470a76 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Sun, 5 Jun 2011 13:12:51 +0000 Subject: FS#12146: Fix libcook bugs introduced in r22055 by Sean Bartell. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29973 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/lib/codeclib_misc.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'apps/codecs/lib/codeclib_misc.h') diff --git a/apps/codecs/lib/codeclib_misc.h b/apps/codecs/lib/codeclib_misc.h index f3ec209e78..f3b1805e26 100644 --- a/apps/codecs/lib/codeclib_misc.h +++ b/apps/codecs/lib/codeclib_misc.h @@ -65,6 +65,7 @@ static inline int32_t MULT32(int32_t x, int32_t y) { magic.whole = (int64_t)x * y; return magic.halves.hi; } + static inline int32_t MULT31(int32_t x, int32_t y) { return MULT32(x,y)<<1; } @@ -75,6 +76,12 @@ static inline int32_t MULT31_SHIFT15(int32_t x, int32_t y) { return ((uint32_t)(magic.halves.lo)>>15) | ((magic.halves.hi)<<17); } +static inline int32_t MULT31_SHIFT16(int32_t x, int32_t y) { + union magic magic; + magic.whole = (int64_t)x * y; + return ((uint32_t)(magic.halves.lo)>>16) | ((magic.halves.hi)<<16); +} + #else /* 32 bit multiply, more portable but less accurate */ -- cgit v1.2.3