From 771386e6e6e79697e2d839ef0f25a242946ba1e5 Mon Sep 17 00:00:00 2001 From: Andy Hung Date: Tue, 8 Apr 2014 18:44:38 -0700 Subject: Add and enable floating point option for audio resampler Can be tested with test-resample. Change-Id: I8339846d7c647444b6025d33cfa145d5d3658121 Signed-off-by: Andy Hung --- services/audioflinger/AudioResampler.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'services/audioflinger/AudioResampler.cpp') 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(bitDepth, inChannelCount, + sampleRate, quality); + } else if (quality == DYN_HIGH_QUALITY) { + resampler = new AudioResamplerDyn(bitDepth, inChannelCount, + sampleRate, quality); + } else { + resampler = new AudioResamplerDyn(bitDepth, inChannelCount, + sampleRate, quality); + } break; } -- cgit v1.1