summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-04-08 18:10:02 -0700
committerAndy Hung <hunga@google.com>2014-04-08 18:10:02 -0700
commit430b61c72094882bc48693dfc10c256a6ae36ee9 (patch)
treec707e9098f59017e639c5cb1923572ea17b5cd85 /services/audioflinger
parent781366833a12877b8d5ad4aa081114e30f799319 (diff)
downloadframeworks_av-430b61c72094882bc48693dfc10c256a6ae36ee9.zip
frameworks_av-430b61c72094882bc48693dfc10c256a6ae36ee9.tar.gz
frameworks_av-430b61c72094882bc48693dfc10c256a6ae36ee9.tar.bz2
Add capability for floating point Kaiser window filters
Change-Id: Idbb33248bbab2300c2650a4657d8fbc482a5d46c Signed-off-by: Andy Hung <hunga@google.com>
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/AudioResamplerFirGen.h5
1 files changed, 3 insertions, 2 deletions
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<T, int16_t>::value) { // int16_t needs noise shaping
*coef++ = static_cast<T>(toint(y, 1ULL<<(sizeof(T)*8-1), err));
- } else {
+ } else if (is_same<T, int32_t>::value) {
*coef++ = static_cast<T>(toint(y, 1ULL<<(sizeof(T)*8-1)));
+ } else { // assumed float or double
+ *coef++ = static_cast<T>(y);
}
}
}