target=st->exc+offset;
target=st->tframe+offset;
void encode(EncState *st, float *in, int *outSize, void *bits){   int i, j, sub, roots;   float error;   /* Copy new data in input buffer */   memmove(st->inBuf, st->inBuf+st->frameSize, (st->bufSize-st->frameSize)*sizeof(float));   for (i=0;i<st->frameSize;i++)      st->inBuf[st->bufSize-st->frameSize+i] = in[i];   memmove(st->wBuf, st->wBuf+st->frameSize, (st->bufSize-st->frameSize)*sizeof(float));   memmove(st->resBuf, st->resBuf+st->frameSize, (st->bufSize-st->frameSize)*sizeof(float));   memmove(st->excBuf, st->excBuf+st->frameSize, (st->bufSize-st->frameSize)*sizeof(float));   memmove(st->tBuf, st->tBuf+st->frameSize, (st->bufSize-st->frameSize)*sizeof(float));   /* Window for analysis */   for (i=0;i<st->windowSize;i++)      st->buf2[i] = st->frame[i] * st->window[i];   /* Compute auto-correlation */   autocorr(st->buf2, st->autocorr, st->lpcSize+1, st->windowSize);   st->autocorr[0] += 1;        /* prevents NANs */   st->autocorr[0] *= 1.0001;   /* 40 dB noise floor */   /* Lag windowing: equivalent to filtering in the power-spectrum domain */   for (i=0;i<st->lpcSize+1;i++)      st->autocorr[i] *= st->lagWindow[i];   /* Levinson-Durbin */   error = wld(st->lpc+1, st->autocorr, st->rc, st->lpcSize);   st->lpc[0]=1;   /* LPC to LSPs (x-domain) transform */   roots=lpc_to_lsp (st->lpc, st->lpcSize, st->lsp, 6, 0.02);   if (roots!=st->lpcSize)   {      fprintf (stderr, "roots!=st->lpcSize\n");      exit(1);   }   /* x-domain to angle domain*/   for (i=0;i<st->lpcSize;i++)      st->lsp[i] = acos(st->lsp[i]);      /* LSP Quantization */   {      unsigned int id;      for (i=0;i<st->lpcSize;i++)         st->buf2[i]=st->lsp[i];      id=lsp_quant_nb(st->buf2,10 );      lsp_unquant_nb(st->qlsp,10,id);   }   /* Loop on sub-frames */   for (sub=0;sub<st->nbSubframes;sub++)   {      float tmp, tmp1,tmp2,gain[3];      int pitch, offset;      float *sp, *sw, *res, *exc, *target;            /* Offset relative to start of frame */      offset = st->subframeSize*sub;      sp=st->frame+offset;      sw=st->wframe+offset;      res=st->res+offset;      exc=st->exc+offset;      target=st->exc+offset;      /* LSP interpolation (quantized and unquantized) */      tmp = (.5 + sub)/st->nbSubframes;      for (i=0;i<st->lpcSize;i++)         st->interp_lsp[i] = (1-tmp)*st->old_lsp[i] + tmp*st->lsp[i];      for (i=0;i<st->lpcSize;i++)         st->interp_qlsp[i] = (1-tmp)*st->old_qlsp[i] + tmp*st->qlsp[i];      /* Compute interpolated LPCs (quantized and unquantized) */      for (i=0;i<st->lpcSize;i++)         st->interp_lsp[i] = cos(st->interp_lsp[i]);      lsp_to_lpc(st->interp_lsp, st->interp_lpc, st->lpcSize);      for (i=0;i<st->lpcSize;i++)         st->interp_qlsp[i] = cos(st->interp_qlsp[i]);      lsp_to_lpc(st->interp_qlsp, st->interp_qlpc, st->lpcSize);      /* Compute bandwidth-expanded (unquantized) LPCs for perceptual weighting */      tmp=1;      for (i=0;i<st->lpcSize+1;i++)      {         st->bw_lpc1[i] = tmp * st->interp_lpc[i];         tmp *= st->gamma1;      }      tmp=1;      for (i=0;i<st->lpcSize+1;i++)      {         st->bw_lpc2[i] = tmp * st->interp_lpc[i];         tmp *= st->gamma2;      }      /* Compute residue */      /*residue(sp, st->interp_qlpc, res, st->subframeSize, st->lpcSize);*/            /* Reset excitation */      for (i=0;i<st->subframeSize;i++)         exc[i]=0;      /* Compute zero response of A(z/g1) / ( A(z/g2) * Aq(z) ) */      residue(exc, st->bw_lpc1, exc, st->subframeSize, st->lpcSize);      syn_filt_mem(exc, st->interp_qlpc, res, st->subframeSize, st->lpcSize, st->mem3);      syn_filt_mem(exc, st->bw_lpc2, exc, st->subframeSize, st->lpcSize, st->mem4);      /* Compute weighted signal */      residue_mem(sp, st->bw_lpc1, sw, st->subframeSize, st->lpcSize, st->mem1);      for (i=0;i<st->lpcSize;i++)        st->mem3[i]=sw[st->subframeSize-i-1];      syn_filt_mem(sw, st->bw_lpc2, sw, st->subframeSize, st->lpcSize, st->mem2);      for (i=0;i<st->lpcSize;i++)        st->mem4[i]=sw[st->subframeSize-i-1];      /* Compute target signal */      for (i=0;i<st->subframeSize;i++)         target[i]=sw[i]-res[i];#if 1      /* Perform adaptive codebook search (pitch prediction) */      overlap_cb_search(target, st->interp_qlpc, st->bw_lpc1, st->bw_lpc2,                        &exc[-120], 100, &gain[0], &pitch, st->lpcSize,                        st->subframeSize);      printf ("gain = %f, pitch = %d\n",gain[0], 120-pitch);#endif      /* Update target for adaptive codebook contribution */      /* Perform stochastic codebook search */      residue_zero(target, st->interp_qlpc, exc, st->subframeSize, st->lpcSize);      residue_zero(target, st->bw_lpc2, exc, st->subframeSize, st->lpcSize);      syn_filt_zero(exc, st->bw_lpc1, exc, st->subframeSize, st->lpcSize);      /* Final signal synthesis from excitation */      syn_filt_mem(exc, st->interp_qlpc, sp, st->subframeSize, st->lpcSize, st->mem5);   }   /* Store the LSPs for interpolation in the next frame */   for (i=0;i<st->lpcSize;i++)      st->old_lsp[i] = st->lsp[i];   for (i=0;i<st->lpcSize;i++)      st->old_qlsp[i] = st->qlsp[i];   /* The next frame will not by the first (Duh!) */   st->first = 0;   /* Replace input by synthesized speech */   for (i=0;i<st->frameSize;i++)     in[i]=st->frame[i];}