diff options
author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-06-10 19:02:27 +0000 |
---|---|---|
committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-06-10 19:02:27 +0000 |
commit | 00e01e82cb6254aa864c66460b0829b452d2bc47 (patch) | |
tree | 27bd305c58d887fdbf50122f650c754401af4aa7 | |
parent | 2c9f4fad72fe8245cb1250c8bd196ea520c17ee8 (diff) | |
download | rockbox-00e01e82cb6254aa864c66460b0829b452d2bc47.tar.gz rockbox-00e01e82cb6254aa864c66460b0829b452d2bc47.zip |
Submit FS#11365. Speed up mp3 decoding on ARM processors. It is faster to use the C-implementation of dct32 compiled with -O1 as the asm implementation of dct32 compiled with -O2. Configuration for Coldfire processors is untouched. In the new configuration the stack of the COP decoding thread needs to be increased on dualcore targets. Speed is increasing by up to 0.9 MHz (-O2 against -O1 using eabi).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26746 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/libmad/SOURCES | 1 | ||||
-rw-r--r-- | apps/codecs/libmad/libmad.make | 13 | ||||
-rw-r--r-- | apps/codecs/libmad/synth.c | 3 | ||||
-rw-r--r-- | apps/codecs/mpa.c | 2 |
4 files changed, 15 insertions, 4 deletions
diff --git a/apps/codecs/libmad/SOURCES b/apps/codecs/libmad/SOURCES index b7e1957326..a4ffcb5c64 100644 --- a/apps/codecs/libmad/SOURCES +++ b/apps/codecs/libmad/SOURCES | |||
@@ -14,6 +14,5 @@ imdct_mcf5249.S | |||
14 | #endif | 14 | #endif |
15 | #if defined(CPU_ARM) | 15 | #if defined(CPU_ARM) |
16 | imdct_l_arm.S | 16 | imdct_l_arm.S |
17 | dct32_arm.S | ||
18 | synth_full_arm.S | 17 | synth_full_arm.S |
19 | #endif | 18 | #endif |
diff --git a/apps/codecs/libmad/libmad.make b/apps/codecs/libmad/libmad.make index 331ee8916f..58d2dc84e6 100644 --- a/apps/codecs/libmad/libmad.make +++ b/apps/codecs/libmad/libmad.make | |||
@@ -11,7 +11,18 @@ | |||
11 | # (one for codec, one for mpegplayer) | 11 | # (one for codec, one for mpegplayer) |
12 | # so a little trickery is necessary | 12 | # so a little trickery is necessary |
13 | 13 | ||
14 | MADFLAGS = $(CODECFLAGS) -UDEBUG -DNDEBUG -O2 -I$(APPSDIR)/codecs/libmad -DHAVE_LIMITS_H | 14 | # Extract optimization level ('-O') from compile flags. Will be set later. |
15 | MADFLAGS = $(filter-out -O%,$(CODECFLAGS)) -I$(APPSDIR)/codecs/libmad | ||
16 | MADFLAGS += -UDEBUG -DNDEBUG -DHAVE_LIMITS_H | ||
17 | |||
18 | # libmad is faster on ARM-targets with -O1 than -O2 | ||
19 | ifeq ($(CPU),arm) | ||
20 | MADFLAGS += -O1 | ||
21 | else | ||
22 | MADFLAGS += -O2 | ||
23 | endif | ||
24 | |||
25 | # MPEGplayer | ||
15 | MPEGMADFLAGS = $(MADFLAGS) -DMPEGPLAYER | 26 | MPEGMADFLAGS = $(MADFLAGS) -DMPEGPLAYER |
16 | 27 | ||
17 | # libmad | 28 | # libmad |
diff --git a/apps/codecs/libmad/synth.c b/apps/codecs/libmad/synth.c index 7f1c2e6fc0..5ae9811ead 100644 --- a/apps/codecs/libmad/synth.c +++ b/apps/codecs/libmad/synth.c | |||
@@ -67,7 +67,8 @@ void mad_synth_mute(struct mad_synth *synth) | |||
67 | } | 67 | } |
68 | } | 68 | } |
69 | 69 | ||
70 | #ifdef FPM_ARM | 70 | #if 0 /* dct32 asm implementation is slower on current arm systems */ |
71 | /* #ifdef FPM_ARM */ | ||
71 | 72 | ||
72 | void dct32(mad_fixed_t const in[32], unsigned int slot, | 73 | void dct32(mad_fixed_t const in[32], unsigned int slot, |
73 | mad_fixed_t lo[16][8], mad_fixed_t hi[16][8]); | 74 | mad_fixed_t lo[16][8], mad_fixed_t hi[16][8]); |
diff --git a/apps/codecs/mpa.c b/apps/codecs/mpa.c index 2fa7d02bbd..6fea80807f 100644 --- a/apps/codecs/mpa.c +++ b/apps/codecs/mpa.c | |||
@@ -202,7 +202,7 @@ static void set_elapsed(struct mp3entry* id3) | |||
202 | * Run the synthesis filter on the COProcessor | 202 | * Run the synthesis filter on the COProcessor |
203 | */ | 203 | */ |
204 | 204 | ||
205 | static int mad_synth_thread_stack[DEFAULT_STACK_SIZE/sizeof(int)/2] IBSS_ATTR; | 205 | static int mad_synth_thread_stack[DEFAULT_STACK_SIZE/sizeof(int)] IBSS_ATTR; |
206 | 206 | ||
207 | static const unsigned char * const mad_synth_thread_name = "mp3dec"; | 207 | static const unsigned char * const mad_synth_thread_name = "mp3dec"; |
208 | static unsigned int mad_synth_thread_id = 0; | 208 | static unsigned int mad_synth_thread_id = 0; |