summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioResampler.cpp
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2014-04-08 18:44:38 -0700
committerAndy Hung <hunga@google.com>2014-04-09 14:30:31 -0700
commit771386e6e6e79697e2d839ef0f25a242946ba1e5 (patch)
treea96089d65f91b69e94dfa09c9a31ac6d9274f1cd /services/audioflinger/AudioResampler.cpp
parentd549139155b20d7cbf6a4326133e06def465ef54 (diff)
downloadframeworks_av-771386e6e6e79697e2d839ef0f25a242946ba1e5.zip
frameworks_av-771386e6e6e79697e2d839ef0f25a242946ba1e5.tar.gz
frameworks_av-771386e6e6e79697e2d839ef0f25a242946ba1e5.tar.bz2
Add and enable floating point option for audio resampler
Can be tested with test-resample. Change-Id: I8339846d7c647444b6025d33cfa145d5d3658121 Signed-off-by: Andy Hung <hunga@google.com>
Diffstat (limited to 'services/audioflinger/AudioResampler.cpp')
-rw-r--r--services/audioflinger/AudioResampler.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/services/audioflinger/AudioResampler.cpp b/services/audioflinger/AudioResampler.cpp
index ca98f16..562c4ea 100644
--- a/services/audioflinger/AudioResampler.cpp
+++ b/services/audioflinger/AudioResampler.cpp
@@ -234,7 +234,16 @@ AudioResampler* AudioResampler::create(int bitDepth, int inChannelCount,
case DYN_MED_QUALITY:
case DYN_HIGH_QUALITY:
ALOGV("Create dynamic Resampler = %d", quality);
- resampler = new AudioResamplerDyn(bitDepth, inChannelCount, sampleRate, quality);
+ if (bitDepth == 32) { /* bitDepth == 32 signals float precision */
+ resampler = new AudioResamplerDyn<float, float, float>(bitDepth, inChannelCount,
+ sampleRate, quality);
+ } else if (quality == DYN_HIGH_QUALITY) {
+ resampler = new AudioResamplerDyn<int32_t, int16_t, int32_t>(bitDepth, inChannelCount,
+ sampleRate, quality);
+ } else {
+ resampler = new AudioResamplerDyn<int16_t, int16_t, int32_t>(bitDepth, inChannelCount,
+ sampleRate, quality);
+ }
break;
}