summaryrefslogtreecommitdiff
path: root/apps/codecs/lib/codeclib_misc.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/lib/codeclib_misc.h')
-rw-r--r--apps/codecs/lib/codeclib_misc.h7
1 files changed, 7 insertions, 0 deletions
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) {
65 magic.whole = (int64_t)x * y; 65 magic.whole = (int64_t)x * y;
66 return magic.halves.hi; 66 return magic.halves.hi;
67} 67}
68
68static inline int32_t MULT31(int32_t x, int32_t y) { 69static inline int32_t MULT31(int32_t x, int32_t y) {
69 return MULT32(x,y)<<1; 70 return MULT32(x,y)<<1;
70} 71}
@@ -75,6 +76,12 @@ static inline int32_t MULT31_SHIFT15(int32_t x, int32_t y) {
75 return ((uint32_t)(magic.halves.lo)>>15) | ((magic.halves.hi)<<17); 76 return ((uint32_t)(magic.halves.lo)>>15) | ((magic.halves.hi)<<17);
76} 77}
77 78
79static inline int32_t MULT31_SHIFT16(int32_t x, int32_t y) {
80 union magic magic;
81 magic.whole = (int64_t)x * y;
82 return ((uint32_t)(magic.halves.lo)>>16) | ((magic.halves.hi)<<16);
83}
84
78#else 85#else
79/* 32 bit multiply, more portable but less accurate */ 86/* 32 bit multiply, more portable but less accurate */
80 87