summaryrefslogtreecommitdiff
path: root/apps/pcmbuf.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 /apps/pcmbuf.c
parent700e360b612766eb2729597be55c43b5b69bbe7f (diff)
downloadrockbox-a43df152c2adf737208bbeb294a0a13608d3cc43.tar.gz
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 'apps/pcmbuf.c')
-rw-r--r--apps/pcmbuf.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index 8135a30a36..32e1157132 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -27,6 +27,7 @@
27#include "pcm.h" 27#include "pcm.h"
28#include "pcm_mixer.h" 28#include "pcm_mixer.h"
29#include "pcmbuf.h" 29#include "pcmbuf.h"
30#include "dsp-util.h"
30#include "playback.h" 31#include "playback.h"
31#include "codec_thread.h" 32#include "codec_thread.h"
32 33
@@ -828,14 +829,6 @@ static size_t crossfade_find_buftail(size_t buffer_rem, size_t buffer_need)
828 return buffer_rem; 829 return buffer_rem;
829} 830}
830 831
831/* Clip sample to signed 16 bit range */
832static FORCE_INLINE int32_t clip_sample_16(int32_t sample)
833{
834 if ((int16_t)sample != sample)
835 sample = 0x7fff ^ (sample >> 31);
836 return sample;
837}
838
839/* Returns the number of bytes _NOT_ mixed/faded */ 832/* Returns the number of bytes _NOT_ mixed/faded */
840static int crossfade_mix_fade(int factor, size_t size, void *buf, size_t *out_index, 833static int crossfade_mix_fade(int factor, size_t size, void *buf, size_t *out_index,
841 unsigned long elapsed, off_t offset) 834 unsigned long elapsed, off_t offset)