diff options
| author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-08-29 19:03:05 +0000 |
|---|---|---|
| committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-08-29 19:03:05 +0000 |
| commit | cdca5efce9bfccf0d3f5a7dda85fad45562edf0d (patch) | |
| tree | de19701df400497b6dde42ad38de88ffe3d22da1 /apps/codecs/libfaad/fixed.h | |
| parent | 5be1c3352116978fb69fe02c33599cb78686796f (diff) | |
| download | rockbox-cdca5efce9bfccf0d3f5a7dda85fad45562edf0d.zip rockbox-cdca5efce9bfccf0d3f5a7dda85fad45562edf0d.tar.gz rockbox-cdca5efce9bfccf0d3f5a7dda85fad45562edf0d.tar.bz2 rockbox-cdca5efce9bfccf0d3f5a7dda85fad45562edf0d.tar.xz | |
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
Diffstat (limited to 'apps/codecs/libfaad/fixed.h')
| -rw-r--r-- | apps/codecs/libfaad/fixed.h | 17 |
1 files changed, 0 insertions, 17 deletions
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, |