st->buf2 = malloc(st->windowSize*sizeof(float)); st->lpc = malloc((st->lpcSize+1)*sizeof(float)); st->interp_lpc = malloc((st->lpcSize+1)*sizeof(float)); st->bw_lpc = malloc((st->lpcSize+1)*sizeof(float)); st->autocorr = malloc((st->lpcSize+1)*sizeof(float));
void encoder_init(EncState *st){   int i;   /* Codec parameters, should eventually have several "modes"*/   st->frameSize = 160;   st->windowSize = 320;   st->nbSubframes=4;   st->subframeSize=40;   st->lpcSize = 10;   st->bufSize = 640;   st->gamma=.9;   st->inBuf = malloc(st->bufSize*sizeof(float));   st->frame = st->inBuf + st->bufSize - st->windowSize;   st->wBuf = malloc(st->bufSize*sizeof(float));   st->wframe = st->wBuf + st->bufSize - st->windowSize;   st->excBuf = malloc(st->bufSize*sizeof(float));   st->exc_frame = st->excBuf + st->bufSize - st->windowSize;   st->tBuf = malloc(st->bufSize*sizeof(float));   st->tframe = st->tBuf + st->bufSize - st->windowSize;   for (i=0;i<st->bufSize;i++)      st->inBuf[i]=0;   for (i=0;i<st->bufSize;i++)      st->wBuf[i]=0;   for (i=0;i<st->bufSize;i++)      st->excBuf[i]=0;   for (i=0;i<st->bufSize;i++)      st->tBuf[i]=0;   st->window = malloc(st->windowSize*sizeof(float));   /* Hanning window */   for (i=0;i<st->windowSize;i++)      st->window[i]=.5*(1-cos(2*M_PI*i/st->windowSize));   st->buf2 = malloc(st->windowSize*sizeof(float));   st->lpc = malloc((st->lpcSize+1)*sizeof(float));   st->interp_lpc = malloc((st->lpcSize+1)*sizeof(float));   st->bw_lpc = malloc((st->lpcSize+1)*sizeof(float));   st->autocorr = malloc((st->lpcSize+1)*sizeof(float));   /* Create the window for autocorrelation (lag-windowing) */   st->lagWindow = malloc((st->lpcSize+1)*sizeof(float));   for (i=0;i<st->lpcSize+1;i++)      st->lagWindow[i]=exp(-.5*sqr(2*M_PI*.01*i));   st->lsp = malloc(st->lpcSize*sizeof(float));   st->old_lsp = malloc(st->lpcSize*sizeof(float));   st->interp_lsp = malloc(st->lpcSize*sizeof(float));   st->rc = malloc(st->lpcSize*sizeof(float));   st->first = 1;}