summaryrefslogtreecommitdiffstats
path: root/firmware/pcm_mixer.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-12-04 18:19:39 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-12-04 18:19:39 +0000
commita43df152c2adf737208bbeb294a0a13608d3cc43 (patch)
treec0534198745141699a08d9471303744948e51138 /firmware/pcm_mixer.c
parent700e360b612766eb2729597be55c43b5b69bbe7f (diff)
downloadrockbox-a43df152c2adf737208bbeb294a0a13608d3cc43.tar.gz
rockbox-a43df152c2adf737208bbeb294a0a13608d3cc43.tar.bz2
rockbox-a43df152c2adf737208bbeb294a0a13608d3cc43.zip
Collect the 16-bit signed range sample clipping routines scattered about, which can be optimized on armv6 and create firmware/export/dsp-util.h (for lack of better place right now).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31142 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/pcm_mixer.c')
-rw-r--r--firmware/pcm_mixer.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/firmware/pcm_mixer.c b/firmware/pcm_mixer.c
index c84762938e..817b9a6a3c 100644
--- a/firmware/pcm_mixer.c
+++ b/firmware/pcm_mixer.c
@@ -95,13 +95,7 @@ static unsigned int idle_counter = 0;
/** Generic mixing routines **/
#ifndef MIXER_OPTIMIZED_MIX_SAMPLES
-/* Clip sample to signed 16 bit range */
-static FORCE_INLINE int32_t clip_sample_16(int32_t sample)
-{
- if ((int16_t)sample != sample)
- sample = 0x7fff ^ (sample >> 31);
- return sample;
-}
+#include "dsp-util.h" /* for clip_sample_16 */
/* Mix channels' samples and apply gain factors */
static FORCE_INLINE void mix_samples(uint32_t *out,