1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Michael Sevakis 2011-12-04 18:19:39 +00:00
parent 700e360b61
commit a43df152c2
7 changed files with 58 additions and 47 deletions

View file

@ -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,