diff options
| author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-09-13 20:57:22 +0000 |
|---|---|---|
| committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-09-13 20:57:22 +0000 |
| commit | ddb936a0c5a2a795703d2e4831c0d30124dcef3e (patch) | |
| tree | fd47c3629babe6892072428c9fe53ada2c82727b /apps/codecs/libfaad/fixed.h | |
| parent | aa0f895572237c57e05d23c18bd2be0739e0f2ba (diff) | |
| download | rockbox-ddb936a0c5a2a795703d2e4831c0d30124dcef3e.zip rockbox-ddb936a0c5a2a795703d2e4831c0d30124dcef3e.tar.gz rockbox-ddb936a0c5a2a795703d2e4831c0d30124dcef3e.tar.bz2 rockbox-ddb936a0c5a2a795703d2e4831c0d30124dcef3e.tar.xz | |
Clean up libfaad's fixed point implementation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28069 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libfaad/fixed.h')
| -rw-r--r-- | apps/codecs/libfaad/fixed.h | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/apps/codecs/libfaad/fixed.h b/apps/codecs/libfaad/fixed.h index ee06dc4..ca0402e 100644 --- a/apps/codecs/libfaad/fixed.h +++ b/apps/codecs/libfaad/fixed.h @@ -57,7 +57,7 @@ typedef int32_t real_t; #define Q2_BITS 22 #define Q2_PRECISION (1 << Q2_BITS) -#define Q2_CONST(A) (((A) >= 0) ? ((real_t)((A)*(Q2_PRECISION)+0.5)) : ((real_t)((A)*(Q2_PRECISION)-0.5))) +#define Q2_CONST(A) FIX_CONST((A),(Q2_PRECISION)) #if defined(CPU_COLDFIRE) @@ -126,8 +126,6 @@ static INLINE void ComplexMult(real_t *y1, real_t *y2, /* the following see little or no use, so just ignore them for now */ #define MUL_Q2(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (Q2_BITS-1))) >> Q2_BITS) - #define MUL_SHIFT6(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (6-1))) >> 6) - #define MUL_SHIFT23(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (23-1))) >> 23) #elif defined(__GNUC__) && defined (__arm__) @@ -162,16 +160,6 @@ static INLINE real_t MUL_Q2(real_t A, real_t B) return arm_mul(A, B, Q2_BITS); } -static INLINE real_t MUL_SHIFT6(real_t A, real_t B) -{ - return arm_mul(A, B, 6); -} - -static INLINE real_t MUL_SHIFT23(real_t A, real_t B) -{ - return arm_mul(A, B, 23); -} - static INLINE real_t _MulHigh(real_t x, real_t y) { uint32_t __lo; @@ -223,8 +211,6 @@ static INLINE void ComplexMult(real_t *y1, real_t *y2, #define MUL_F(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (FRAC_BITS-1))) >> FRAC_BITS) #endif #define MUL_Q2(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (Q2_BITS-1))) >> Q2_BITS) - #define MUL_SHIFT6(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (6-1))) >> 6) - #define MUL_SHIFT23(A,B) (real_t)(((int64_t)(A)*(int64_t)(B)+(1 << (23-1))) >> 23) /* Complex multiplication */ static INLINE void ComplexMult(real_t *y1, real_t *y2, |