From a43df152c2adf737208bbeb294a0a13608d3cc43 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sun, 4 Dec 2011 18:19:39 +0000 Subject: 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 --- apps/codecs/libspc/spc_dsp.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'apps/codecs/libspc') diff --git a/apps/codecs/libspc/spc_dsp.c b/apps/codecs/libspc/spc_dsp.c index 28e05425fb..6350c4c331 100644 --- a/apps/codecs/libspc/spc_dsp.c +++ b/apps/codecs/libspc/spc_dsp.c @@ -57,25 +57,7 @@ void DSP_write( struct Spc_Dsp* this, int i, int data ) } } -#if ARM_ARCH >= 6 -/* if ( n < -32768 ) out = -32768; */ -/* if ( n > 32767 ) out = 32767; */ -#define CLAMP16( n ) \ - ({ \ - asm ("ssat %0, #16, %1" \ - : "=r" ( n ) : "r"( n ) ); \ - n; \ - }) -#else -/* if ( n < -32768 ) out = -32768; */ -/* if ( n > 32767 ) out = 32767; */ -#define CLAMP16( n ) \ -({ \ - if ( (int16_t) n != n ) \ - n = 0x7FFF ^ (n >> 31); \ - n; \ -}) -#endif +#define CLAMP16( n ) clip_sample_16( n ) #if SPC_BRRCACHE static void decode_brr( struct Spc_Dsp* this, unsigned start_addr, -- cgit v1.2.3