audio_processing/aecm: Removed usage of macro WEBRTC_SPL_MUL_16_16

The macro is in C defined as
#define WEBRTC_SPL_MUL_16_16(a, b) ((int32_t) (((int16_t)(a)) * ((int16_t)(b))))
(For definition on ARMv7 and MIPS, see common_audio/signal_processing/include/spl_inl_armv7.h and common_audio/signal_processing/include/spl_inl_mips.h)

The replacement consists of
- avoiding casts to int16_t if inputs already are int16_t
- adding explicit cast to <type> if result is assigned to <type> (other than int or int32_t)

BUG=3348, 3353
TESTED=locally on Mac and trybots
R=kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/36639004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8025 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
bjornv@webrtc.org 2015-01-08 17:52:56 +00:00
parent dec649cbab
commit 758d6d431e
3 changed files with 7 additions and 8 deletions

View File

@ -880,7 +880,7 @@ int16_t WebRtcAecm_CalcStepSize(AecmCore* const aecm) {
} else
{
tmp16 = (aecm->farLogEnergy - aecm->farEnergyMin);
tmp32 = WEBRTC_SPL_MUL_16_16(tmp16, MU_DIFF);
tmp32 = tmp16 * MU_DIFF;
tmp32 = WebRtcSpl_DivW32W16(tmp32, aecm->farEnergyMaxMin);
mu = MU_MIN - 1 - (int16_t)(tmp32);
// The -1 is an alternative to rounding. This way we get a larger
@ -1146,14 +1146,13 @@ int16_t WebRtcAecm_CalcSuppressionGain(AecmCore* const aecm) {
// Update counters
if (dE < SUPGAIN_EPC_DT)
{
tmp32no1 = WEBRTC_SPL_MUL_16_16(aecm->supGainErrParamDiffAB, dE);
tmp32no1 = aecm->supGainErrParamDiffAB * dE;
tmp32no1 += (SUPGAIN_EPC_DT >> 1);
tmp16no1 = (int16_t)WebRtcSpl_DivW32W16(tmp32no1, SUPGAIN_EPC_DT);
supGain = aecm->supGainErrParamA - tmp16no1;
} else
{
tmp32no1 = WEBRTC_SPL_MUL_16_16(aecm->supGainErrParamDiffBD,
(ENERGY_DEV_TOL - dE));
tmp32no1 = aecm->supGainErrParamDiffBD * (ENERGY_DEV_TOL - dE);
tmp32no1 += ((ENERGY_DEV_TOL - SUPGAIN_EPC_DT) >> 1);
tmp16no1 = (int16_t)WebRtcSpl_DivW32W16(tmp32no1, (ENERGY_DEV_TOL
- SUPGAIN_EPC_DT));

View File

@ -266,8 +266,8 @@ static int TimeToFrequencyDomain(AecmCore* aecm,
#else
tmp16no1 = WEBRTC_SPL_ABS_W16(freq_signal[i].real);
tmp16no2 = WEBRTC_SPL_ABS_W16(freq_signal[i].imag);
tmp32no1 = WEBRTC_SPL_MUL_16_16(tmp16no1, tmp16no1);
tmp32no2 = WEBRTC_SPL_MUL_16_16(tmp16no2, tmp16no2);
tmp32no1 = tmp16no1 * tmp16no1;
tmp32no2 = tmp16no2 * tmp16no2;
tmp32no2 = WebRtcSpl_AddSatW32(tmp32no1, tmp32no2);
#endif // WEBRTC_ARCH_ARM_V7
tmp32no1 = WebRtcSpl_SqrtFloor(tmp32no2);

View File

@ -688,8 +688,8 @@ static int TimeToFrequencyDomain(AecmCore* aecm,
// The parameters alpha and beta are stored in Q15
tmp16no1 = WEBRTC_SPL_ABS_W16(freq_signal[i].real);
tmp16no2 = WEBRTC_SPL_ABS_W16(freq_signal[i].imag);
tmp32no1 = WEBRTC_SPL_MUL_16_16(tmp16no1, tmp16no1);
tmp32no2 = WEBRTC_SPL_MUL_16_16(tmp16no2, tmp16no2);
tmp32no1 = tmp16no1 * tmp16no1;
tmp32no2 = tmp16no2 * tmp16no2;
tmp32no2 = WebRtcSpl_AddSatW32(tmp32no1, tmp32no2);
tmp32no1 = WebRtcSpl_SqrtFloor(tmp32no2);