float fact;
float tmp;
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];   /* 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 */   /* Perform lag windowing here, equivalent to filtering in the power-spectrum domain */   for (i=0;i<st->lpcSize+1;i++)      st->autocorr[i] *= st->lagWindow[i];   /* Levinson-Durbin */   for (i=0;i<st->lpcSize+1;i++)      printf("%f ", st->autocorr[i]);   printf ("\n");   error = wld(st->lpc+1, st->autocorr, st->rc, st->lpcSize);   st->lpc[0]=1;   for (i=0;i<st->lpcSize+1;i++)      printf("%f ", st->lpc[i]);   printf ("\nprediction error = %f, R[0] = %f, gain = %f\n", error, st->autocorr[0], st->autocorr[0]/error);   /* LPC to LSPs (x-domain) transform */   roots=lpc_to_lsp (st->lpc, st->lpcSize, st->lsp, 6, 0.02);   if (roots!=st->lpcSize)   {      fprintf ("roots!=st->lpcSize\n");      exit(1);   }   for (i=0;i<roots;i++)      printf("%f ", st->lsp[i]);   printf ("\nfound %d roots\n", roots);   /* Quantize LSPs */   for (sub=0;sub<st->nbSubframes;sub++)   {      float fact;      /* LSP interpolation */      fact = (.5 + sub)/st->nbSubframes;      for (i=0;i<st->lpcSize;i++)         st->interp_lsp[i] = (1-fact)*st->old_lsp[i] + fact*st->lsp[i];      /* Compute interpolated LPCs */      lsp_to_lpc(st->interp_lsp, st->interp_lpc, st->lpcSize);      for (i=0;i<st->lpcSize+1;i++)         printf("%f ", st->interp_lpc[i]);      printf ("\n");            /* Compute "weighted" residue */            /* Find pitch */   }   printf ("\n");   for (i=0;i<st->lpcSize;i++)      st->old_lsp[i] = st->lsp[i];   st->first = 0;}