1
0
Fork 0
forked from len0rd/rockbox

Clean up libfaad's fixed point implementation.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28069 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andree Buschmann 2010-09-13 20:57:22 +00:00
parent aa0f895572
commit ddb936a0c5
6 changed files with 75 additions and 116 deletions

View file

@ -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,