summaryrefslogtreecommitdiff
path: root/apps/codecs/libatrac/atrac3.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libatrac/atrac3.c')
-rw-r--r--apps/codecs/libatrac/atrac3.c14
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
806static void reverseMatrixing(int32_t *su1, int32_t *su2, int *pPrevCode, int *pCurrCode) 806static 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++) {