summaryrefslogtreecommitdiff
path: root/apps/dsp.c
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2008-03-19 13:55:53 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2008-03-19 13:55:53 +0000
commitfd052ec753cade16675e211ced0a2be19c0d545f (patch)
tree094375afe1644abe2a312bb7feee885dcbdb64c0 /apps/dsp.c
parent178df1cfcfa529c58ad37922d6d934e1e0328fc5 (diff)
downloadrockbox-fd052ec753cade16675e211ced0a2be19c0d545f.zip
rockbox-fd052ec753cade16675e211ced0a2be19c0d545f.tar.gz
rockbox-fd052ec753cade16675e211ced0a2be19c0d545f.tar.bz2
rockbox-fd052ec753cade16675e211ced0a2be19c0d545f.tar.xz
Commit FS#8750. Add ARM assembler for the dsp-functions channels_process_sound_chan_mono(), channels_process_sound_chan_karaoke(), sample_output_mono() and sample_output_stereo(). By measurement the speed up is ~75% for the first three functions and ~40% for sample_output_stereo(). Additionally avoid calling yield() to often in dsp.c -- it is now limited to once per tick.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16717 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/dsp.c')
-rw-r--r--apps/dsp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/dsp.c b/apps/dsp.c
index 3c2d7f6..5bbbe08 100644
--- a/apps/dsp.c
+++ b/apps/dsp.c
@@ -1112,6 +1112,7 @@ int dsp_callback(int msg, intptr_t param)
int dsp_process(struct dsp_config *dsp, char *dst, const char *src[], int count)
{
int32_t *tmp[2];
+ long last_yield = current_tick;
int written = 0;
int samples;
@@ -1159,7 +1160,13 @@ int dsp_process(struct dsp_config *dsp, char *dst, const char *src[], int count)
written += samples;
dst += samples * sizeof (int16_t) * 2;
- yield();
+
+ /* yield at least once each tick */
+ if (current_tick > last_yield)
+ {
+ yield();
+ last_yield = current_tick;
+ }
}
#if defined(CPU_COLDFIRE)