git-svn-id: http://webrtc.googlecode.com/svn/trunk@461 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
turajs@google.com 2011-08-26 16:02:16 +00:00
parent 7659b366ac
commit ac55f7b33c
14 changed files with 35 additions and 51 deletions

View File

@ -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 */

View File

@ -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 */

View File

@ -334,7 +334,7 @@ int WebRtcIlbcfix_EnhancerInterface( /* (o) Estimated lag in end of in[] */
/* Perform enhancement block by block */
for (iblock = 0; iblock<new_blocks; iblock++) {
WebRtcIlbcfix_Enhancer(iLBCdec_inst, out+WEBRTC_SPL_MUL_16_16(iblock, ENH_BLOCKL), enh_buf,
WebRtcIlbcfix_Enhancer(out+WEBRTC_SPL_MUL_16_16(iblock, ENH_BLOCKL), enh_buf,
ENH_BUFL, (WebRtc_Word16)(WEBRTC_SPL_MUL_16_16(iblock, ENH_BLOCKL)+startPos),
enh_period, (WebRtc_Word16*)WebRtcIlbcfix_kEnhPlocs, ENH_NBLOCKS_TOT);
}

View File

@ -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 */
@ -48,7 +46,7 @@ void WebRtcIlbcfix_GetSyncSeq(
/* present (find predicted lag from this position) */
WebRtcIlbcfix_NearestNeighbor(iLBCdec_inst, lagBlock+hl,plocs,
WebRtcIlbcfix_NearestNeighbor(lagBlock+hl,plocs,
(WebRtc_Word16)WEBRTC_SPL_MUL_16_16(2, (centerStartPos+centerEndPos)),
periodl);
@ -60,7 +58,7 @@ void WebRtcIlbcfix_GetSyncSeq(
for(q=hl-1;q>=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]);
}

View File

@ -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 */

View File

@ -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;

View File

@ -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);

View File

@ -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 */

View File

@ -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;i<arlength;i++){

View File

@ -28,8 +28,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) */

View File

@ -30,8 +30,6 @@
*---------------------------------------------------------------*/
void WebRtcIlbcfix_Refiner(
iLBC_Dec_Inst_t *iLBCdec_inst,
/* (i) Decoder state */
WebRtc_Word16 *updStartPos, /* (o) updated start point (Q-2) */
WebRtc_Word16 *idata, /* (i) original data buffer */
WebRtc_Word16 idatal, /* (i) dimension of idata */
@ -53,9 +51,6 @@ void WebRtcIlbcfix_Refiner(
WebRtc_Word16 vect[ENH_VECTL];
WebRtc_Word16 corrVec[ENH_CORRDIM];
/* The input parameter iLBCdec_inst is unused unless using scratch memory */
iLBCdec_inst = iLBCdec_inst;
/* defining array bounds */
estSegPosRounded=WEBRTC_SPL_RSHIFT_W16((estSegPos - 2),2);

View File

@ -30,8 +30,6 @@
*---------------------------------------------------------------*/
void WebRtcIlbcfix_Refiner(
iLBC_Dec_Inst_t *iLBCdec_inst,
/* (i) Decoder state */
WebRtc_Word16 *updStartPos, /* (o) updated start point (Q-2) */
WebRtc_Word16 *idata, /* (i) original data buffer */
WebRtc_Word16 idatal, /* (i) dimension of idata */

View File

@ -57,13 +57,18 @@ void WebRtcIlbcfix_SimpleInterpolateLsf(
lsf coefficients */
/* Calculate Analysis/Syntehsis filter from quantized LSF */
WebRtcIlbcfix_LsfInterpolate2PloyEnc(iLBCenc_inst, lp, lsfdeqold, lsfdeq,
WebRtcIlbcfix_kLsfWeight30ms[0], length);
WebRtcIlbcfix_LsfInterpolate2PloyEnc(lp, lsfdeqold, lsfdeq,
WebRtcIlbcfix_kLsfWeight30ms[0],
length);
WEBRTC_SPL_MEMCPY_W16(syntdenum, lp, lp_length);
/* Calculate Weighting filter from quantized LSF */
WebRtcIlbcfix_LsfInterpolate2PloyEnc(iLBCenc_inst, lp, lsfold, lsf, WebRtcIlbcfix_kLsfWeight30ms[0], length);
WebRtcIlbcfix_BwExpand(weightdenum, lp, (WebRtc_Word16*)WebRtcIlbcfix_kLpcChirpWeightDenum, (WebRtc_Word16)lp_length);
WebRtcIlbcfix_LsfInterpolate2PloyEnc(lp, lsfold, lsf,
WebRtcIlbcfix_kLsfWeight30ms[0],
length);
WebRtcIlbcfix_BwExpand(weightdenum, lp,
(WebRtc_Word16*)WebRtcIlbcfix_kLpcChirpWeightDenum,
(WebRtc_Word16)lp_length);
/* subframe 2 to 6: Interpolation between first and second
set of lsf coefficients */
@ -72,15 +77,18 @@ void WebRtcIlbcfix_SimpleInterpolateLsf(
for (i = 1; i < iLBCenc_inst->nsub; 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;
}

View File

@ -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);