diff options
author | Andy Hung <hunga@google.com> | 2014-04-08 18:10:02 -0700 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2014-04-08 18:10:02 -0700 |
commit | 430b61c72094882bc48693dfc10c256a6ae36ee9 (patch) | |
tree | c707e9098f59017e639c5cb1923572ea17b5cd85 /services/audioflinger | |
parent | 781366833a12877b8d5ad4aa081114e30f799319 (diff) | |
download | frameworks_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.h | 5 |
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); } } } |