summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2005-06-12 12:43:05 +0000
committerThom Johansen <thomj@rockbox.org>2005-06-12 12:43:05 +0000
commit649acec2fcebb16102d730af515f0ff94679fc1c (patch)
tree682a52ce284ad06d2c903ba2b4f69c58ec078cea /apps
parent3c30ee51d89ac49ad0790889d554c760367e6ec9 (diff)
downloadrockbox-649acec2fcebb16102d730af515f0ff94679fc1c.tar.gz
rockbox-649acec2fcebb16102d730af515f0ff94679fc1c.zip
Small Musepack optimisation.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6685 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/libmusepack/Makefile3
-rw-r--r--apps/codecs/libmusepack/math.h16
2 files changed, 18 insertions, 1 deletions
diff --git a/apps/codecs/libmusepack/Makefile b/apps/codecs/libmusepack/Makefile
index 1d7dffc3dd..1e3eaf6232 100644
--- a/apps/codecs/libmusepack/Makefile
+++ b/apps/codecs/libmusepack/Makefile
@@ -14,7 +14,8 @@ ifdef APPEXTRA
14INCLUDES += -I$(APPSDIR)/$(APPEXTRA) 14INCLUDES += -I$(APPSDIR)/$(APPEXTRA)
15endif 15endif
16 16
17CFLAGS = $(GCCOPTS) \ 17MUSEPACKOPTS = -O2
18CFLAGS = $(GCCOPTS) $(MUSEPACKOPTS)\
18$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} 19$(INCLUDES) $(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
19 20
20# This sets up 'SRC' based on the files mentioned in SOURCES 21# This sets up 'SRC' based on the files mentioned in SOURCES
diff --git a/apps/codecs/libmusepack/math.h b/apps/codecs/libmusepack/math.h
index 3965eec353..8d1e50dda5 100644
--- a/apps/codecs/libmusepack/math.h
+++ b/apps/codecs/libmusepack/math.h
@@ -99,8 +99,24 @@ static inline MPC_SAMPLE_FORMAT MPC_MULTIPLY_EX(MPC_SAMPLE_FORMAT item1,MPC_SAMP
99#ifdef MPC_HAVE_MULHIGH 99#ifdef MPC_HAVE_MULHIGH
100#define MPC_MULTIPLY_FRACT(X,Y) _MulHigh(X,Y) 100#define MPC_MULTIPLY_FRACT(X,Y) _MulHigh(X,Y)
101#else 101#else
102#if CONFIG_CPU==MCF5249 && !defined(SIMULATOR)
103/* loses one bit of accuracy.
104 the rest of the macros won't be as easy as this... */
105#define MPC_MULTIPLY_FRACT(X,Y) \
106 ({ \
107 MPC_SAMPLE_FORMAT t; \
108 asm volatile ( \
109 "mac.l %[A], %[B], %%acc0\n\t" \
110 "movclr.l %%acc0, %[t]\n\t" \
111 "asr.l #1, %[t]\n\t" \
112 : [t] "=d" (t) \
113 : [A] "r" ((X)), [B] "r" ((Y))); \
114 t; \
115 })
116#else
102#define MPC_MULTIPLY_FRACT(X,Y) MPC_MULTIPLY_EX(X,Y,32) 117#define MPC_MULTIPLY_FRACT(X,Y) MPC_MULTIPLY_EX(X,Y,32)
103#endif 118#endif
119#endif
104 120
105#define MPC_MAKE_FRACT_CONST(X) (MPC_SAMPLE_FORMAT)((X) * (double)(((mpc_int64_t)1)<<32) ) 121#define MPC_MAKE_FRACT_CONST(X) (MPC_SAMPLE_FORMAT)((X) * (double)(((mpc_int64_t)1)<<32) )
106#define MPC_MULTIPLY_FRACT_CONST(X,Y) MPC_MULTIPLY_FRACT(X,MPC_MAKE_FRACT_CONST(Y)) 122#define MPC_MULTIPLY_FRACT_CONST(X,Y) MPC_MULTIPLY_FRACT(X,MPC_MAKE_FRACT_CONST(Y))