diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-03-12 20:07:28 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-03-12 20:07:28 +0000 |
commit | 76e8701626099e751c5524086cd1830ba0093106 (patch) | |
tree | 29fe208ee00cbae896e3d511a4717ddf04312b1d /apps | |
parent | 2ac401f4861e16c8c26517348f4b96b6dfeed41a (diff) | |
download | rockbox-76e8701626099e751c5524086cd1830ba0093106.tar.gz rockbox-76e8701626099e751c5524086cd1830ba0093106.zip |
Fix playback of atrac3 joint stereo encoded files. Define the interpolation macro in the right way.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25135 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/codecs/libatrac/atrac3.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/codecs/libatrac/atrac3.c b/apps/codecs/libatrac/atrac3.c index ecb5a1480d..5c0bc824ff 100644 --- a/apps/codecs/libatrac/atrac3.c +++ b/apps/codecs/libatrac/atrac3.c | |||
@@ -797,11 +797,11 @@ static int addTonalComponents (int32_t *pSpectrum, int numComponents, tonal_comp | |||
797 | * @param y second input point | 797 | * @param y second input point |
798 | * @param s index of interpolation point (0..7) | 798 | * @param s index of interpolation point (0..7) |
799 | */ | 799 | */ |
800 | 800 | ||
801 | /* | 801 | /* rockbox: Not used anymore. Faster version defined below. |
802 | #define INTERPOLATE(x, y, s) ((x*ONE_16) + fixmul16(((s*ONE_16)>>3), (((x) - (y))*ONE_16))) | 802 | #define INTERPOLATE_FP16(x, y, s) ((x) + fixmul16(((s*ONE_16)>>3), (((y) - (x))))) |
803 | */ | 803 | */ |
804 | #define INTERPOLATE(x, y, s) ((((x)<<3) + s*((y)-(x)))<<13) | 804 | #define INTERPOLATE_FP16(x, y, s) ((x) + ((s*((y)-(x)))>>3)) |
805 | 805 | ||
806 | static void reverseMatrixing(int32_t *su1, int32_t *su2, int *pPrevCode, int *pCurrCode) | 806 | static void reverseMatrixing(int32_t *su1, int32_t *su2, int *pPrevCode, int *pCurrCode) |
807 | { | 807 | { |
@@ -825,7 +825,7 @@ static void reverseMatrixing(int32_t *su1, int32_t *su2, int *pPrevCode, int *pC | |||
825 | for(; nsample < 8; nsample++) { | 825 | for(; nsample < 8; nsample++) { |
826 | c1 = su1[band+nsample]; | 826 | c1 = su1[band+nsample]; |
827 | c2 = su2[band+nsample]; | 827 | c2 = su2[band+nsample]; |
828 | c2 = fixmul16(c1, INTERPOLATE(mc1_l, mc2_l, nsample)) + fixmul16(c2, INTERPOLATE(mc1_r, mc2_r, nsample)); | 828 | c2 = fixmul16(c1, INTERPOLATE_FP16(mc1_l, mc2_l, nsample)) + fixmul16(c2, INTERPOLATE_FP16(mc1_r, mc2_r, nsample)); |
829 | su1[band+nsample] = c2; | 829 | su1[band+nsample] = c2; |
830 | su2[band+nsample] = (c1 << 1) - c2; | 830 | su2[band+nsample] = (c1 << 1) - c2; |
831 | } | 831 | } |
@@ -891,8 +891,8 @@ static void channelWeighting (int32_t *su1, int32_t *su2, int *p3) | |||
891 | for(band = 1; band < 4; band++) { | 891 | for(band = 1; band < 4; band++) { |
892 | /* scale the channels by the weights */ | 892 | /* scale the channels by the weights */ |
893 | for(nsample = 0; nsample < 8; nsample++) { | 893 | for(nsample = 0; nsample < 8; nsample++) { |
894 | su1[band*256+nsample] = fixmul16(su1[band*256+nsample], INTERPOLATE(w[0][0], w[0][1], nsample)); | 894 | su1[band*256+nsample] = fixmul16(su1[band*256+nsample], INTERPOLATE_FP16(w[0][0], w[0][1], nsample)); |
895 | su2[band*256+nsample] = fixmul16(su2[band*256+nsample], INTERPOLATE(w[1][0], w[1][1], nsample)); | 895 | su2[band*256+nsample] = fixmul16(su2[band*256+nsample], INTERPOLATE_FP16(w[1][0], w[1][1], nsample)); |
896 | } | 896 | } |
897 | 897 | ||
898 | for(; nsample < 256; nsample++) { | 898 | for(; nsample < 256; nsample++) { |