diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.c index 63797d2df..72e6d6c2c 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.c @@ -243,7 +243,7 @@ int32_t WebRtcIsacfix_UpdateUplinkBwImpl(BwEstimatorstr *bweStr, bweStr->countRecPkts++; /* Calculate framesize in msec */ - frameSizeSampl = WEBRTC_SPL_MUL_16_16((int16_t)SAMPLES_PER_MSEC, frameSize); + frameSizeSampl = SAMPLES_PER_MSEC * frameSize; /* Check that it's not one of the first 9 packets */ if ( bweStr->countUpdates > 0 ) { @@ -269,7 +269,7 @@ int32_t WebRtcIsacfix_UpdateUplinkBwImpl(BwEstimatorstr *bweStr, /* If received number of packets is more than 90% of expected (922 = 0.9 in Q10): */ /* do the update, else not */ - if(WEBRTC_SPL_LSHIFT_W32(bweStr->countRecPkts, 10) > WEBRTC_SPL_MUL_16_16(922, numPktsExpected)) { + if ((int32_t)bweStr->countRecPkts << 10 > 922 * numPktsExpected) { /* Q4 chosen to approx dividing by 16 */ msec = (arrivalTime - bweStr->lastReduction); @@ -378,7 +378,7 @@ int32_t WebRtcIsacfix_UpdateUplinkBwImpl(BwEstimatorstr *bweStr, pksize + HEADER_SIZE); /* 8389 is ~ 1/128000 in Q30 */ - byteSecondsPerBit = WEBRTC_SPL_MUL_16_16(arrTimeDiff, 8389); + byteSecondsPerBit = (uint32_t)(arrTimeDiff * 8389); /* get upper N bits */ tempUpper = WEBRTC_SPL_RSHIFT_U32(byteSecondsPerBit, 15); diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/decode.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/decode.c index 3126f55d3..fd1e292e1 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/decode.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/decode.c @@ -181,7 +181,7 @@ int16_t WebRtcIsacfix_DecodeImpl(int16_t *signal_out16, for (k = 0; k < FRAMESAMPLES/2; k++) { - Vector_Word32_1[k] = (int32_t) WEBRTC_SPL_LSHIFT_W32(WEBRTC_SPL_MUL_16_16(Vector_Word16_2[k], gainQ13), 3); // Q25 + Vector_Word32_1[k] = (Vector_Word16_2[k] * gainQ13) << 3; // Q25 } diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/decode_plc.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/decode_plc.c index 510f5e8b9..fa11ad4ff 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/decode_plc.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/decode_plc.c @@ -59,7 +59,7 @@ static int16_t plc_filterma_Fast( for (j = 0;j < Blen; j++) { - o = WebRtcSpl_AddSatW32(o, WEBRTC_SPL_MUL_16_16(*b_ptr, *x_ptr)); + o = WebRtcSpl_AddSatW32(o, *b_ptr * *x_ptr); b_ptr++; x_ptr--; } @@ -141,8 +141,7 @@ static void MemshipValQ15( int16_t in, int16_t *A, int16_t *B ) x*15 + (x*983)/(2^12); note that 983/2^12 = 0.23999 */ /* we are sure that x is in the range of int16_t */ - x = (int16_t)( WEBRTC_SPL_MUL_16_16( in, 15 ) + - WEBRTC_SPL_MUL_16_16_RSFT( in, 983, 12) ); + x = (int16_t)(in * 15 + WEBRTC_SPL_MUL_16_16_RSFT(in, 983, 12)); /* b = x^2 / 2 {in Q15} so a shift of 16 is required to be in correct domain and one more for the division by 2 */ *B = (int16_t)((x * x + 0x00010000) >> 17); @@ -160,8 +159,7 @@ static void MemshipValQ15( int16_t in, int16_t *A, int16_t *B ) { /* This is a mirror case of the above */ in = 4300 - in; - x = (int16_t)( WEBRTC_SPL_MUL_16_16( in, 15 ) + - WEBRTC_SPL_MUL_16_16_RSFT( in, 983, 12) ); + x = (int16_t)(in * 15 + WEBRTC_SPL_MUL_16_16_RSFT(in, 983, 12)); /* b = x^2 / 2 {in Q15} so a shift of 16 is required to be in correct domain and one more for the division by 2 */ *A = (int16_t)((x * x + 0x00010000) >> 17); @@ -181,7 +179,7 @@ static void MemshipValQ15( int16_t in, int16_t *A, int16_t *B ) static void LinearResampler( int16_t *in, int16_t *out, int16_t lenIn, int16_t lenOut ) { - int32_t n; + int32_t n = (lenIn - 1) * RESAMP_RES; int16_t resOut, i, j, relativePos, diff; /* */ uint16_t udiff; @@ -191,7 +189,6 @@ static void LinearResampler( int16_t *in, int16_t *out, int16_t lenIn, int16_t l return; } - n = WEBRTC_SPL_MUL_16_16( (int16_t)(lenIn-1), RESAMP_RES ); resOut = WebRtcSpl_DivW32W16ResW16( n, (int16_t)(lenOut-1) ); out[0] = in[0]; @@ -780,8 +777,7 @@ int16_t WebRtcIsacfix_DecodePlcImpl(int16_t *signal_out16, /* perceptual post-filtering (using normalized lattice filter) */ for (k = 0; k < FRAMESAMPLES_HALF; k++) - Vector_Word32_1[k] = (int32_t) WEBRTC_SPL_MUL_16_16( - Vector_Word16_2[k], gainQ13) << 3; // Q25 + Vector_Word32_1[k] = (Vector_Word16_2[k] * gainQ13) << 3; // Q25 WebRtcIsacfix_NormLatticeFilterAr(ORDERLO, diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/encode.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/encode.c index 4090720e8..d3e7107b6 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/encode.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/encode.c @@ -338,9 +338,9 @@ int WebRtcIsacfix_EncodeImpl(int16_t *in, // we compare bytesLeftQ5 with ratioQ5[]*arithLenDFTByte; idx = 4; - idx += (bytesLeftQ5 >= WEBRTC_SPL_MUL_16_16(ratioQ5[idx], arithLenDFTByte))? 2:-2; - idx += (bytesLeftQ5 >= WEBRTC_SPL_MUL_16_16(ratioQ5[idx], arithLenDFTByte))? 1:-1; - idx += (bytesLeftQ5 >= WEBRTC_SPL_MUL_16_16(ratioQ5[idx], arithLenDFTByte))? 0:-1; + idx += (bytesLeftQ5 >= ratioQ5[idx] * arithLenDFTByte) ? 2 : -2; + idx += (bytesLeftQ5 >= ratioQ5[idx] * arithLenDFTByte) ? 1 : -1; + idx += (bytesLeftQ5 >= ratioQ5[idx] * arithLenDFTByte) ? 0 : -1; } else { diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c index c80de04d1..3d347f869 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c @@ -140,7 +140,7 @@ static int32_t CalcExpN(int16_t x) { axFRAC = ax&0x00FF; exp16 = WEBRTC_SPL_LSHIFT_W32(1, axINT); //Q0 axFRAC = axFRAC+256; //Q8 - exp = WEBRTC_SPL_MUL_16_16(exp16, axFRAC); // Q0*Q8 = Q8 + exp = exp16 * axFRAC; // Q0*Q8 = Q8 exp = WEBRTC_SPL_LSHIFT_W32(exp, 9); //Q17 } else { // ax=(int16_t)WEBRTC_SPL_MUL_16_16_RSFT(x, 23637+700, 14); //Q8 @@ -150,7 +150,7 @@ static int32_t CalcExpN(int16_t x) { axFRAC = 0x00FF - (ax&0x00FF); exp16 = (int16_t)(32768 >> axINT); // Q15 axFRAC = axFRAC+256; //Q8 - exp = WEBRTC_SPL_MUL_16_16(exp16, axFRAC); // Q15*Q8 = Q23 + exp = exp16 * axFRAC; // Q15*Q8 = Q23 exp >>= 6; // Q17 } @@ -1132,18 +1132,14 @@ static int EstCodeLpcCoef(int32_t *LPCCoefQ17, posg = 0; for (j=0; j Q16 b = WebRtcSpl_AddSatW32(a, state0_ch1); - a = WEBRTC_SPL_MUL_16_16(-factor_ch1[0], (int16_t) (b >> 16)); // Q15 + a = -factor_ch1[0] * (int16_t)(b >> 16); // Q15 state0_ch1 = WebRtcSpl_AddSatW32(a << 1, (uint32_t)in_out << 16); // Q16 in_out = (int16_t) (b >> 16); // Save as Q0 - a = WEBRTC_SPL_MUL_16_16(factor_ch1[1], in_out); // Q15 * Q0 = Q15 + a = factor_ch1[1] * in_out; // Q15 * Q0 = Q15 a <<= 1; // Q15 -> Q16 b = WebRtcSpl_AddSatW32(a, state1_ch1); // Q16 - a = WEBRTC_SPL_MUL_16_16(-factor_ch1[1], (int16_t) (b >> 16)); // Q15 + a = -factor_ch1[1] * (int16_t)(b >> 16); // Q15 state1_ch1 = WebRtcSpl_AddSatW32(a << 1, (uint32_t)in_out << 16); // Q16 data_ch1[n] = (int16_t) (b >> 16); // Save as Q0 // Process channel 2: in_out = data_ch2[n]; - a = WEBRTC_SPL_MUL_16_16(factor_ch2[0], in_out); // Q15 * Q0 = Q15 + a = factor_ch2[0] * in_out; // Q15 * Q0 = Q15 a <<= 1; // Q15 -> Q16 b = WebRtcSpl_AddSatW32(a, state0_ch2); // Q16 - a = WEBRTC_SPL_MUL_16_16(-factor_ch2[0], (int16_t) (b >> 16)); // Q15 + a = -factor_ch2[0] * (int16_t)(b >> 16); // Q15 state0_ch2 = WebRtcSpl_AddSatW32(a << 1, (uint32_t)in_out << 16); // Q16 in_out = (int16_t) (b >> 16); // Save as Q0 - a = WEBRTC_SPL_MUL_16_16(factor_ch2[1], in_out); // Q15 * Q0 = Q15 + a = factor_ch2[1] * in_out; // Q15 * Q0 = Q15 a <<= 1; // Q15 -> Q16 b = WebRtcSpl_AddSatW32(a, state1_ch2); // Q16 - a = WEBRTC_SPL_MUL_16_16(-factor_ch2[1], (int16_t) (b >> 16)); // Q15 + a = -factor_ch2[1] * (int16_t)(b >> 16); // Q15 state1_ch2 = WebRtcSpl_AddSatW32(a << 1, (uint32_t)in_out << 16); // Q16 data_ch2[n] = (int16_t) (b >> 16); // Save as Q0 } @@ -177,21 +177,21 @@ void WebRtcIsacfix_SplitAndFilter1(int16_t *pin, /* First Channel */ for (k=0;kINLABUF1_fix[k]; - prefiltdata->INLABUF1_fix[k]=pin[FRAMESAMPLES+1-WEBRTC_SPL_MUL_16_16(2, QLOOKAHEAD)+WEBRTC_SPL_MUL_16_16(2, k)]; + prefiltdata->INLABUF1_fix[k] = pin[FRAMESAMPLES + 1 - 2 * (QLOOKAHEAD - k)]; } /* Second Channel. This is exactly like the first channel, except that the even samples are now filtered instead (lower channel). */ for (k=0;kINLABUF2_fix[k]; - prefiltdata->INLABUF2_fix[k]=pin[FRAMESAMPLES-WEBRTC_SPL_MUL_16_16(2, QLOOKAHEAD)+WEBRTC_SPL_MUL_16_16(2, k)]; + prefiltdata->INLABUF2_fix[k] = pin[FRAMESAMPLES - 2 * (QLOOKAHEAD - k)]; } @@ -206,7 +206,7 @@ void WebRtcIsacfix_SplitAndFilter1(int16_t *pin, prefiltdata->INSTAT1_fix, prefiltdata->INSTAT2_fix); - for (k=0;kINSTAT1_fix[k]; tmpState_ch2[k] = prefiltdata->INSTAT2_fix[k]; } @@ -256,13 +256,13 @@ void WebRtcIsacfix_SplitAndFilter2(int16_t *pin, /* First Channel */ for (k=0;k> 16)); -@ a0_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[0], (int16_t) (b0_ch2 >> 16)); +@ a0_ch1 = -factor_ch1[0] * (int16_t)(b0_ch1 >> 16); +@ a0_ch2 = -factor_ch2[0] * (int16_t)(b0_ch2 >> 16); @ @ state0_ch1 = WebRtcSpl_AddSatW32(a0_ch1 <<1, (uint32_t)sample0_ch1 << 16); @ state0_ch2 = WebRtcSpl_AddSatW32(a0_ch2 <<1, (uint32_t)sample0_ch2 << 16); @@ -163,20 +163,20 @@ FOR_LOOP: @ @ @ for (n = 0; n < length - 2; n += 2) { -@ a1_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[0], sample1_ch1) << 1; -@ a0_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[1], sample0_ch1) << 1; -@ a1_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[0], sample1_ch2 ) << 1; -@ a0_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[1], sample0_ch2) << 1; +@ a1_ch1 = (factor_ch1[0] * sample1_ch1) << 1; +@ a0_ch1 = (factor_ch1[1] * sample0_ch1) << 1; +@ a1_ch2 = (factor_ch2[0] * sample1_ch2) << 1; +@ a0_ch2 = (factor_ch2[1] * sample0_ch2) << 1; @ @ b1_ch1 = WebRtcSpl_AddSatW32(a1_ch1, state0_ch1); @ b0_ch1 = WebRtcSpl_AddSatW32(a0_ch1, state1_ch1); //Q16+Q16=Q16 @ b1_ch2 = WebRtcSpl_AddSatW32(a1_ch2, state0_ch2); //Q16+Q16=Q16 @ b0_ch2 = WebRtcSpl_AddSatW32(a0_ch2, state1_ch2); //Q16+Q16=Q16 @ -@ a1_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[0], (int16_t) (b1_ch1 >> 16)); -@ a0_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[1], (int16_t) (b0_ch1 >> 16)); -@ a1_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[0], (int16_t) (b1_ch2 >> 16)); -@ a0_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[1], (int16_t) (b0_ch2 >> 16)); +@ a1_ch1 = -factor_ch1[0] * (int16_t)(b1_ch1 >> 16); +@ a0_ch1 = -factor_ch1[1] * (int16_t)(b0_ch1 >> 16); +@ a1_ch2 = -factor_ch2[0] * (int16_t)(b1_ch2 >> 16); +@ a0_ch2 = -factor_ch2[1] * (int16_t)(b0_ch2 >> 16); @ @ state0_ch1 = WebRtcSpl_AddSatW32(a1_ch1<<1, (uint32_t)sample1_ch1 <<16); @ state1_ch1 = WebRtcSpl_AddSatW32(a0_ch1<<1, (uint32_t)sample0_ch1 <<16); @@ -188,20 +188,20 @@ FOR_LOOP: @ sample0_ch2 = data_ch2[n + 2]; @ sample1_ch2 = (int16_t) (b1_ch2 >> 16); //Save as Q0 @ -@ a0_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[0], sample0_ch1) << 1; -@ a1_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[1], sample1_ch1) << 1; -@ a0_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[0], sample0_ch2) << 1; -@ a1_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[1], sample1_ch2 ) << 1; +@ a0_ch1 = (factor_ch1[0] * sample0_ch1) << 1; +@ a1_ch1 = (factor_ch1[1] * sample1_ch1) << 1; +@ a0_ch2 = (factor_ch2[0] * sample0_ch2) << 1; +@ a1_ch2 = (factor_ch2[1] * sample1_ch2) << 1; @ @ b2_ch1 = WebRtcSpl_AddSatW32(a0_ch1, state0_ch1); @ b1_ch1 = WebRtcSpl_AddSatW32(a1_ch1, state1_ch1); //Q16+Q16=Q16 @ b2_ch2 = WebRtcSpl_AddSatW32(a0_ch2, state0_ch2); //Q16+Q16=Q16 @ b1_ch2 = WebRtcSpl_AddSatW32(a1_ch2, state1_ch2); //Q16+Q16=Q16 @ -@ a0_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[0], (int16_t) (b2_ch1 >> 16)); -@ a1_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[1], (int16_t) (b1_ch1 >> 16)); -@ a0_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[0], (int16_t) (b2_ch2 >> 16)); -@ a1_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[1], (int16_t) (b1_ch2 >> 16)); +@ a0_ch1 = -factor_ch1[0] * (int16_t)(b2_ch1 >> 16); +@ a1_ch1 = -factor_ch1[1] * (int16_t)(b1_ch1 >> 16); +@ a0_ch2 = -factor_ch2[0] * (int16_t)(b2_ch2 >> 16); +@ a1_ch2 = -factor_ch2[1] * (int16_t)(b1_ch2 >> 16); @ @ state0_ch1 = WebRtcSpl_AddSatW32(a0_ch1<<1, (uint32_t)sample0_ch1<<16); @ state1_ch1 = WebRtcSpl_AddSatW32(a1_ch1<<1, (uint32_t)sample1_ch1<<16); @@ -222,20 +222,20 @@ FOR_LOOP: @ @ // Loop unrolling post-processing. @ -@ a1_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[0], sample1_ch1) << 1; -@ a0_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[1], sample0_ch1) << 1; -@ a1_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[0], sample1_ch2 ) << 1; -@ a0_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[1], sample0_ch2) << 1; +@ a1_ch1 = (factor_ch1[0] * sample1_ch1) << 1; +@ a0_ch1 = (factor_ch1[1] * sample0_ch1) << 1; +@ a1_ch2 = (factor_ch2[0] * sample1_ch2) << 1; +@ a0_ch2 = (factor_ch2[1] * sample0_ch2) << 1; @ @ b1_ch1 = WebRtcSpl_AddSatW32(a1_ch1, state0_ch1); @ b0_ch1 = WebRtcSpl_AddSatW32(a0_ch1, state1_ch1); @ b1_ch2 = WebRtcSpl_AddSatW32(a1_ch2, state0_ch2); @ b0_ch2 = WebRtcSpl_AddSatW32(a0_ch2, state1_ch2); @ -@ a1_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[0], (int16_t) (b1_ch1 >> 16)); -@ a0_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[1], (int16_t) (b0_ch1 >> 16)); -@ a1_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[0], (int16_t) (b1_ch2 >> 16)); -@ a0_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[1], (int16_t) (b0_ch2 >> 16)); +@ a1_ch1 = -factor_ch1[0] * (int16_t)(b1_ch1 >> 16); +@ a0_ch1 = -factor_ch1[1] * (int16_t)(b0_ch1 >> 16); +@ a1_ch2 = -factor_ch2[0] * (int16_t)(b1_ch2 >> 16); +@ a0_ch2 = -factor_ch2[1] * (int16_t)(b0_ch2 >> 16); @ @ state0_ch1 = WebRtcSpl_AddSatW32(a1_ch1<<1, (uint32_t)sample1_ch1 << 16); @ state1_ch1 = WebRtcSpl_AddSatW32(a0_ch1<<1, (uint32_t)sample0_ch1 << 16); @@ -248,14 +248,14 @@ FOR_LOOP: @ sample1_ch1 = (int16_t) (b1_ch1 >> 16); //Save as Q0 @ sample1_ch2 = (int16_t) (b1_ch2 >> 16); //Save as Q0 @ -@ a1_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[1], sample1_ch1) << 1; -@ a1_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[1], sample1_ch2 ) << 1; +@ a1_ch1 = (factor_ch1[1] * sample1_ch1) << 1; +@ a1_ch2 = (factor_ch2[1] * sample1_ch2) << 1; @ @ b1_ch1 = WebRtcSpl_AddSatW32(a1_ch1, state1_ch1); //Q16+Q16=Q16 @ b1_ch2 = WebRtcSpl_AddSatW32(a1_ch2, state1_ch2); //Q16+Q16=Q16 @ -@ a1_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[1], (int16_t) (b1_ch1 >> 16)); -@ a1_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[1], (int16_t) (b1_ch2 >> 16)); +@ a1_ch1 = -factor_ch1[1] * (int16_t)(b1_ch1 >> 16); +@ a1_ch2 = -factor_ch2[1] * (int16_t)(b1_ch2 >> 16); @ @ state1_ch1 = WebRtcSpl_AddSatW32(a1_ch1<<1, (uint32_t)sample1_ch1<<16); @ state1_ch2 = WebRtcSpl_AddSatW32(a1_ch2<<1, (uint32_t)sample1_ch2<<16); diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/filterbanks_neon.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/filterbanks_neon.c index e7863d9ae..614e16982 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/filterbanks_neon.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/filterbanks_neon.c @@ -149,14 +149,14 @@ void WebRtcIsacfix_AllpassFilter2FixDec16Neon( // sample0_ch1 = data_ch1[n]; // sample0_ch2 = data_ch2[n]; // -// a0_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[0], sample0_ch1) << 1; -// a0_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[0], sample0_ch2) << 1; +// a0_ch1 = (factor_ch1[0] * sample0_ch1) << 1; +// a0_ch2 = (factor_ch2[0] * sample0_ch2) << 1; // // b0_ch1 = WebRtcSpl_AddSatW32(a0_ch1, state0_ch1); // b0_ch2 = WebRtcSpl_AddSatW32(a0_ch2, state0_ch2); //Q16+Q16=Q16 // -// a0_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[0], (int16_t) (b0_ch1 >> 16)); -// a0_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[0], (int16_t) (b0_ch2 >> 16)); +// a0_ch1 = -factor_ch1[0] * (int16_t)(b0_ch1 >> 16); +// a0_ch2 = -factor_ch2[0] * (int16_t)(b0_ch2 >> 16); // // state0_ch1 = WebRtcSpl_AddSatW32(a0_ch1 <<1, (uint32_t)sample0_ch1 << 16); // state0_ch2 = WebRtcSpl_AddSatW32(a0_ch2 <<1, (uint32_t)sample0_ch2 << 16); @@ -168,20 +168,20 @@ void WebRtcIsacfix_AllpassFilter2FixDec16Neon( // // // for (n = 0; n < length - 2; n += 2) { -// a1_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[0], sample1_ch1) << 1; -// a0_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[1], sample0_ch1) << 1; -// a1_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[0], sample1_ch2 ) << 1; -// a0_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[1], sample0_ch2) << 1; +// a1_ch1 = (factor_ch1[0] * sample1_ch1) << 1; +// a0_ch1 = (factor_ch1[1] * sample0_ch1) << 1; +// a1_ch2 = (factor_ch2[0] * sample1_ch2) << 1; +// a0_ch2 = (factor_ch2[1] * sample0_ch2) << 1; // // b1_ch1 = WebRtcSpl_AddSatW32(a1_ch1, state0_ch1); // b0_ch1 = WebRtcSpl_AddSatW32(a0_ch1, state1_ch1); //Q16+Q16=Q16 // b1_ch2 = WebRtcSpl_AddSatW32(a1_ch2, state0_ch2); //Q16+Q16=Q16 // b0_ch2 = WebRtcSpl_AddSatW32(a0_ch2, state1_ch2); //Q16+Q16=Q16 // -// a1_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[0], (int16_t) (b1_ch1 >> 16)); -// a0_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[1], (int16_t) (b0_ch1 >> 16)); -// a1_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[0], (int16_t) (b1_ch2 >> 16)); -// a0_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[1], (int16_t) (b0_ch2 >> 16)); +// a1_ch1 = -factor_ch1[0] * (int16_t)(b1_ch1 >> 16); +// a0_ch1 = -factor_ch1[1] * (int16_t)(b0_ch1 >> 16); +// a1_ch2 = -factor_ch2[0] * (int16_t)(b1_ch2 >> 16); +// a0_ch2 = -factor_ch2[1] * (int16_t)(b0_ch2 >> 16); // // state0_ch1 = WebRtcSpl_AddSatW32(a1_ch1<<1, (uint32_t)sample1_ch1 <<16); // state1_ch1 = WebRtcSpl_AddSatW32(a0_ch1<<1, (uint32_t)sample0_ch1 <<16); @@ -193,20 +193,20 @@ void WebRtcIsacfix_AllpassFilter2FixDec16Neon( // sample0_ch2 = data_ch2[n + 2]; // sample1_ch2 = (int16_t) (b1_ch2 >> 16); //Save as Q0 // -// a0_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[0], sample0_ch1) << 1; -// a1_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[1], sample1_ch1) << 1; -// a0_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[0], sample0_ch2) << 1; -// a1_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[1], sample1_ch2 ) << 1; +// a0_ch1 = (factor_ch1[0] * sample0_ch1) << 1; +// a1_ch1 = (factor_ch1[1] * sample1_ch1) << 1; +// a0_ch2 = (factor_ch2[0] * sample0_ch2) << 1; +// a1_ch2 = (factor_ch2[1] * sample1_ch2) << 1; // // b2_ch1 = WebRtcSpl_AddSatW32(a0_ch1, state0_ch1); // b1_ch1 = WebRtcSpl_AddSatW32(a1_ch1, state1_ch1); //Q16+Q16=Q16 // b2_ch2 = WebRtcSpl_AddSatW32(a0_ch2, state0_ch2); //Q16+Q16=Q16 // b1_ch2 = WebRtcSpl_AddSatW32(a1_ch2, state1_ch2); //Q16+Q16=Q16 // -// a0_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[0], (int16_t) (b2_ch1 >> 16)); -// a1_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[1], (int16_t) (b1_ch1 >> 16)); -// a0_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[0], (int16_t) (b2_ch2 >> 16)); -// a1_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[1], (int16_t) (b1_ch2 >> 16)); +// a0_ch1 = -factor_ch1[0] * (int16_t)(b2_ch1 >> 16); +// a1_ch1 = -factor_ch1[1] * (int16_t)(b1_ch1 >> 16); +// a0_ch2 = -factor_ch2[0] * (int16_t)(b2_ch2 >> 16); +// a1_ch2 = -factor_ch2[1] * (int16_t)(b1_ch2 >> 16); // // state0_ch1 = WebRtcSpl_AddSatW32(a0_ch1<<1, (uint32_t)sample0_ch1<<16); // state1_ch1 = WebRtcSpl_AddSatW32(a1_ch1<<1, (uint32_t)sample1_ch1<<16); @@ -227,20 +227,20 @@ void WebRtcIsacfix_AllpassFilter2FixDec16Neon( // // // Loop unrolling post-processing. // -// a1_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[0], sample1_ch1) << 1; -// a0_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[1], sample0_ch1) << 1; -// a1_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[0], sample1_ch2 ) << 1; -// a0_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[1], sample0_ch2) << 1; +// a1_ch1 = (factor_ch1[0] * sample1_ch1) << 1; +// a0_ch1 = (factor_ch1[1] * sample0_ch1) << 1; +// a1_ch2 = (factor_ch2[0] * sample1_ch2) << 1; +// a0_ch2 = (factor_ch2[1] * sample0_ch2) << 1; // // b1_ch1 = WebRtcSpl_AddSatW32(a1_ch1, state0_ch1); // b0_ch1 = WebRtcSpl_AddSatW32(a0_ch1, state1_ch1); // b1_ch2 = WebRtcSpl_AddSatW32(a1_ch2, state0_ch2); // b0_ch2 = WebRtcSpl_AddSatW32(a0_ch2, state1_ch2); // -// a1_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[0], (int16_t) (b1_ch1 >> 16)); -// a0_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[1], (int16_t) (b0_ch1 >> 16)); -// a1_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[0], (int16_t) (b1_ch2 >> 16)); -// a0_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[1], (int16_t) (b0_ch2 >> 16)); +// a1_ch1 = -factor_ch1[0] * (int16_t)(b1_ch1 >> 16); +// a0_ch1 = -factor_ch1[1] * (int16_t)(b0_ch1 >> 16); +// a1_ch2 = -factor_ch2[0] * (int16_t)(b1_ch2 >> 16); +// a0_ch2 = -factor_ch2[1] * (int16_t)(b0_ch2 >> 16); // // state0_ch1 = WebRtcSpl_AddSatW32(a1_ch1<<1, (uint32_t)sample1_ch1 << 16); // state1_ch1 = WebRtcSpl_AddSatW32(a0_ch1<<1, (uint32_t)sample0_ch1 << 16); @@ -253,14 +253,14 @@ void WebRtcIsacfix_AllpassFilter2FixDec16Neon( // sample1_ch1 = (int16_t) (b1_ch1 >> 16); //Save as Q0 // sample1_ch2 = (int16_t) (b1_ch2 >> 16); //Save as Q0 // -// a1_ch1 = WEBRTC_SPL_MUL_16_16(factor_ch1[1], sample1_ch1) << 1; -// a1_ch2 = WEBRTC_SPL_MUL_16_16(factor_ch2[1], sample1_ch2 ) << 1; +// a1_ch1 = (factor_ch1[1] * sample1_ch1) << 1; +// a1_ch2 = (factor_ch2[1] * sample1_ch2) << 1; // // b1_ch1 = WebRtcSpl_AddSatW32(a1_ch1, state1_ch1); //Q16+Q16=Q16 // b1_ch2 = WebRtcSpl_AddSatW32(a1_ch2, state1_ch2); //Q16+Q16=Q16 // -// a1_ch1 = WEBRTC_SPL_MUL_16_16(-factor_ch1[1], (int16_t) (b1_ch1 >> 16)); -// a1_ch2 = WEBRTC_SPL_MUL_16_16(-factor_ch2[1], (int16_t) (b1_ch2 >> 16)); +// a1_ch1 = -factor_ch1[1] * (int16_t)(b1_ch1 >> 16); +// a1_ch2 = -factor_ch2[1] * (int16_t)(b1_ch2 >> 16); // // state1_ch1 = WebRtcSpl_AddSatW32(a1_ch1<<1, (uint32_t)sample1_ch1<<16); // state1_ch2 = WebRtcSpl_AddSatW32(a1_ch2<<1, (uint32_t)sample1_ch2<<16); diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/filters.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/filters.c index 2a74fc0fe..aa9179237 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/filters.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/filters.c @@ -32,7 +32,7 @@ int WebRtcIsacfix_AutocorrC(int32_t* __restrict r, // Calculate r[0]. for (i = 0; i < N; i++) { - prod += WEBRTC_SPL_MUL_16_16(x[i], x[i]); + prod += x[i] * x[i]; } // Calculate scaling (the value of shifting). @@ -48,7 +48,7 @@ int WebRtcIsacfix_AutocorrC(int32_t* __restrict r, for (i = 1; i < order + 1; i++) { prod = 0; for (j = 0; j < N - i; j++) { - prod += WEBRTC_SPL_MUL_16_16(x[j], x[i + j]); + prod += x[j] * x[i + j]; } sum = (int32_t)(prod >> scaling); r[i] = sum; @@ -98,11 +98,10 @@ void WebRtcIsacfix_DecimateAllpass32(const int16_t *in, int16_t data_vec[PITCH_FRAME_LEN]; /* copy input */ - memcpy(data_vec+1, in, WEBRTC_SPL_MUL_16_16(sizeof(int16_t), (N-1))); - + memcpy(data_vec + 1, in, sizeof(int16_t) * (N - 1)); data_vec[0] = (int16_t)(state_in[2 * ALLPASSSECTIONS] >> 16); // z^-1 state. - state_in[WEBRTC_SPL_MUL_16_16(2, ALLPASSSECTIONS)] = WEBRTC_SPL_LSHIFT_W32((uint32_t)in[N-1],16); + state_in[2 * ALLPASSSECTIONS] = WEBRTC_SPL_LSHIFT_W32((uint32_t)in[N-1],16); @@ -110,7 +109,6 @@ void WebRtcIsacfix_DecimateAllpass32(const int16_t *in, AllpassFilterForDec32(data_vec, kApLowerQ15, N, state_in+ALLPASSSECTIONS); for (n=0;nINLABUF1_fix[k] = 0; prefiltdata->INLABUF2_fix[k] = 0; } - for (k = 0; k < WEBRTC_SPL_MUL_16_16(2,(QORDER-1)); k++) { - + for (k = 0; k < 2 * (QORDER - 1); k++) { prefiltdata->INSTAT1_fix[k] = 0; prefiltdata->INSTAT2_fix[k] = 0; } @@ -95,8 +94,7 @@ void WebRtcIsacfix_InitPostFilterbank(PostFiltBankstr *postfiltdata) { int k; - for (k = 0; k < WEBRTC_SPL_MUL_16_16(2, POSTQORDER); k++) { - + for (k = 0; k < 2 * POSTQORDER; k++) { postfiltdata->STATE_0_LOWER_fix[k] = 0; postfiltdata->STATE_0_UPPER_fix[k] = 0; } @@ -133,7 +131,7 @@ void WebRtcIsacfix_InitPitchAnalysis(PitchAnalysisStruct *State) for (k = 0; k < PITCH_CORR_LEN2+PITCH_CORR_STEP2+PITCH_MAX_LAG/2-PITCH_FRAME_LEN/2+2; k++) { State->dec_buffer16[k] = 0; } - for (k = 0; k < WEBRTC_SPL_MUL_16_16(2, ALLPASSSECTIONS)+1; k++) { + for (k = 0; k < 2 * ALLPASSSECTIONS + 1; k++) { State->decimator_state32[k] = 0; } diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/lattice.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/lattice.c index 6bb987b9e..6f9eec773 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/lattice.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/lattice.c @@ -115,11 +115,11 @@ void WebRtcIsacfix_NormLatticeFilterMa(int16_t orderCoef, for (u=0;u Q15 for (m=useOrder-1; m>0; m--) { - tmp_inv_denum32 = ((int32_t) 1073741823) - WEBRTC_SPL_MUL_16_16(k16[m], k16[m]); // (1 - k^2) in Q30 + // (1 - k^2) in Q30 + tmp_inv_denum32 = 1073741823 - k16[m] * k16[m]; tmp_inv_denum16 = (int16_t)(tmp_inv_denum32 >> 15); // (1 - k^2) in Q15. for (k=1; k<=m; k++) { tmp32b = WEBRTC_SPL_LSHIFT_W32((int32_t)a16[k], 16) - - WEBRTC_SPL_LSHIFT_W32(WEBRTC_SPL_MUL_16_16(k16[m], a16[m-k+1]), 1); + WEBRTC_SPL_LSHIFT_W32(k16[m] * a16[m - k + 1], 1); tmp32[k] = WebRtcSpl_DivW32W16(tmp32b, tmp_inv_denum16); //Q27/Q15 = Q12 } @@ -371,19 +372,19 @@ void WebRtcIsacfix_GetVars(const int16_t *input, const int16_t *pitchGains_Q12, /* Calculate energies of first and second frame halfs */ nrgQ[0]=0; for (k = QLOOKAHEAD/2; k < (FRAMESAMPLES/4 + QLOOKAHEAD) / 2; k++) { - nrgQ[0] +=WEBRTC_SPL_MUL_16_16(input[k],input[k]); + nrgQ[0] += (uint32_t)(input[k] * input[k]); } nrgQ[1]=0; for ( ; k < (FRAMESAMPLES/2 + QLOOKAHEAD) / 2; k++) { - nrgQ[1] +=WEBRTC_SPL_MUL_16_16(input[k],input[k]); + nrgQ[1] += (uint32_t)(input[k] * input[k]); } nrgQ[2]=0; - for ( ; k < (WEBRTC_SPL_MUL_16_16(FRAMESAMPLES, 3)/4 + QLOOKAHEAD) / 2; k++) { - nrgQ[2] +=WEBRTC_SPL_MUL_16_16(input[k],input[k]); + for ( ; k < (FRAMESAMPLES * 3 / 4 + QLOOKAHEAD) / 2; k++) { + nrgQ[2] += (uint32_t)(input[k] * input[k]); } nrgQ[3]=0; for ( ; k < (FRAMESAMPLES + QLOOKAHEAD) / 2; k++) { - nrgQ[3] +=WEBRTC_SPL_MUL_16_16(input[k],input[k]); + nrgQ[3] += (uint32_t)(input[k] * input[k]); } for ( k=0; k<4; k++) { @@ -482,7 +483,7 @@ int32_t WebRtcIsacfix_CalculateResidualEnergyC(int lpc_order, * a_polynomial[j] * corr_coeffs[i] * a_polynomial[j - i] * 2; */ - tmp32 = WEBRTC_SPL_MUL_16_16(a_polynomial[j], a_polynomial[j - i]); + tmp32 = a_polynomial[j] * a_polynomial[j - i]; /* tmp32 in Q(q_val_polynomial * 2). */ if (i != 0) { tmp32 <<= 1; @@ -622,7 +623,7 @@ void WebRtcIsacfix_GetLpcCoef(int16_t *inLoQ0, DataHiQ6[pos1] = (int16_t) WEBRTC_SPL_MUL_16_16_RSFT( maskdata->DataBufferHiQ0[pos1], kWindowAutocorr[pos1], 15); // Q0*Q21>>15 = Q6 } - pos2 = (int16_t)(WEBRTC_SPL_MUL_16_16(k, UPDATE)/2); + pos2 = (int16_t)(k * UPDATE / 2); for (n = 0; n < UPDATE/2; n++, pos1++) { maskdata->DataBufferLoQ0[pos1] = inLoQ0[QLOOKAHEAD + pos2]; maskdata->DataBufferHiQ0[pos1] = inHiQ0[pos2++]; @@ -830,15 +831,15 @@ void WebRtcIsacfix_GetLpcCoef(int16_t *inLoQ0, /* bandwidth expansion */ for (n = 1; n <= ORDERLO; n++) { - a_LOQ11[n] = (int16_t) ((WEBRTC_SPL_MUL_16_16( - kPolyVecLo[n-1], a_LOQ11[n]) + ((int32_t) (1 << 14))) >> 15); + a_LOQ11[n] = (int16_t)((kPolyVecLo[n - 1] * a_LOQ11[n] + (1 << 14)) >> + 15); } polyHI[0] = a_HIQ12[0]; for (n = 1; n <= ORDERHI; n++) { - a_HIQ12[n] = (int16_t) ((WEBRTC_SPL_MUL_16_16( - kPolyVecHi[n-1], a_HIQ12[n]) + ((int32_t) (1 << 14))) >> 15); + a_HIQ12[n] = (int16_t)(((int32_t)(kPolyVecHi[n - 1] * a_HIQ12[n]) + + (1 << 14)) >> 15); polyHI[n] = a_HIQ12[n]; } diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.c index a315c47a4..824239503 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.c @@ -87,9 +87,9 @@ static __inline void Intrp1DQ8(int32_t *x, int32_t *fx, int32_t *y, int32_t *fy) /* fy = 0.5 * t * (t-1) * fx[0] + (1-t*t) * fx[1] + 0.5 * t * (t+1) * fx[2]; */ /* Part I: 0.5 * t * (t-1) * fx[0] */ - tmp16_1=(int16_t)WEBRTC_SPL_MUL_16_16(t16,t16); /* Q8*Q8=Q16 */ + tmp16_1 = (int16_t)(t16 * t16); /* Q8*Q8=Q16 */ tmp16_1 >>= 2; /* Q16>>2 = Q14 */ - t16 = (int16_t)WEBRTC_SPL_MUL_16_16(t16, 64); /* Q8<<6 = Q14 */ + t16 <<= 6; /* Q8<<6 = Q14 */ tmp16 = tmp16_1-t16; *fy = WEBRTC_SPL_MUL_16_32_RSFT15(tmp16, fx[0]); /* (Q14 * Q8 >>15)/2 = Q8 */ @@ -191,7 +191,7 @@ void WebRtcIsacfix_InitialPitch(const int16_t *in, /* Q0 */ /* copy old values from state buffer */ - memcpy(buf_dec16, State->dec_buffer16, WEBRTC_SPL_MUL_16_16(sizeof(int16_t), (PITCH_CORR_LEN2+PITCH_CORR_STEP2+PITCH_MAX_LAG/2-PITCH_FRAME_LEN/2+2))); + memcpy(buf_dec16, State->dec_buffer16, sizeof(State->dec_buffer16)); /* decimation; put result after the old values */ WebRtcIsacfix_DecimateAllpass32(in, State->decimator_state32, PITCH_FRAME_LEN, diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter.c index d27daf332..472b54d33 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter.c @@ -219,7 +219,7 @@ void WebRtcIsacfix_PitchFilterGains(const int16_t* indatQ0, tmpW32 = 0; for (m = 0; m < PITCH_FRACORDER; m++) { - tmpW32 += WEBRTC_SPL_MUL_16_16(ubufQQ[pos3QQ + m], fracoeffQQ[m]); + tmpW32 += ubufQQ[pos3QQ + m] * fracoeffQQ[m]; } // Subtract from input and update buffer. @@ -228,7 +228,7 @@ void WebRtcIsacfix_PitchFilterGains(const int16_t* indatQ0, tmp2W32 = WEBRTC_SPL_MUL_16_32_RSFT14(indatQ0[ind], tmpW32); tmpW32 += 8192; tmpW16 = (int16_t)(tmpW32 >> 14); - tmpW32 = WEBRTC_SPL_MUL_16_16(tmpW16, tmpW16); + tmpW32 = tmpW16 * tmpW16; if ((tmp2W32 > 1073700000) || (csum1QQ > 1073700000) || (tmpW32 > 1073700000) || (esumxQQ > 1073700000)) { // 2^30 diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter_c.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter_c.c index 2f3fb4b87..5c956780e 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter_c.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter_c.c @@ -35,7 +35,7 @@ void WebRtcIsacfix_PitchFilterCore(int loopNumber, /* Filter to get fractional pitch. */ for (j = 0; j < PITCH_FRACORDER; j++) { - tmpW32 += WEBRTC_SPL_MUL_16_16(ubufQQpos2[*index2 + j], coefficient[j]); + tmpW32 += ubufQQpos2[*index2 + j] * coefficient[j]; } /* Saturate to avoid overflow in tmpW16. */ @@ -54,7 +54,7 @@ void WebRtcIsacfix_PitchFilterCore(int loopNumber, /* TODO(kma): Define a static inline function WebRtcSpl_DotProduct() in spl_inl.h to replace this and other similar loops. */ for (j = 0; j < PITCH_DAMPORDER; j++) { - tmpW32 += WEBRTC_SPL_MUL_16_16(inputState[j], kDampFilter[j]); + tmpW32 += inputState[j] * kDampFilter[j]; } /* Saturate to avoid overflow in tmpW16. */ @@ -63,7 +63,7 @@ void WebRtcIsacfix_PitchFilterCore(int loopNumber, tmpW16 = (int16_t)(tmpW32 >> 15); /* Subtract from input and update buffer. */ - tmpW32 = inputBuf[*index2] - WEBRTC_SPL_MUL_16_16(sign, tmpW16); + tmpW32 = inputBuf[*index2] - sign * tmpW16; outputBuf[*index2] = WebRtcSpl_SatW32ToW16(tmpW32); tmpW32 = inputBuf[*index2] + outputBuf[*index2]; outputBuf2[*index2 + PITCH_BUFFSIZE] = WebRtcSpl_SatW32ToW16(tmpW32);