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:
parent
dec649cbab
commit
758d6d431e
@ -880,7 +880,7 @@ int16_t WebRtcAecm_CalcStepSize(AecmCore* const aecm) {
|
|||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
tmp16 = (aecm->farLogEnergy - aecm->farEnergyMin);
|
tmp16 = (aecm->farLogEnergy - aecm->farEnergyMin);
|
||||||
tmp32 = WEBRTC_SPL_MUL_16_16(tmp16, MU_DIFF);
|
tmp32 = tmp16 * MU_DIFF;
|
||||||
tmp32 = WebRtcSpl_DivW32W16(tmp32, aecm->farEnergyMaxMin);
|
tmp32 = WebRtcSpl_DivW32W16(tmp32, aecm->farEnergyMaxMin);
|
||||||
mu = MU_MIN - 1 - (int16_t)(tmp32);
|
mu = MU_MIN - 1 - (int16_t)(tmp32);
|
||||||
// The -1 is an alternative to rounding. This way we get a larger
|
// 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
|
// Update counters
|
||||||
if (dE < SUPGAIN_EPC_DT)
|
if (dE < SUPGAIN_EPC_DT)
|
||||||
{
|
{
|
||||||
tmp32no1 = WEBRTC_SPL_MUL_16_16(aecm->supGainErrParamDiffAB, dE);
|
tmp32no1 = aecm->supGainErrParamDiffAB * dE;
|
||||||
tmp32no1 += (SUPGAIN_EPC_DT >> 1);
|
tmp32no1 += (SUPGAIN_EPC_DT >> 1);
|
||||||
tmp16no1 = (int16_t)WebRtcSpl_DivW32W16(tmp32no1, SUPGAIN_EPC_DT);
|
tmp16no1 = (int16_t)WebRtcSpl_DivW32W16(tmp32no1, SUPGAIN_EPC_DT);
|
||||||
supGain = aecm->supGainErrParamA - tmp16no1;
|
supGain = aecm->supGainErrParamA - tmp16no1;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
tmp32no1 = WEBRTC_SPL_MUL_16_16(aecm->supGainErrParamDiffBD,
|
tmp32no1 = aecm->supGainErrParamDiffBD * (ENERGY_DEV_TOL - dE);
|
||||||
(ENERGY_DEV_TOL - dE));
|
|
||||||
tmp32no1 += ((ENERGY_DEV_TOL - SUPGAIN_EPC_DT) >> 1);
|
tmp32no1 += ((ENERGY_DEV_TOL - SUPGAIN_EPC_DT) >> 1);
|
||||||
tmp16no1 = (int16_t)WebRtcSpl_DivW32W16(tmp32no1, (ENERGY_DEV_TOL
|
tmp16no1 = (int16_t)WebRtcSpl_DivW32W16(tmp32no1, (ENERGY_DEV_TOL
|
||||||
- SUPGAIN_EPC_DT));
|
- SUPGAIN_EPC_DT));
|
||||||
|
@ -266,8 +266,8 @@ static int TimeToFrequencyDomain(AecmCore* aecm,
|
|||||||
#else
|
#else
|
||||||
tmp16no1 = WEBRTC_SPL_ABS_W16(freq_signal[i].real);
|
tmp16no1 = WEBRTC_SPL_ABS_W16(freq_signal[i].real);
|
||||||
tmp16no2 = WEBRTC_SPL_ABS_W16(freq_signal[i].imag);
|
tmp16no2 = WEBRTC_SPL_ABS_W16(freq_signal[i].imag);
|
||||||
tmp32no1 = WEBRTC_SPL_MUL_16_16(tmp16no1, tmp16no1);
|
tmp32no1 = tmp16no1 * tmp16no1;
|
||||||
tmp32no2 = WEBRTC_SPL_MUL_16_16(tmp16no2, tmp16no2);
|
tmp32no2 = tmp16no2 * tmp16no2;
|
||||||
tmp32no2 = WebRtcSpl_AddSatW32(tmp32no1, tmp32no2);
|
tmp32no2 = WebRtcSpl_AddSatW32(tmp32no1, tmp32no2);
|
||||||
#endif // WEBRTC_ARCH_ARM_V7
|
#endif // WEBRTC_ARCH_ARM_V7
|
||||||
tmp32no1 = WebRtcSpl_SqrtFloor(tmp32no2);
|
tmp32no1 = WebRtcSpl_SqrtFloor(tmp32no2);
|
||||||
|
@ -688,8 +688,8 @@ static int TimeToFrequencyDomain(AecmCore* aecm,
|
|||||||
// The parameters alpha and beta are stored in Q15
|
// The parameters alpha and beta are stored in Q15
|
||||||
tmp16no1 = WEBRTC_SPL_ABS_W16(freq_signal[i].real);
|
tmp16no1 = WEBRTC_SPL_ABS_W16(freq_signal[i].real);
|
||||||
tmp16no2 = WEBRTC_SPL_ABS_W16(freq_signal[i].imag);
|
tmp16no2 = WEBRTC_SPL_ABS_W16(freq_signal[i].imag);
|
||||||
tmp32no1 = WEBRTC_SPL_MUL_16_16(tmp16no1, tmp16no1);
|
tmp32no1 = tmp16no1 * tmp16no1;
|
||||||
tmp32no2 = WEBRTC_SPL_MUL_16_16(tmp16no2, tmp16no2);
|
tmp32no2 = tmp16no2 * tmp16no2;
|
||||||
tmp32no2 = WebRtcSpl_AddSatW32(tmp32no1, tmp32no2);
|
tmp32no2 = WebRtcSpl_AddSatW32(tmp32no1, tmp32no2);
|
||||||
tmp32no1 = WebRtcSpl_SqrtFloor(tmp32no2);
|
tmp32no1 = WebRtcSpl_SqrtFloor(tmp32no2);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user