From b9c8c6c868ebf335c359cf7fa339d2cfdcdea88c Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Sat, 30 Jun 2007 12:54:07 +0000 Subject: Update the ARM version of the rate conversion code, in line with Fingolfins optimisatins of the C version last night. Saves about 5 cycles per sample. svn-id: r27789 --- sound/rate_arm.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'sound/rate_arm.cpp') diff --git a/sound/rate_arm.cpp b/sound/rate_arm.cpp index 694e213dce..ad8f0519c6 100644 --- a/sound/rate_arm.cpp +++ b/sound/rate_arm.cpp @@ -50,13 +50,18 @@ #include "sound/mixer.h" #include "common/util.h" +//#define DEBUG_RATECONV + namespace Audio { /** * The precision of the fractional computations used by the rate converter. * Normally you should never have to modify this value. + * This stuff is defined in common/frac.h, but we redefine it here as the + * ARM routine we call doesn't respect those definitions. */ #define FRAC_BITS 16 +#define FRAC_ONE (1<::LinearRateConverter(st_rate_t inrate error("rate effect can only handle rates < 65536"); } - lr.opos_frac = 0; - lr.opos = 1; + lr.opos = FRAC_ONE; /* increment */ incr = (inrate << FRAC_BITS) / outrate; - lr.opos_inc_frac = incr & ((1UL << FRAC_BITS) - 1); - lr.opos_inc = incr >> FRAC_BITS; + lr.opos_inc = incr; - lr.ilast[0] = lr.ilast[1] = 0; + lr.ilast[0] = lr.ilast[1] = 32768; lr.icur[0] = lr.icur[1] = 0; lr.inLen = 0; -- cgit v1.2.3