From cdca5efce9bfccf0d3f5a7dda85fad45562edf0d Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Sun, 29 Aug 2010 19:03:05 +0000 Subject: Fix FS#11539. Undo r23967 and use another way to achieve results for negative exponents for pow(2,x). This solves heavy distortions on some aac encoded files and clicks/noise on track change. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27941 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libfaad/fixed.h | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'apps/codecs/libfaad/fixed.h') diff --git a/apps/codecs/libfaad/fixed.h b/apps/codecs/libfaad/fixed.h index 6cda967..ee06dc4 100644 --- a/apps/codecs/libfaad/fixed.h +++ b/apps/codecs/libfaad/fixed.h @@ -49,7 +49,6 @@ extern "C" { typedef int32_t real_t; -#define UFIX_CONST(A,PRECISION) ((uint32_t)((A)*(PRECISION)+0.5)) #define FIX_CONST(A,PRECISION) (((A) >= 0) ? ((real_t)((A)*(PRECISION)+0.5)) : ((real_t)((A)*(PRECISION)-0.5))) #define REAL_CONST(A) FIX_CONST((A),(REAL_PRECISION)) #define COEF_CONST(A) FIX_CONST((A),(COEF_PRECISION)) @@ -129,8 +128,6 @@ static INLINE void ComplexMult(real_t *y1, real_t *y2, #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) - #define DESCALE(A,S) ((S)>0?(((A)>>((S)-1))+1)>>1:(A)<<-(S)) - #define DESCALE_SHIFT(A,SH,SC) DESCALE((A),(SC)-(SH)) #elif defined(__GNUC__) && defined (__arm__) @@ -208,18 +205,6 @@ static INLINE void ComplexMult(real_t *y1, real_t *y2, *y2 = yt2 << (FRAC_SIZE-FRAC_BITS); } -static inline real_t DESCALE_SHIFT(unsigned val, int shift, int scale) -{ - unsigned out; - if ((out = val >> (scale - shift - 1))) - { - out++; - out >>= 1; - } else - out = val << (shift - scale); - return out; -} - #else /* multiply with real shift */ @@ -240,8 +225,6 @@ static inline real_t DESCALE_SHIFT(unsigned val, int shift, int scale) #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) - #define DESCALE(A,S) ((S)>0?(((A)>>((S)-1))+1)>>1:(A)<<-(S)) - #define DESCALE_SHIFT(A,SH,SC) DESCALE((A),(SC)-(SH)) /* Complex multiplication */ static INLINE void ComplexMult(real_t *y1, real_t *y2, -- cgit v1.1