st->bounded_pitch = 0;
void *nb_encoder_init(SpeexMode *m){   EncState *st;   SpeexNBMode *mode;   int i;   mode=m->mode;   st = speex_alloc(sizeof(EncState));   st->mode=m;   /* Codec parameters, should eventually have several "modes"*/   st->frameSize = mode->frameSize;   st->windowSize = st->frameSize*3/2;   st->nbSubframes=mode->frameSize/mode->subframeSize;   st->subframeSize=mode->subframeSize;   st->lpcSize = mode->lpcSize;   st->bufSize = mode->bufSize;   st->gamma1=mode->gamma1;   st->gamma2=mode->gamma2;   st->min_pitch=mode->pitchStart;   st->max_pitch=mode->pitchEnd;   st->lag_factor=mode->lag_factor;   st->lpc_floor = mode->lpc_floor;   st->preemph = mode->preemph;     st->submodes=mode->submodes;   st->submodeID=mode->defaultSubmode;   st->pre_mem=0;   st->pre_mem2=0;   /* Allocating input buffer */   st->inBuf = speex_alloc(st->bufSize*sizeof(float));   st->frame = st->inBuf + st->bufSize - st->windowSize;   /* Allocating excitation buffer */   st->excBuf = speex_alloc(st->bufSize*sizeof(float));   st->exc = st->excBuf + st->bufSize - st->windowSize;   st->swBuf = speex_alloc(st->bufSize*sizeof(float));   st->sw = st->swBuf + st->bufSize - st->windowSize;   st->exc2Buf = speex_alloc(st->bufSize*sizeof(float));   st->exc2 = st->exc2Buf + st->bufSize - st->windowSize;   st->innov = speex_alloc(st->frameSize*sizeof(float));   /* Asymetric "pseudo-Hamming" window */   {      int part1, part2;      part1 = st->subframeSize*7/2;      part2 = st->subframeSize*5/2;      st->window = speex_alloc(st->windowSize*sizeof(float));      for (i=0;i<part1;i++)         st->window[i]=.54-.46*cos(M_PI*i/part1);      for (i=0;i<part2;i++)         st->window[part1+i]=.54+.46*cos(M_PI*i/part2);   }   /* Create the window for autocorrelation (lag-windowing) */   st->lagWindow = speex_alloc((st->lpcSize+1)*sizeof(float));   for (i=0;i<st->lpcSize+1;i++)      st->lagWindow[i]=exp(-.5*sqr(2*M_PI*st->lag_factor*i));   st->autocorr = speex_alloc((st->lpcSize+1)*sizeof(float));   st->stack = speex_alloc(20000*sizeof(float));   st->buf2 = speex_alloc(st->windowSize*sizeof(float));   st->lpc = speex_alloc((st->lpcSize+1)*sizeof(float));   st->interp_lpc = speex_alloc((st->lpcSize+1)*sizeof(float));   st->interp_qlpc = speex_alloc((st->lpcSize+1)*sizeof(float));   st->bw_lpc1 = speex_alloc((st->lpcSize+1)*sizeof(float));   st->bw_lpc2 = speex_alloc((st->lpcSize+1)*sizeof(float));   st->lsp = speex_alloc(st->lpcSize*sizeof(float));   st->qlsp = speex_alloc(st->lpcSize*sizeof(float));   st->old_lsp = speex_alloc(st->lpcSize*sizeof(float));   st->old_qlsp = speex_alloc(st->lpcSize*sizeof(float));   st->interp_lsp = speex_alloc(st->lpcSize*sizeof(float));   st->interp_qlsp = speex_alloc(st->lpcSize*sizeof(float));   st->rc = speex_alloc(st->lpcSize*sizeof(float));   st->first = 1;   st->mem_sp = speex_alloc(st->lpcSize*sizeof(float));   st->mem_sw = speex_alloc(st->lpcSize*sizeof(float));   st->mem_sw_whole = speex_alloc(st->lpcSize*sizeof(float));   st->mem_exc = speex_alloc(st->lpcSize*sizeof(float));   st->pi_gain = speex_alloc(st->nbSubframes*sizeof(float));   st->pitch = speex_alloc(st->nbSubframes*sizeof(int));   if (1) {      st->vbr = speex_alloc(sizeof(VBRState));      vbr_init(st->vbr);      st->vbr_quality = 8;      st->vbr_enabled = 0;   } else {      st->vbr = 0;   }   st->complexity=2;   return st;}