void Excitation_Signal_Update(Ipp16s *etpast, Ipp16s *et, Ipp16s nlset) { Ipp32s i, aa0; Ipp16s nrs; for(i=-KPMAX; i<-IDIM; i++) etpast[i] = etpast[i+IDIM]; nrs = nlset - 2; if (nrs >= 0) { for(i=0; i<IDIM; i++) { aa0 = ShiftR_32s(et[i], nrs); etpast[i-IDIM] = Cnvrt_32s16s(aa0); } } else { nrs = -nrs; for(i=0; i<IDIM; i++) { aa0 = et[i]; aa0 = aa0 << nrs; etpast[i-IDIM] = Cnvrt_32s16s(aa0); } } return; }
void VQ_target_vector_calc(Ipp16s *sw, Ipp16s *zir, Ipp16s *target) { Ipp32s k, aa0; for(k=0; k<IDIM; k++) { aa0 = sw[k] - zir[k]; /* Clip if necessary*/ target[k] = Cnvrt_32s16s(aa0); } return; }
void Time_reversed_conv(Ipp16s *h, Ipp16s *target, Ipp16s nlstarget, Ipp16s *pn) { Ipp32s k, j, aa0; for(k=0; k<IDIM; k++) { aa0 = 0; for(j=k; j<IDIM; j++) { aa0 = aa0 + target[j]*h[j-k]; } aa0 = aa0 >> (13 + (nlstarget - 7)); pn[k] = Cnvrt_32s16s(aa0); } return; }
void Excitation_signal_extrapolation(Ipp16s voiced, Ipp16s *fedelay, Ipp16s fescale, Ipp16s nlsfescale, Ipp16s* etpast, Ipp16s *et, Ipp16s *nlset, Ipp16s *seed) { Ipp16s temp, nlstemp,den,nlsden,nls; Ipp32s i, aa0, aa1; if(voiced == G728_TRUE) { temp = fescale; nlstemp = 15; for(i=0; i<IDIM; i++) etpast[i] = etpast[i-(*fedelay)]; /* nlstemp = 15;*/ } if(voiced == G728_FALSE) { *fedelay = Rand_G728_16s(seed); aa1 = 0; for(i=0; i<IDIM; i++) { etpast[i] = etpast[i-(*fedelay)]; aa1 = aa1 + Abs_32s(etpast[i]); } if((aa1==0)||(fescale==0)) { temp = 0; nlstemp = 15; } else { Vscale_32s(&aa1, 1, 1, 30, &aa1, &nlsden); den = Cnvrt_NR_32s16s(aa1); nlsden = nlsden - 16; Divide(fescale, nlsfescale, den, nlsden, &temp, &nlstemp); } } for(i=0; i<IDIM; i++) { aa0 = temp * etpast[i]; aa0 = ShiftR_32s(aa0, nlstemp); aa0 = Cnvrt_32s16s(aa0); etpast[i] = aa0; } Vscale_16s(etpast, IDIM, IDIM, 13, et, &nls); *nlset = nls + 2; return; }
void ExcitationSignalExtrapolation(Ipp16s voiced, Ipp16s *fedelay, Ipp16s fescale, Ipp16s nlsfescale, Ipp16s* etpast, Ipp16s *et, Ipp16s *nlset, Ipp16s *seed) { Ipp16s temp = fescale, nlstemp = 15,den,nlsden,nls; Ipp32s i, aa0, aa1; if(voiced == G728_TRUE) { for(i=0; i<IDIM; i++) etpast[i] = etpast[i-(*fedelay)]; /* nlstemp = 15;*/ } if(voiced == G728_FALSE) { *fedelay = Rand_G728_16s(seed); aa1 = 0; for(i=0; i<IDIM; i++) { etpast[i] = etpast[i-(*fedelay)]; aa1 = aa1 + Abs_32s(etpast[i]); } if((aa1==0)||(fescale==0)) { temp = 0; nlstemp = 15; } else { VscaleOne_Range30_32s(&aa1, &aa1, &nlsden); den = Cnvrt_NR_32s16s(aa1); nlsden = (Ipp16s)(nlsden - 16); Divide_16s(fescale, nlsfescale, den, nlsden, &temp, &nlstemp); } } for(i=0; i<IDIM; i++) { aa0 = temp * etpast[i]; aa0 = aa0 >> nlstemp; aa0 = Cnvrt_32s16s(aa0); etpast[i] = (Ipp16s)aa0; } VscaleFive_16s(etpast, et, 13, &nls); *nlset = (Ipp16s)(nls + 2); return; }