aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--webrtc/modules/audio_coding/codecs/ilbc/enhancer_interface.c4
-rw-r--r--webrtc/modules/audio_coding/codecs/ilbc/get_cd_vec.c4
-rw-r--r--webrtc/modules/audio_coding/codecs/ilbc/lsf_to_lsp.c2
-rw-r--r--webrtc/modules/audio_coding/codecs/ilbc/poly_to_lsp.c2
-rw-r--r--webrtc/modules/audio_coding/codecs/ilbc/refiner.c4
-rw-r--r--webrtc/modules/audio_coding/codecs/ilbc/smooth_out_data.c2
-rw-r--r--webrtc/modules/audio_coding/codecs/isac/fix/source/arith_routines_hist.c7
-rw-r--r--webrtc/modules/audio_coding/codecs/isac/fix/source/arith_routines_logist.c3
-rw-r--r--webrtc/modules/audio_coding/codecs/isac/fix/source/bandwidth_estimator.c8
-rw-r--r--webrtc/modules/audio_coding/codecs/isac/fix/source/decode_plc.c25
-rw-r--r--webrtc/modules/audio_coding/codecs/isac/fix/source/encode.c3
-rw-r--r--webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c6
-rw-r--r--webrtc/modules/audio_coding/codecs/isac/fix/source/fft.c6
-rw-r--r--webrtc/modules/audio_coding/codecs/isac/fix/source/lpc_masking_model.c20
-rw-r--r--webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_estimator.c6
-rw-r--r--webrtc/modules/audio_coding/codecs/isac/fix/source/pitch_filter.c3
16 files changed, 47 insertions, 58 deletions
diff --git a/webrtc/modules/audio_coding/codecs/ilbc/enhancer_interface.c b/webrtc/modules/audio_coding/codecs/ilbc/enhancer_interface.c
index 1e978eb2bf..0778c27506 100644
--- a/webrtc/modules/audio_coding/codecs/ilbc/enhancer_interface.c
+++ b/webrtc/modules/audio_coding/codecs/ilbc/enhancer_interface.c
@@ -100,7 +100,7 @@ int WebRtcIlbcfix_EnhancerInterface( /* (o) Estimated lag in end of in[] */
enh_buf+ENH_BUFL-inLen, /* Input samples */
(int16_t)(inLen+ENH_BUFL_FILTEROVERHEAD),
downsampled,
- (int16_t)WEBRTC_SPL_RSHIFT_W16(inLen, 1),
+ (int16_t)(inLen / 2),
(int16_t*)WebRtcIlbcfix_kLpFiltCoefs, /* Coefficients in Q12 */
FILTERORDER_DS_PLUS1, /* Length of filter (order-1) */
FACTOR_DS,
@@ -292,7 +292,7 @@ int WebRtcIlbcfix_EnhancerInterface( /* (o) Estimated lag in end of in[] */
/* Calculate increase parameter for window part (16 last samples) */
/* (1-2*SqrtEnChange)/16 in Q15 */
- inc=(2048-WEBRTC_SPL_RSHIFT_W16(SqrtEnChange, 3));
+ inc = 2048 - (SqrtEnChange >> 3);
win=0;
tmpW16ptr=&plc_pred[plc_blockl-16];
diff --git a/webrtc/modules/audio_coding/codecs/ilbc/get_cd_vec.c b/webrtc/modules/audio_coding/codecs/ilbc/get_cd_vec.c
index ca07b0ae39..fb9b03d3ff 100644
--- a/webrtc/modules/audio_coding/codecs/ilbc/get_cd_vec.c
+++ b/webrtc/modules/audio_coding/codecs/ilbc/get_cd_vec.c
@@ -41,7 +41,7 @@ void WebRtcIlbcfix_GetCbVec(
base_size=lMem-cbveclen+1;
if (cbveclen==SUBL) {
- base_size+=WEBRTC_SPL_RSHIFT_W16(cbveclen,1);
+ base_size += cbveclen / 2;
}
/* No filter -> First codebook section */
@@ -60,7 +60,7 @@ void WebRtcIlbcfix_GetCbVec(
k=(int16_t)WEBRTC_SPL_MUL_16_16(2, (index-(lMem-cbveclen+1)))+cbveclen;
- lag=WEBRTC_SPL_RSHIFT_W16(k, 1);
+ lag = k / 2;
WebRtcIlbcfix_CreateAugmentedVec(lag, mem+lMem, cbvec);
diff --git a/webrtc/modules/audio_coding/codecs/ilbc/lsf_to_lsp.c b/webrtc/modules/audio_coding/codecs/ilbc/lsf_to_lsp.c
index 40737bbeea..579fdcf7eb 100644
--- a/webrtc/modules/audio_coding/codecs/ilbc/lsf_to_lsp.c
+++ b/webrtc/modules/audio_coding/codecs/ilbc/lsf_to_lsp.c
@@ -43,7 +43,7 @@ void WebRtcIlbcfix_Lsf2Lsp(
Lower 8 bits give the difference, which needs
to be approximated linearly
*/
- k = WEBRTC_SPL_RSHIFT_W16(freq, 8);
+ k = freq >> 8;
diff = (freq&0x00ff);
/* Guard against getting outside table */
diff --git a/webrtc/modules/audio_coding/codecs/ilbc/poly_to_lsp.c b/webrtc/modules/audio_coding/codecs/ilbc/poly_to_lsp.c
index 3add966ece..ce5de29a3a 100644
--- a/webrtc/modules/audio_coding/codecs/ilbc/poly_to_lsp.c
+++ b/webrtc/modules/audio_coding/codecs/ilbc/poly_to_lsp.c
@@ -91,7 +91,7 @@ void WebRtcIlbcfix_Poly2Lsp(
/* Run 4 times to reduce the interval */
for (i = 0; i < 4; i++) {
/* xmid =(xlow + xhigh)/2 */
- xmid = WEBRTC_SPL_RSHIFT_W16(xlow, 1) + WEBRTC_SPL_RSHIFT_W16(xhigh, 1);
+ xmid = (xlow >> 1) + (xhigh >> 1);
ymid = WebRtcIlbcfix_Chebyshev(xmid, f[fi_select]);
if (WEBRTC_SPL_MUL_16_16(ylow, ymid) <= 0) {
diff --git a/webrtc/modules/audio_coding/codecs/ilbc/refiner.c b/webrtc/modules/audio_coding/codecs/ilbc/refiner.c
index 50d30c9b81..fed3394812 100644
--- a/webrtc/modules/audio_coding/codecs/ilbc/refiner.c
+++ b/webrtc/modules/audio_coding/codecs/ilbc/refiner.c
@@ -53,7 +53,7 @@ void WebRtcIlbcfix_Refiner(
/* defining array bounds */
- estSegPosRounded=WEBRTC_SPL_RSHIFT_W16((estSegPos - 2),2);
+ estSegPosRounded = (estSegPos - 2) >> 2;
searchSegStartPos=estSegPosRounded-ENH_SLOP;
@@ -103,7 +103,7 @@ void WebRtcIlbcfix_Refiner(
bounds */
*updStartPos = (int16_t)WEBRTC_SPL_MUL_16_16(searchSegStartPos,4) + tloc + 4;
- tloc2 = WEBRTC_SPL_RSHIFT_W16((tloc+3), 2);
+ tloc2 = (tloc + 3) >> 2;
st=searchSegStartPos+tloc2-ENH_FL0;
diff --git a/webrtc/modules/audio_coding/codecs/ilbc/smooth_out_data.c b/webrtc/modules/audio_coding/codecs/ilbc/smooth_out_data.c
index df3a3b7668..cf3b30ae1a 100644
--- a/webrtc/modules/audio_coding/codecs/ilbc/smooth_out_data.c
+++ b/webrtc/modules/audio_coding/codecs/ilbc/smooth_out_data.c
@@ -37,7 +37,7 @@ int32_t WebRtcIlbcfix_Smooth_odata(
errs=0;
for(i=0;i<80;i++) {
- err=(int16_t)WEBRTC_SPL_RSHIFT_W16((psseq[i]-odata[i]), 3);
+ err = (psseq[i] - odata[i]) >> 3;
errs+=WEBRTC_SPL_MUL_16_16(err, err); /* errs in Q-6 */
}
diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/arith_routines_hist.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/arith_routines_hist.c
index 2cc020d403..b88bc1f20a 100644
--- a/webrtc/modules/audio_coding/codecs/isac/fix/source/arith_routines_hist.c
+++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/arith_routines_hist.c
@@ -188,7 +188,7 @@ int16_t WebRtcIsacfix_DecHistBisectMulti(int16_t *data,
W_upper_MSB = WEBRTC_SPL_RSHIFT_W32(W_upper, 16);
/* start halfway the cdf range */
- sizeTmp = WEBRTC_SPL_RSHIFT_W16(*cdfSize++, 1);
+ sizeTmp = *cdfSize++ / 2;
cdfPtr = *cdf + (sizeTmp - 1);
/* method of bisection */
@@ -196,7 +196,7 @@ int16_t WebRtcIsacfix_DecHistBisectMulti(int16_t *data,
{
W_tmp = WEBRTC_SPL_UMUL_32_16(W_upper_MSB, *cdfPtr);
W_tmp += (W_upper_LSB * (*cdfPtr)) >> 16;
- sizeTmp = WEBRTC_SPL_RSHIFT_W16(sizeTmp, 1);
+ sizeTmp /= 2;
if (sizeTmp == 0) {
break;
}
@@ -235,8 +235,7 @@ int16_t WebRtcIsacfix_DecHistBisectMulti(int16_t *data,
(*streamPtr++ & 0x00FF);
streamData->full = 1;
} else {
- streamval = WEBRTC_SPL_LSHIFT_W32(streamval, 8) |
- WEBRTC_SPL_RSHIFT_W16(*streamPtr, 8);
+ streamval = (streamval << 8) | (*streamPtr >> 8);
streamData->full = 0;
}
W_upper = WEBRTC_SPL_LSHIFT_W32(W_upper, 8);
diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/arith_routines_logist.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/arith_routines_logist.c
index 5133128b8a..27f582a2fc 100644
--- a/webrtc/modules/audio_coding/codecs/isac/fix/source/arith_routines_logist.c
+++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/arith_routines_logist.c
@@ -264,8 +264,7 @@ int16_t WebRtcIsacfix_DecLogisticMulti2(int16_t *dataQ7,
}
- res = WEBRTC_SPL_LSHIFT_W32((int32_t)1,
- WEBRTC_SPL_RSHIFT_W16(WebRtcSpl_GetSizeInBits(envQ8[0]), 1));
+ res = 1 << (WebRtcSpl_GetSizeInBits(envQ8[0]) >> 1);
envCount = 0;
/* code assumes lenData%4 == 0 */
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 e69435f03b..7012e8d6bc 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
@@ -904,12 +904,12 @@ uint16_t WebRtcIsacfix_GetMinBytes(RateModel *State,
State->ExceedAgo = 0;
}
} else {
- State->ExceedAgo += (int16_t)WEBRTC_SPL_RSHIFT_W16(FrameSamples, 4); /* ms */
+ State->ExceedAgo += FrameSamples / SAMPLES_PER_MSEC; /* ms */
State->PrevExceed = 1;
}
} else {
State->PrevExceed = 0;
- State->ExceedAgo += (int16_t)WEBRTC_SPL_RSHIFT_W16(FrameSamples, 4); /* ms */
+ State->ExceedAgo += FrameSamples / SAMPLES_PER_MSEC; /* ms */
}
/* set burst flag if bottle neck not exceeded for long time */
@@ -925,7 +925,7 @@ uint16_t WebRtcIsacfix_GetMinBytes(RateModel *State,
/* Update buffer delay */
TransmissionTime = (StreamSize * 8000) / BottleNeck; /* ms */
State->StillBuffered += TransmissionTime;
- State->StillBuffered -= (int16_t)WEBRTC_SPL_RSHIFT_W16(FrameSamples, 4); //>>4 = SAMPLES_PER_MSEC /* ms */
+ State->StillBuffered -= FrameSamples / SAMPLES_PER_MSEC; /* ms */
if (State->StillBuffered < 0) {
State->StillBuffered = 0;
}
@@ -953,7 +953,7 @@ void WebRtcIsacfix_UpdateRateModel(RateModel *State,
/* Update buffer delay */
State->StillBuffered += TransmissionTime;
- State->StillBuffered -= (int16_t)WEBRTC_SPL_RSHIFT_W16(FrameSamples, 4); /* ms */
+ State->StillBuffered -= FrameSamples >> 4; /* ms */
if (State->StillBuffered < 0) {
State->StillBuffered = 0;
}
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 fd30183964..5d6bda5722 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
@@ -110,9 +110,9 @@ static __inline int16_t exp2_Q10_T(int16_t x) { // Both in and out in Q10
int16_t tmp16_1, tmp16_2;
tmp16_2=(int16_t)(0x0400|(x&0x03FF));
- tmp16_1=-(int16_t)WEBRTC_SPL_RSHIFT_W16(x,10);
+ tmp16_1 = -(x >> 10);
if(tmp16_1>0)
- return (int16_t) WEBRTC_SPL_RSHIFT_W16(tmp16_2, tmp16_1);
+ return tmp16_2 >> tmp16_1;
else
return (int16_t) WEBRTC_SPL_LSHIFT_W16(tmp16_2, -tmp16_1);
@@ -305,8 +305,7 @@ int16_t WebRtcIsacfix_DecodePlcImpl(int16_t *signal_out16,
- lag0 = WEBRTC_SPL_RSHIFT_W16(
- (ISACdec_obj->plcstr_obj).lastPitchLag_Q7 + 64, 7 ) + 1;
+ lag0 = ((ISACdec_obj->plcstr_obj.lastPitchLag_Q7 + 64) >> 7) + 1;
if( (ISACdec_obj->plcstr_obj).used != PLC_WAS_USED )
@@ -473,27 +472,23 @@ int16_t WebRtcIsacfix_DecodePlcImpl(int16_t *signal_out16,
/* --- Low Pass */
(ISACdec_obj->plcstr_obj).seed = WEBRTC_SPL_RAND(
(ISACdec_obj->plcstr_obj).seed );
- Vector_Word16_1[i] = WEBRTC_SPL_RSHIFT_W16(
- (ISACdec_obj->plcstr_obj).seed, 10 ) - 16;
+ Vector_Word16_1[i] = (ISACdec_obj->plcstr_obj.seed >> 10) - 16;
/* --- Highpass */
(ISACdec_obj->plcstr_obj).seed = WEBRTC_SPL_RAND(
(ISACdec_obj->plcstr_obj).seed );
- Vector_Word16_2[i] = WEBRTC_SPL_RSHIFT_W16(
- (ISACdec_obj->plcstr_obj).seed, 10 ) - 16;
+ Vector_Word16_2[i] = (ISACdec_obj->plcstr_obj.seed >> 10) - 16;
}
for( i = 1; i < NOISE_FILTER_LEN; i++ )
{
(ISACdec_obj->plcstr_obj).seed = WEBRTC_SPL_RAND(
(ISACdec_obj->plcstr_obj).seed );
- Vector_Word16_Extended_1[ i ] = WEBRTC_SPL_RSHIFT_W16(
- (ISACdec_obj->plcstr_obj).seed, 10 ) - 16;
+ Vector_Word16_Extended_1[i] = (ISACdec_obj->plcstr_obj.seed >> 10) - 16;
(ISACdec_obj->plcstr_obj).seed = WEBRTC_SPL_RAND(
(ISACdec_obj->plcstr_obj).seed );
- Vector_Word16_Extended_2[ i ] = WEBRTC_SPL_RSHIFT_W16(
- (ISACdec_obj->plcstr_obj).seed, 10 ) - 16;
+ Vector_Word16_Extended_2[i] = (ISACdec_obj->plcstr_obj.seed >> 10) - 16;
}
plc_filterma_Fast(Vector_Word16_1, Vector_Word16_Extended_1,
&(ISACdec_obj->plcstr_obj).prevPitchInvIn[FRAMESAMPLES_HALF -
@@ -638,8 +633,7 @@ int16_t WebRtcIsacfix_DecodePlcImpl(int16_t *signal_out16,
(ISACdec_obj->plcstr_obj).seed = WEBRTC_SPL_RAND(
(ISACdec_obj->plcstr_obj).seed );
- noise1 = WEBRTC_SPL_RSHIFT_W16(
- (ISACdec_obj->plcstr_obj).seed, 10 ) - 16;
+ noise1 = (ISACdec_obj->plcstr_obj.seed >> 10) - 16;
nLP = (int16_t)WEBRTC_SPL_MUL_16_16_RSFT(
(int16_t)((noise1)*(ISACdec_obj->plcstr_obj).std),
@@ -648,8 +642,7 @@ int16_t WebRtcIsacfix_DecodePlcImpl(int16_t *signal_out16,
/* --- Highpass */
(ISACdec_obj->plcstr_obj).seed = WEBRTC_SPL_RAND(
(ISACdec_obj->plcstr_obj).seed );
- noise1 = WEBRTC_SPL_RSHIFT_W16(
- (ISACdec_obj->plcstr_obj).seed, 11 ) - 8;
+ noise1 = (ISACdec_obj->plcstr_obj.seed >> 11) - 8;
nHP = (int32_t)WEBRTC_SPL_MUL_16_32_RSFT15(
(ISACdec_obj->plcstr_obj).decayCoeffNoise,
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 daf0d62999..0998545a37 100644
--- a/webrtc/modules/audio_coding/codecs/isac/fix/source/encode.c
+++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/encode.c
@@ -456,7 +456,8 @@ int WebRtcIsacfix_EncodeImpl(int16_t *in,
assert(stream_length >= 0);
if (stream_length & 0x0001){
ISACenc_obj->bitstr_seed = WEBRTC_SPL_RAND( ISACenc_obj->bitstr_seed );
- ISACenc_obj->bitstr_obj.stream[ WEBRTC_SPL_RSHIFT_W16(stream_length, 1) ] |= (uint16_t)(ISACenc_obj->bitstr_seed & 0xFF);
+ ISACenc_obj->bitstr_obj.stream[stream_length / 2] |=
+ (uint16_t)(ISACenc_obj->bitstr_seed & 0xFF);
} else {
ISACenc_obj->bitstr_seed = WEBRTC_SPL_RAND( ISACenc_obj->bitstr_seed );
ISACenc_obj->bitstr_obj.stream[stream_length / 2] =
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 27d1c1fc14..c1b4abb7cd 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
@@ -142,7 +142,7 @@ static int32_t CalcExpN(int16_t x) {
if (x>=0) {
// ax=(int16_t)WEBRTC_SPL_MUL_16_16_RSFT(x, 23637-700, 14); //Q8
ax=(int16_t)WEBRTC_SPL_MUL_16_16_RSFT(x, 23637, 14); //Q8
- axINT = WEBRTC_SPL_RSHIFT_W16(ax, 8); //Q0
+ axINT = ax >> 8; //Q0
axFRAC = ax&0x00FF;
exp16 = WEBRTC_SPL_LSHIFT_W32(1, axINT); //Q0
axFRAC = axFRAC+256; //Q8
@@ -152,7 +152,7 @@ static int32_t CalcExpN(int16_t x) {
// ax=(int16_t)WEBRTC_SPL_MUL_16_16_RSFT(x, 23637+700, 14); //Q8
ax=(int16_t)WEBRTC_SPL_MUL_16_16_RSFT(x, 23637, 14); //Q8
ax = -ax;
- axINT = 1 + WEBRTC_SPL_RSHIFT_W16(ax, 8); //Q0
+ axINT = 1 + (ax >> 8); //Q0
axFRAC = 0x00FF - (ax&0x00FF);
exp16 = (int16_t) WEBRTC_SPL_RSHIFT_W32(32768, axINT); //Q15
axFRAC = axFRAC+256; //Q8
@@ -339,7 +339,7 @@ static void CalcRootInvArSpec(const int16_t *ARCoefQ12,
in_sqrt = summQ16[0] + WEBRTC_SPL_LSHIFT_W32(diffQ16[0], shftVal);
/* convert to magnitude spectrum, by doing square-roots (modified from SPLIB) */
- res = WEBRTC_SPL_LSHIFT_W32(1, WEBRTC_SPL_RSHIFT_W16(WebRtcSpl_GetSizeInBits(in_sqrt), 1));
+ res = 1 << (WebRtcSpl_GetSizeInBits(in_sqrt) >> 1);
for (k = 0; k < FRAMESAMPLES/8; k++)
{
diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/fft.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/fft.c
index d9cf8f2b74..a1876d0939 100644
--- a/webrtc/modules/audio_coding/codecs/isac/fix/source/fft.c
+++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/fft.c
@@ -176,10 +176,8 @@ int16_t WebRtcIsacfix_FftRadix16Fastest(int16_t RexQx[], int16_t ImxQx[], int16_
bjQx = ImxQx[k1] + ImxQx[k2];
RexQx[kk] = akQx + ajQx;
ImxQx[kk] = bkQx + bjQx;
- tmp116 = WEBRTC_SPL_RSHIFT_W16(ajQx, 1);
- tmp216 = WEBRTC_SPL_RSHIFT_W16(bjQx, 1);
- akQx = akQx - tmp116;
- bkQx = bkQx - tmp216;
+ akQx -= ajQx >> 1;
+ bkQx -= bjQx >> 1;
tmp116 = RexQx[k1] - RexQx[k2];
tmp216 = ImxQx[k1] - ImxQx[k2];
diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/lpc_masking_model.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/lpc_masking_model.c
index deba0d5e29..62608cfe95 100644
--- a/webrtc/modules/audio_coding/codecs/isac/fix/source/lpc_masking_model.c
+++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/lpc_masking_model.c
@@ -422,11 +422,11 @@ void WebRtcIsacfix_GetVars(const int16_t *input, const int16_t *pitchGains_Q12,
tmp16=(int16_t)WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(kExp2,pg3,13);/* Q13*Q10>>13 => Q10*/
if (tmp16<0) {
tmp16_2 = (0x0400 | (tmp16 & 0x03FF));
- tmp16_1 = (WEBRTC_SPL_RSHIFT_W16((uint16_t)(tmp16 ^ 0xFFFF), 10)-3); /* Gives result in Q14 */
+ tmp16_1 = ((uint16_t)(tmp16 ^ 0xFFFF) >> 10) - 3; /* Gives result in Q14 */
if (tmp16_1<0)
expPg=(int16_t) -WEBRTC_SPL_LSHIFT_W16(tmp16_2, -tmp16_1);
else
- expPg=(int16_t) -WEBRTC_SPL_RSHIFT_W16(tmp16_2, tmp16_1);
+ expPg = -(tmp16_2 >> tmp16_1);
} else
expPg = (int16_t) -16384; /* 1 in Q14, since 2^0=1 */
@@ -436,11 +436,11 @@ void WebRtcIsacfix_GetVars(const int16_t *input, const int16_t *pitchGains_Q12,
tmp16=(int16_t)WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(kExp2,divVal,13);/* Q13*Q10>>13 => Q10*/
if (tmp16<0) {
tmp16_2 = (0x0400 | (tmp16 & 0x03FF));
- tmp16_1 = (WEBRTC_SPL_RSHIFT_W16((uint16_t)(tmp16 ^ 0xFFFF), 10)-3); /* Gives result in Q14 */
+ tmp16_1 = ((uint16_t)(tmp16 ^ 0xFFFF) >> 10) - 3; /* Gives result in Q14 */
if (tmp16_1<0)
expPg=(int16_t) WEBRTC_SPL_LSHIFT_W16(tmp16_2, -tmp16_1);
else
- expPg=(int16_t) WEBRTC_SPL_RSHIFT_W16(tmp16_2, tmp16_1);
+ expPg = tmp16_2 >> tmp16_1;
} else
expPg = (int16_t) 16384; /* 1 in Q14, since 2^0=1 */
@@ -455,9 +455,9 @@ static __inline int16_t exp2_Q10_T(int16_t x) { // Both in and out in Q10
int16_t tmp16_1, tmp16_2;
tmp16_2=(int16_t)(0x0400|(x&0x03FF));
- tmp16_1=-(int16_t)WEBRTC_SPL_RSHIFT_W16(x,10);
+ tmp16_1 = -(x >> 10);
if(tmp16_1>0)
- return (int16_t) WEBRTC_SPL_RSHIFT_W16(tmp16_2, tmp16_1);
+ return tmp16_2 >> tmp16_1;
else
return (int16_t) WEBRTC_SPL_LSHIFT_W16(tmp16_2, -tmp16_1);
@@ -610,10 +610,10 @@ void WebRtcIsacfix_GetLpcCoef(int16_t *inLoQ0,
/* Calculate tmp = (1.0 + aa*aa); in Q12 */
tmp16 = (int16_t) WEBRTC_SPL_MUL_16_16_RSFT(aaQ14, aaQ14, 15); //Q14*Q14>>15 = Q13
- tmpQQlo = 4096 + WEBRTC_SPL_RSHIFT_W16(tmp16, 1); // Q12 + Q13>>1 = Q12
+ tmpQQlo = 4096 + (tmp16 >> 1); // Q12 + Q13>>1 = Q12.
/* Calculate tmp = (1.0+aa) * (1.0+aa); */
- tmp16 = 8192 + WEBRTC_SPL_RSHIFT_W16(aaQ14, 1); // 1+a in Q13
+ tmp16 = 8192 + (aaQ14 >> 1); // 1+a in Q13.
tmpQQhi = (int16_t) WEBRTC_SPL_MUL_16_16_RSFT(tmp16, tmp16, 14); //Q13*Q13>>14 = Q12
/* replace data in buffer by new look-ahead data */
@@ -878,8 +878,8 @@ void WebRtcIsacfix_GetLpcCoef(int16_t *inLoQ0,
//tmp32a=WEBRTC_SPL_MUL_16_16_RSFT(varscaleQ14, H_T_HQ19, 17); // Q14
- tmp32a=WEBRTC_SPL_RSHIFT_W32((int32_t) varscaleQ14,1); // H_T_HQ19=65536 (16-17=-1) ssh= WEBRTC_SPL_RSHIFT_W16(sh_lo, 1); // sqrt_nrg is in Qssh
- ssh= WEBRTC_SPL_RSHIFT_W16(sh_lo, 1); // sqrt_nrg is in Qssh
+ tmp32a = varscaleQ14 >> 1; // H_T_HQ19=65536 (16-17=-1)
+ ssh = sh_lo >> 1; // sqrt_nrg is in Qssh.
sh = ssh - 14;
tmp32b = WEBRTC_SPL_SHIFT_W32(tmp32a, sh); // Q14->Qssh
tmp32c = sqrt_nrg + tmp32b; // Qssh (denominator)
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 c38cbf6276..3f384fea9d 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
@@ -45,9 +45,9 @@ static __inline int16_t Exp2Q10(int16_t x) { // Both in and out in Q10
int16_t tmp16_1, tmp16_2;
tmp16_2=(int16_t)(0x0400|(x&0x03FF));
- tmp16_1=-(int16_t)WEBRTC_SPL_RSHIFT_W16(x,10);
+ tmp16_1 = -(x >> 10);
if(tmp16_1>0)
- return (int16_t) WEBRTC_SPL_RSHIFT_W16(tmp16_2, tmp16_1);
+ return tmp16_2 >> tmp16_1;
else
return (int16_t) WEBRTC_SPL_LSHIFT_W16(tmp16_2, -tmp16_1);
@@ -88,7 +88,7 @@ static __inline void Intrp1DQ8(int32_t *x, int32_t *fx, int32_t *y, int32_t *fy)
/* 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 = WEBRTC_SPL_RSHIFT_W16(tmp16_1,2); /* Q16>>2 = Q14 */
+ tmp16_1 >>= 2; /* Q16>>2 = Q14 */
t16 = (int16_t)WEBRTC_SPL_MUL_16_16(t16, 64); /* Q8<<6 = Q14 */
tmp16 = tmp16_1-t16;
*fy = WEBRTC_SPL_MUL_16_32_RSFT15(tmp16, fx[0]); /* (Q14 * Q8 >>15)/2 = Q8 */
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 c3db01c64e..6feb292a4d 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
@@ -207,8 +207,7 @@ void WebRtcIsacfix_PitchFilterGains(const int16_t* indatQ0,
indW16 = (int16_t)CalcLrIntQ(curLagQ7, 7);
tmpW16 = WEBRTC_SPL_LSHIFT_W16(indW16, 7);
tmpW16 -= curLagQ7;
- frcQQ = WEBRTC_SPL_RSHIFT_W16(tmpW16, 4);
- frcQQ += 4;
+ frcQQ = (tmpW16 >> 4) + 4;
if (frcQQ == PITCH_FRACS) {
frcQQ = 0;