ret = nb_decode(st->st_low, bits, st->x0d);
ret = speex_decode(st->st_low, bits, st->x0d);
int sb_decode(void *state, SpeexBits *bits, float *out){   int i, sub;   SBDecState *st;   int wideband;   int ret;   void *stack;   st = (SBDecState*)state;   stack=st->stack;   /* Decode the low-band */   ret = nb_decode(st->st_low, bits, st->x0d);   /* If error decoding the narrowband part, propagate error */   if (ret!=0)   {      return ret;   }   if (!bits)   {      sb_decode_lost(st, out, stack);      return 0;   }   /*Check "wideband bit"*/   wideband = speex_bits_peek(bits);   if (wideband)   {      /*Regular wideband frame, read the submode*/      wideband = speex_bits_unpack_unsigned(bits, 1);      st->submodeID = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS);   } else   {      /*Was a narrowband frame, set "null submode"*/      st->submodeID = 0;   }   for (i=0;i<st->frame_size;i++)      st->exc[i]=0;   /* If null mode (no transmission), just set a couple things to zero*/   if (st->submodes[st->submodeID] == NULL)   {      for (i=0;i<st->frame_size;i++)         st->exc[i]=0;      st->first=1;      /* Final signal synthesis from excitation */      iir_mem2(st->exc, st->interp_qlpc, st->high, st->subframeSize, st->lpcSize, st->mem_sp);      fir_mem_up(st->x0d, h0, st->y0, st->full_frame_size, QMF_ORDER, st->g0_mem, stack);      fir_mem_up(st->high, h1, st->y1, st->full_frame_size, QMF_ORDER, st->g1_mem, stack);      for (i=0;i<st->full_frame_size;i++)         out[i]=2*(st->y0[i]-st->y1[i]);      return 0;   }   SUBMODE(lsp_unquant)(st->qlsp, st->lpcSize, bits);      if (st->first)   {      for (i=0;i<st->lpcSize;i++)         st->old_qlsp[i] = st->qlsp[i];   }      for (sub=0;sub<st->nbSubframes;sub++)   {      float *exc, *sp, tmp, filter_ratio, el=0;      int offset;            offset = st->subframeSize*sub;      sp=st->high+offset;      exc=st->exc+offset;            /* LSP interpolation */      tmp = (1.0 + sub)/st->nbSubframes;      for (i=0;i<st->lpcSize;i++)         st->interp_qlsp[i] = (1-tmp)*st->old_qlsp[i] + tmp*st->qlsp[i];      /* LSPs to x-domain */      for (i=0;i<st->lpcSize;i++)         st->interp_qlsp[i] = cos(st->interp_qlsp[i]);      lsp_enforce_margin(st->interp_qlsp, st->lpcSize, .002);      /* LSP to LPC */      lsp_to_lpc(st->interp_qlsp, st->interp_qlpc, st->lpcSize, stack);      /* Calculate reponse ratio between the low and high filter in the middle         of the band (4000 Hz) */      {         float rl=0, rh=0;         tmp=1;         for (i=0;i<=st->lpcSize;i++)         {            rh += tmp*st->interp_qlpc[i];            tmp = -tmp;         }         rl = ((DecState*)st->st_low)->pi_gain[sub];         rl=1/(fabs(rl)+.01);         rh=1/(fabs(rh)+.01);         filter_ratio=fabs(.01+rh)/(.01+fabs(rl));      }            for (i=0;i<st->subframeSize;i++)         exc[i]=0;      if (!SUBMODE(innovation_unquant))      {         float g;         int quant;         for (i=0;i<st->subframeSize;i++)            el+=sqr(((DecState*)st->st_low)->innov[offset+i]);         quant = speex_bits_unpack_unsigned(bits, 5);         g= exp(((float)quant-27)/8.0);                  /*printf ("unquant folding gain: %f\n", g);*/         g /= filter_ratio;                  /* High-band excitation using the low-band excitation and a gain */         for (i=0;i<st->subframeSize;i++)            exc[i]=.8*g*((DecState*)st->st_low)->innov[offset+i];      } else {         float gc, scale;         int qgc = speex_bits_unpack_unsigned(bits, 4);         for (i=0;i<st->subframeSize;i++)            el+=sqr(((DecState*)st->st_low)->exc[offset+i]);         gc = exp((1/3.7)*qgc-2);         scale = gc*sqrt(1+el)/filter_ratio;         SUBMODE(innovation_unquant)(exc, SUBMODE(innovation_params), st->subframeSize,                                 bits, stack);         for (i=0;i<st->subframeSize;i++)            exc[i]*=scale;         if (SUBMODE(double_codebook)) {            void *tmp_stack=stack;            float *innov2 = PUSH(tmp_stack, st->subframeSize, float);            for (i=0;i<st->subframeSize;i++)               innov2[i]=0;            SUBMODE(innovation_unquant)(innov2, SUBMODE(innovation_params), st->subframeSize,                                 bits, tmp_stack);            for (i=0;i<st->subframeSize;i++)               innov2[i]*=scale*(1/2.5);            for (i=0;i<st->subframeSize;i++)               exc[i] += innov2[i];         }      }      iir_mem2(exc, st->interp_qlpc, sp, st->subframeSize, st->lpcSize, st->mem_sp);   }   fir_mem_up(st->x0d, h0, st->y0, st->full_frame_size, QMF_ORDER, st->g0_mem, stack);   fir_mem_up(st->high, h1, st->y1, st->full_frame_size, QMF_ORDER, st->g1_mem, stack);   for (i=0;i<st->full_frame_size;i++)      out[i]=2*(st->y0[i]-st->y1[i]);   for (i=0;i<st->lpcSize;i++)      st->old_qlsp[i] = st->qlsp[i];   st->first=0;   return 0;}