From 430b61c72094882bc48693dfc10c256a6ae36ee9 Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Tue, 8 Apr 2014 18:10:02 -0700 Subject: Add capability for floating point Kaiser window filters Change-Id: Idbb33248bbab2300c2650a4657d8fbc482a5d46c Signed-off-by: Andy Hung --- services/audioflinger/AudioResamplerFirGen.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'services/audioflinger/AudioResamplerFirGen.h') diff --git a/services/audioflinger/AudioResamplerFirGen.h b/services/audioflinger/AudioResamplerFirGen.h index fac3001..8833758 100644 --- a/services/audioflinger/AudioResamplerFirGen.h +++ b/services/audioflinger/AudioResamplerFirGen.h @@ -669,11 +669,12 @@ static inline void firKaiserGen(T* coef, int L, int halfNumCoef, sg.advance(); } - // (caution!) float version does not need rounding if (is_same::value) { // int16_t needs noise shaping *coef++ = static_cast(toint(y, 1ULL<<(sizeof(T)*8-1), err)); - } else { + } else if (is_same::value) { *coef++ = static_cast(toint(y, 1ULL<<(sizeof(T)*8-1))); + } else { // assumed float or double + *coef++ = static_cast(y); } } } -- cgit v1.1