From ac55f7b33c1361c007693f3f7d87781abcedbdbd Mon Sep 17 00:00:00 2001 From: "turajs@google.com" Date: Fri, 26 Aug 2011 16:02:16 +0000 Subject: [PATCH] Review URL: http://webrtc-codereview.appspot.com/115004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@461 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../codecs/iLBC/main/source/enhancer.c | 5 +-- .../codecs/iLBC/main/source/enhancer.h | 2 - .../iLBC/main/source/enhancer_interface.c | 2 +- .../codecs/iLBC/main/source/get_sync_seq.c | 12 +++--- .../codecs/iLBC/main/source/get_sync_seq.h | 2 - .../codecs/iLBC/main/source/ilbc.c | 4 +- .../main/source/lsf_interpolate_to_poly_enc.c | 4 -- .../main/source/lsf_interpolate_to_poly_enc.h | 2 - .../iLBC/main/source/nearest_neighbor.c | 4 -- .../iLBC/main/source/nearest_neighbor.h | 2 - .../codecs/iLBC/main/source/refiner.c | 5 --- .../codecs/iLBC/main/source/refiner.h | 2 - .../iLBC/main/source/simple_interpolate_lsf.c | 39 ++++++++++++------- .../codecs/iLBC/main/source/smooth.c | 1 - 14 files changed, 35 insertions(+), 51 deletions(-) diff --git a/src/modules/audio_coding/codecs/iLBC/main/source/enhancer.c b/src/modules/audio_coding/codecs/iLBC/main/source/enhancer.c index e8f4ef33ee..b8f3335afb 100644 --- a/src/modules/audio_coding/codecs/iLBC/main/source/enhancer.c +++ b/src/modules/audio_coding/codecs/iLBC/main/source/enhancer.c @@ -27,8 +27,6 @@ *---------------------------------------------------------------*/ void WebRtcIlbcfix_Enhancer( - iLBC_Dec_Inst_t *iLBCdec_inst, - /* (i) Decoder state */ WebRtc_Word16 *odata, /* (o) smoothed block, dimension blockl */ WebRtc_Word16 *idata, /* (i) data buffer used for enhancing */ WebRtc_Word16 idatal, /* (i) dimension idata */ @@ -44,7 +42,8 @@ void WebRtcIlbcfix_Enhancer( /* get said second sequence of segments */ - WebRtcIlbcfix_GetSyncSeq(iLBCdec_inst, idata,idatal,centerStartPos,period,plocs,periodl,ENH_HL,surround); + WebRtcIlbcfix_GetSyncSeq(idata, idatal, centerStartPos, period, plocs, + periodl, ENH_HL, surround); /* compute the smoothed output from said second sequence */ diff --git a/src/modules/audio_coding/codecs/iLBC/main/source/enhancer.h b/src/modules/audio_coding/codecs/iLBC/main/source/enhancer.h index 5feb6ecd75..e14f559575 100644 --- a/src/modules/audio_coding/codecs/iLBC/main/source/enhancer.h +++ b/src/modules/audio_coding/codecs/iLBC/main/source/enhancer.h @@ -27,8 +27,6 @@ *---------------------------------------------------------------*/ void WebRtcIlbcfix_Enhancer( - iLBC_Dec_Inst_t *iLBCdec_inst, - /* (i) Decoder state */ WebRtc_Word16 *odata, /* (o) smoothed block, dimension blockl */ WebRtc_Word16 *idata, /* (i) data buffer used for enhancing */ WebRtc_Word16 idatal, /* (i) dimension idata */ diff --git a/src/modules/audio_coding/codecs/iLBC/main/source/enhancer_interface.c b/src/modules/audio_coding/codecs/iLBC/main/source/enhancer_interface.c index 9d6cf89c60..5ef329a905 100644 --- a/src/modules/audio_coding/codecs/iLBC/main/source/enhancer_interface.c +++ b/src/modules/audio_coding/codecs/iLBC/main/source/enhancer_interface.c @@ -334,7 +334,7 @@ int WebRtcIlbcfix_EnhancerInterface( /* (o) Estimated lag in end of in[] */ /* Perform enhancement block by block */ for (iblock = 0; iblock=0;q--) { blockStartPos[q]=blockStartPos[q+1]-period[lagBlock[q+1]]; - WebRtcIlbcfix_NearestNeighbor(iLBCdec_inst, lagBlock+q, plocs, + WebRtcIlbcfix_NearestNeighbor(lagBlock+q, plocs, (WebRtc_Word16)(blockStartPos[q] + (WebRtc_Word16)WEBRTC_SPL_MUL_16_16(4, ENH_BLOCKL_HALF)-period[lagBlock[q+1]]), periodl); @@ -68,7 +66,7 @@ void WebRtcIlbcfix_GetSyncSeq( /* Find the best possible sequence in the 4 times upsampled domain around blockStartPos+q */ - WebRtcIlbcfix_Refiner(iLBCdec_inst, blockStartPos+q,idata,idatal, + WebRtcIlbcfix_Refiner(blockStartPos+q,idata,idatal, centerStartPos,blockStartPos[q],surround,WebRtcIlbcfix_kEnhWt[q]); } else { @@ -86,7 +84,7 @@ void WebRtcIlbcfix_GetSyncSeq( for(q=hl+1;q<=WEBRTC_SPL_MUL_16_16(2, hl);q++) { - WebRtcIlbcfix_NearestNeighbor(iLBCdec_inst, lagBlock+q,plocs2, + WebRtcIlbcfix_NearestNeighbor(lagBlock+q,plocs2, (WebRtc_Word16)(blockStartPos[q-1]+ (WebRtc_Word16)WEBRTC_SPL_MUL_16_16(4, ENH_BLOCKL_HALF)),periodl); @@ -98,7 +96,7 @@ void WebRtcIlbcfix_GetSyncSeq( /* Find the best possible sequence in the 4 times upsampled domain around blockStartPos+q */ - WebRtcIlbcfix_Refiner(iLBCdec_inst, blockStartPos+q, idata, idatal, + WebRtcIlbcfix_Refiner(blockStartPos+q, idata, idatal, centerStartPos,blockStartPos[q],surround,WebRtcIlbcfix_kEnhWt[2*hl-q]); } diff --git a/src/modules/audio_coding/codecs/iLBC/main/source/get_sync_seq.h b/src/modules/audio_coding/codecs/iLBC/main/source/get_sync_seq.h index c2d794583f..a0ffd3922b 100644 --- a/src/modules/audio_coding/codecs/iLBC/main/source/get_sync_seq.h +++ b/src/modules/audio_coding/codecs/iLBC/main/source/get_sync_seq.h @@ -26,8 +26,6 @@ *---------------------------------------------------------------*/ void WebRtcIlbcfix_GetSyncSeq( - iLBC_Dec_Inst_t *iLBCdec_inst, - /* (i) Decoder state */ WebRtc_Word16 *idata, /* (i) original data */ WebRtc_Word16 idatal, /* (i) dimension of data */ WebRtc_Word16 centerStartPos, /* (i) where current block starts */ diff --git a/src/modules/audio_coding/codecs/iLBC/main/source/ilbc.c b/src/modules/audio_coding/codecs/iLBC/main/source/ilbc.c index e479d3e0b7..1f352b455b 100644 --- a/src/modules/audio_coding/codecs/iLBC/main/source/ilbc.c +++ b/src/modules/audio_coding/codecs/iLBC/main/source/ilbc.c @@ -240,8 +240,8 @@ WebRtc_Word16 WebRtcIlbcfix_DecodePlc(iLBC_decinst_t *iLBCdec_inst, WebRtc_Word1 WebRtc_Word16 WebRtcIlbcfix_NetEqPlc(iLBC_decinst_t *iLBCdec_inst, WebRtc_Word16 *decoded, WebRtc_Word16 noOfLostFrames) { /* Two input parameters not used, but needed for function pointers in NetEQ */ - decoded = decoded; - noOfLostFrames = noOfLostFrames; + decoded = NULL; + noOfLostFrames = 0; WebRtcSpl_MemSetW16(((iLBC_Dec_Inst_t*)iLBCdec_inst)->enh_buf, 0, ENH_BUFL); ((iLBC_Dec_Inst_t*)iLBCdec_inst)->prev_enh_pl = 2; diff --git a/src/modules/audio_coding/codecs/iLBC/main/source/lsf_interpolate_to_poly_enc.c b/src/modules/audio_coding/codecs/iLBC/main/source/lsf_interpolate_to_poly_enc.c index dae5780eea..3b0a34dd9b 100644 --- a/src/modules/audio_coding/codecs/iLBC/main/source/lsf_interpolate_to_poly_enc.c +++ b/src/modules/audio_coding/codecs/iLBC/main/source/lsf_interpolate_to_poly_enc.c @@ -26,8 +26,6 @@ *---------------------------------------------------------------*/ void WebRtcIlbcfix_LsfInterpolate2PloyEnc( - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i) the encoder state structure */ WebRtc_Word16 *a, /* (o) lpc coefficients Q12 */ WebRtc_Word16 *lsf1, /* (i) first set of lsf coefficients Q13 */ WebRtc_Word16 *lsf2, /* (i) second set of lsf coefficients Q13 */ @@ -38,8 +36,6 @@ void WebRtcIlbcfix_LsfInterpolate2PloyEnc( /* Stack based */ WebRtc_Word16 lsftmp[LPC_FILTERORDER]; - /* Input parameter not used if not using scratch memory */ - iLBCenc_inst = iLBCenc_inst; /* interpolate LSF */ WebRtcIlbcfix_Interpolate(lsftmp, lsf1, lsf2, coef, length); diff --git a/src/modules/audio_coding/codecs/iLBC/main/source/lsf_interpolate_to_poly_enc.h b/src/modules/audio_coding/codecs/iLBC/main/source/lsf_interpolate_to_poly_enc.h index d83835d1d9..1bbbb8094d 100644 --- a/src/modules/audio_coding/codecs/iLBC/main/source/lsf_interpolate_to_poly_enc.h +++ b/src/modules/audio_coding/codecs/iLBC/main/source/lsf_interpolate_to_poly_enc.h @@ -27,8 +27,6 @@ *---------------------------------------------------------------*/ void WebRtcIlbcfix_LsfInterpolate2PloyEnc( - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i) the encoder state structure */ WebRtc_Word16 *a, /* (o) lpc coefficients Q12 */ WebRtc_Word16 *lsf1, /* (i) first set of lsf coefficients Q13 */ WebRtc_Word16 *lsf2, /* (i) second set of lsf coefficients Q13 */ diff --git a/src/modules/audio_coding/codecs/iLBC/main/source/nearest_neighbor.c b/src/modules/audio_coding/codecs/iLBC/main/source/nearest_neighbor.c index ed79c8ff28..ea9e1ebfe6 100644 --- a/src/modules/audio_coding/codecs/iLBC/main/source/nearest_neighbor.c +++ b/src/modules/audio_coding/codecs/iLBC/main/source/nearest_neighbor.c @@ -25,8 +25,6 @@ *---------------------------------------------------------------*/ void WebRtcIlbcfix_NearestNeighbor( - iLBC_Dec_Inst_t *iLBCdec_inst, - /* (i) Decoder state */ WebRtc_Word16 *index, /* (o) index of array element closest to value */ WebRtc_Word16 *array, /* (i) data array (Q2) */ WebRtc_Word16 value, /* (i) value (Q2) */ @@ -36,8 +34,6 @@ void WebRtcIlbcfix_NearestNeighbor( WebRtc_Word16 diff; /* Stack based */ WebRtc_Word32 crit[8]; - /* The input variable iLBCdec_inst is unused if not using scratch memory */ - iLBCdec_inst = iLBCdec_inst; /* Calculate square distance */ for(i=0;insub; i++) { /* Calculate Analysis/Syntehsis filter from quantized LSF */ - WebRtcIlbcfix_LsfInterpolate2PloyEnc(iLBCenc_inst, lp, lsfdeq, lsfdeq2, - WebRtcIlbcfix_kLsfWeight30ms[i], length); + WebRtcIlbcfix_LsfInterpolate2PloyEnc(lp, lsfdeq, lsfdeq2, + WebRtcIlbcfix_kLsfWeight30ms[i], + length); WEBRTC_SPL_MEMCPY_W16(syntdenum + pos, lp, lp_length); /* Calculate Weighting filter from quantized LSF */ - WebRtcIlbcfix_LsfInterpolate2PloyEnc(iLBCenc_inst, lp, lsf, lsf2, - WebRtcIlbcfix_kLsfWeight30ms[i], length); + WebRtcIlbcfix_LsfInterpolate2PloyEnc(lp, lsf, lsf2, + WebRtcIlbcfix_kLsfWeight30ms[i], + length); WebRtcIlbcfix_BwExpand(weightdenum + pos, lp, - (WebRtc_Word16*)WebRtcIlbcfix_kLpcChirpWeightDenum, (WebRtc_Word16)lp_length); + (WebRtc_Word16*)WebRtcIlbcfix_kLpcChirpWeightDenum, + (WebRtc_Word16)lp_length); pos += lp_length; } @@ -95,15 +103,18 @@ void WebRtcIlbcfix_SimpleInterpolateLsf( for (i = 0; i < iLBCenc_inst->nsub; i++) { /* Calculate Analysis/Syntehsis filter from quantized LSF */ - WebRtcIlbcfix_LsfInterpolate2PloyEnc(iLBCenc_inst, lp, lsfdeqold, lsfdeq, - WebRtcIlbcfix_kLsfWeight20ms[i], length); + WebRtcIlbcfix_LsfInterpolate2PloyEnc(lp, lsfdeqold, lsfdeq, + WebRtcIlbcfix_kLsfWeight20ms[i], + length); WEBRTC_SPL_MEMCPY_W16(syntdenum + pos, lp, lp_length); /* Calculate Weighting filter from quantized LSF */ - WebRtcIlbcfix_LsfInterpolate2PloyEnc(iLBCenc_inst, lp, lsfold, lsf, - WebRtcIlbcfix_kLsfWeight20ms[i], length); + WebRtcIlbcfix_LsfInterpolate2PloyEnc(lp, lsfold, lsf, + WebRtcIlbcfix_kLsfWeight20ms[i], + length); WebRtcIlbcfix_BwExpand(weightdenum+pos, lp, - (WebRtc_Word16*)WebRtcIlbcfix_kLpcChirpWeightDenum, (WebRtc_Word16)lp_length); + (WebRtc_Word16*)WebRtcIlbcfix_kLpcChirpWeightDenum, + (WebRtc_Word16)lp_length); pos += lp_length; } diff --git a/src/modules/audio_coding/codecs/iLBC/main/source/smooth.c b/src/modules/audio_coding/codecs/iLBC/main/source/smooth.c index 207de6d56e..3bbc9a2c80 100644 --- a/src/modules/audio_coding/codecs/iLBC/main/source/smooth.c +++ b/src/modules/audio_coding/codecs/iLBC/main/source/smooth.c @@ -45,7 +45,6 @@ void WebRtcIlbcfix_Smooth( /* compute some inner products (ensure no overflow by first calculating proper scale factor) */ w00 = w10 = w11 = 0; - current=current; max1=WebRtcSpl_MaxAbsValueW16(current, ENH_BLOCKL); max2=WebRtcSpl_MaxAbsValueW16(surround, ENH_BLOCKL);