st->mem_sp = PUSH(st->stack, st->lpcSize, float); st->mem_sp2 = PUSH(st->stack, st->lpcSize, float); st->mem_sw = PUSH(st->stack, st->lpcSize, float);
st->mem_sp = PUSH(st->stack, st->lpcSize, spx_mem_t); st->mem_sp2 = PUSH(st->stack, st->lpcSize, spx_mem_t); st->mem_sw = PUSH(st->stack, st->lpcSize, spx_mem_t);
void *sb_encoder_init(SpeexMode *m){   int i;   SBEncState *st;   SpeexSBMode *mode;   st = (SBEncState*)speex_alloc(sizeof(SBEncState)+8000*sizeof(float));   st->mode = m;   mode = (SpeexSBMode*)m->mode;   st->stack = ((char*)st) + sizeof(SBEncState);   st->st_low = speex_encoder_init(mode->nb_mode);   st->full_frame_size = 2*mode->frameSize;   st->frame_size = mode->frameSize;   st->subframeSize = mode->subframeSize;   st->nbSubframes = mode->frameSize/mode->subframeSize;   st->windowSize = st->frame_size*3/2;   st->lpcSize=mode->lpcSize;   st->bufSize=mode->bufSize;   st->encode_submode = 1;   st->submodes=mode->submodes;   st->submodeSelect = st->submodeID=mode->defaultSubmode;      i=9;   speex_encoder_ctl(st->st_low, SPEEX_SET_QUALITY, &i);   st->lag_factor = mode->lag_factor;   st->lpc_floor = mode->lpc_floor;   st->gamma1=mode->gamma1;   st->gamma2=mode->gamma2;   st->first=1;   st->x0d=PUSH(st->stack, st->frame_size, float);   st->x1d=PUSH(st->stack, st->frame_size, float);   st->high=PUSH(st->stack, st->full_frame_size, float);   st->y0=PUSH(st->stack, st->full_frame_size, float);   st->y1=PUSH(st->stack, st->full_frame_size, float);   st->h0_mem=PUSH(st->stack, QMF_ORDER, float);   st->h1_mem=PUSH(st->stack, QMF_ORDER, float);   st->g0_mem=PUSH(st->stack, QMF_ORDER, float);   st->g1_mem=PUSH(st->stack, QMF_ORDER, float);   st->buf=PUSH(st->stack, st->windowSize, float);   st->excBuf=PUSH(st->stack, st->bufSize, float);   st->exc = st->excBuf + st->bufSize - st->windowSize;   st->res=PUSH(st->stack, st->frame_size, float);   st->sw=PUSH(st->stack, st->frame_size, float);   st->target=PUSH(st->stack, st->frame_size, float);   /*Asymmetric "pseudo-Hamming" window*/   {      int part1, part2;      part1 = st->subframeSize*7/2;      part2 = st->subframeSize*5/2;      st->window = PUSH(st->stack, st->windowSize, 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);   }   st->lagWindow = PUSH(st->stack, st->lpcSize+1, float);   for (i=0;i<st->lpcSize+1;i++)      st->lagWindow[i]=exp(-.5*sqr(2*M_PI*st->lag_factor*i));   st->autocorr = PUSH(st->stack, st->lpcSize+1, float);   st->lpc = PUSH(st->stack, st->lpcSize+1, float);   st->bw_lpc1 = PUSH(st->stack, st->lpcSize+1, float);   st->bw_lpc2 = PUSH(st->stack, st->lpcSize+1, float);   st->lsp = PUSH(st->stack, st->lpcSize, float);   st->qlsp = PUSH(st->stack, st->lpcSize, float);   st->old_lsp = PUSH(st->stack, st->lpcSize, float);   st->old_qlsp = PUSH(st->stack, st->lpcSize, float);   st->interp_lsp = PUSH(st->stack, st->lpcSize, float);   st->interp_qlsp = PUSH(st->stack, st->lpcSize, float);   st->interp_lpc = PUSH(st->stack, st->lpcSize+1, float);   st->interp_qlpc = PUSH(st->stack, st->lpcSize+1, float);   st->pi_gain = PUSH(st->stack, st->nbSubframes, float);   st->mem_sp = PUSH(st->stack, st->lpcSize, float);   st->mem_sp2 = PUSH(st->stack, st->lpcSize, float);   st->mem_sw = PUSH(st->stack, st->lpcSize, float);   st->vbr_quality = 8;   st->vbr_enabled = 0;   st->vad_enabled = 0;   st->abr_enabled = 0;   st->relative_quality=0;   st->complexity=2;   speex_decoder_ctl(st->st_low, SPEEX_GET_SAMPLING_RATE, &st->sampling_rate);   st->sampling_rate*=2;   return st;}