diff options
| author | Andrew Mahone <andrew.mahone@gmail.com> | 2009-12-13 03:45:40 +0000 |
|---|---|---|
| committer | Andrew Mahone <andrew.mahone@gmail.com> | 2009-12-13 03:45:40 +0000 |
| commit | af5bad46d883731728b9e4c797cae015e17f11f3 (patch) | |
| tree | 21a6fd00a8c1c90dcb1501b27d8253ccea162e7c /apps/codecs/libfaad/common.h | |
| parent | 7668e3fe51ed0d2bb00ba5580b45e289ae0e836b (diff) | |
| download | rockbox-af5bad46d883731728b9e4c797cae015e17f11f3.zip rockbox-af5bad46d883731728b9e4c797cae015e17f11f3.tar.gz rockbox-af5bad46d883731728b9e4c797cae015e17f11f3.tar.bz2 rockbox-af5bad46d883731728b9e4c797cae015e17f11f3.tar.xz | |
Libfaad pow2/log2 improvements:
Correct pow2_* to calculate correct output for input < 0.0 or between 0.0 and 1.0 instead of returning 0. This will change output, but the float version of this codec uses pow(2.0,x) in place of these functions, so this behavior was probably a bug
Replace 64-bit multiply in pow2_* with left or right shift by whole part of input, rounding if shifting right. An ARM-specific optimized version is provided as a C inline function, other targets use a C macro.
Increase constant size of table for pow2 to improve accuracy, also avoid early truncation in linear interpolation of result.
Move constant tables for pow2 and log2 to iram.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23967 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libfaad/common.h')
| -rw-r--r-- | apps/codecs/libfaad/common.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/codecs/libfaad/common.h b/apps/codecs/libfaad/common.h index fe0d02b..658e92f 100644 --- a/apps/codecs/libfaad/common.h +++ b/apps/codecs/libfaad/common.h @@ -404,8 +404,8 @@ uint32_t random_int(void); #define LOG2_MIN_INF REAL_CONST(-10000) int32_t log2_int(uint32_t val); int32_t log2_fix(uint32_t val); -int32_t pow2_int(real_t val); -real_t pow2_fix(real_t val); +uint32_t pow2_int(real_t val); +uint32_t pow2_fix(real_t val); #endif uint8_t get_sr_index(const uint32_t samplerate); uint8_t max_pred_sfb(const uint8_t sr_index); |