summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2015-06-19 15:57:19 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-19 15:57:20 +0000
commitee140da3422212153f88357725f3fc614de5eb44 (patch)
treeb4f3e6bc623ef86ab509d5fc1c2c643a763baa65
parentf86e831ec0cbdce2d34c48fc567ad91a47099b70 (diff)
parent83ffcfb53b62489de9d2bd0b0277e879c3e57ab6 (diff)
downloadframeworks_av-ee140da3422212153f88357725f3fc614de5eb44.zip
frameworks_av-ee140da3422212153f88357725f3fc614de5eb44.tar.gz
frameworks_av-ee140da3422212153f88357725f3fc614de5eb44.tar.bz2
Merge "Fix clamp issue with AudioMixer with float input and int16 output" into mnc-dev
-rw-r--r--services/audioflinger/AudioMixerOps.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/services/audioflinger/AudioMixerOps.h b/services/audioflinger/AudioMixerOps.h
index 2678857..8d74024 100644
--- a/services/audioflinger/AudioMixerOps.h
+++ b/services/audioflinger/AudioMixerOps.h
@@ -164,13 +164,12 @@ inline int32_t MixMul<int32_t, int16_t, float>(int16_t value, float volume) {
template <>
inline int16_t MixMul<int16_t, int16_t, float>(int16_t value, float volume) {
LOG_ALWAYS_FATAL("MixMul<int16_t, int16_t, float> Runtime Should not be here");
- return value * volume;
+ return clamp16_from_float(MixMul<float, int16_t, float>(value, volume));
}
template <>
inline int16_t MixMul<int16_t, float, float>(float value, float volume) {
- static const float q_15_from_float = (1 << 15);
- return value * volume * q_15_from_float;
+ return clamp16_from_float(value * volume);
}
/*