printf ("filter_ratio: %f\n", filter_ratio);
void sb_decode(SBDecState *st, FrameBits *bits, float *out){   int i, sub;   /* Decode the low-band */   decode(&st->st_low, bits, st->x0d);   for (i=0;i<st->frame_size;i++)      st->exc[i]=0;   lsp_unquant_high(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;      int offset;            offset = st->subframeSize*sub;      sp=st->high+offset;      exc=st->exc+offset;            /* LSP interpolation */      tmp = (.5 + 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 to LPC */      lsp_to_lpc(st->interp_qlsp, st->interp_qlpc, st->lpcSize, st->stack);      {         float rl=0, rh=0;         tmp=1;         for (i=0;i<=st->lpcSize;i++)         {            rh += tmp*st->interp_qlpc[i];            tmp = -tmp;         }         rl = st->st_low.pi_gain[sub];         rl=1/(fabs(rl)+.001);         rh=1/(fabs(rh)+.001);         filter_ratio=fabs(.001+rh)/(.001+fabs(rl));         printf ("filter_ratio: %f\n", filter_ratio);      }      {         int k,N=4,el=0;         int *index;         float *gains;         int of;         gains = PUSH(st->stack, N);         index = (int*) PUSH(st->stack, N);         for (i=0;i<st->subframeSize;i++)           el+=sqr(st->st_low.exc[offset+i]);                  for (k=0;k<N;k++)            index[k] = frame_bits_unpack_unsigned(bits,6);         for (k=0;k<N;k++)         {            int sign, gain_ind;            sign = frame_bits_unpack_unsigned(bits,1);            gain_ind = frame_bits_unpack_unsigned(bits,3);            gains[k]=exp(quant_high_gain2[gain_ind])*(1+sqrt(el/st->subframeSize))/filter_ratio;            if (sign)               gains[k] =- gains[k];         }         for (k=0;k<N;k++)         {            of=k*st->subframeSize/N;            for (i=0;i<st->subframeSize/N;i++)               exc[of+i]=gains[k]*stoc[index[k]+i];         }         POP(st->stack);         POP(st->stack);      }      syn_filt_mem(exc, st->interp_qlpc, sp, st->subframeSize, st->lpcSize, st->mem_sp);   }   /* Up-sample coded low-band and high-band*/   for (i=0;i<st->frame_size;i++)   {      st->x0[(i<<1)]=st->x0d[i];      st->x1[(i<<1)]=st->high[i];      st->x0[(i<<1)+1]=0;      st->x1[(i<<1)+1]=0;   }   /* Reconstruct the original */   fir_mem(st->x0, h0, st->y0, st->full_frame_size, QMF_ORDER, st->g0_mem);   fir_mem(st->x1, h1, st->y1, st->full_frame_size, QMF_ORDER, st->g1_mem);   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;}