diff options
author | Andy Hung <hunga@google.com> | 2015-06-19 15:57:19 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-19 15:57:20 +0000 |
commit | ee140da3422212153f88357725f3fc614de5eb44 (patch) | |
tree | b4f3e6bc623ef86ab509d5fc1c2c643a763baa65 | |
parent | f86e831ec0cbdce2d34c48fc567ad91a47099b70 (diff) | |
parent | 83ffcfb53b62489de9d2bd0b0277e879c3e57ab6 (diff) | |
download | frameworks_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.h | 5 |
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); } /* |