if (pitch_gain>48) pitch_gain = 48;
if (pitch_gain>54) pitch_gain = 54;
static void nb_decode_lost(DecState *st, spx_word16_t *out, char *stack){   int i, sub;   int pitch_val;   VARDECL(spx_coef_t *awk1);   VARDECL(spx_coef_t *awk2);   VARDECL(spx_coef_t *awk3);   spx_word16_t pitch_gain;   spx_word16_t fact;   spx_word16_t gain_med;   spx_word16_t innov_gain;      if (st->count_lost<10)      fact = attenuation[st->count_lost];   else      fact = 0;   gain_med = median3(st->pitch_gain_buf[0], st->pitch_gain_buf[1], st->pitch_gain_buf[2]);   if (gain_med < st->last_pitch_gain)      st->last_pitch_gain = gain_med;   #ifdef FIXED_POINT   pitch_gain = st->last_pitch_gain;   if (pitch_gain>48)      pitch_gain = 48;   pitch_gain = SHL(pitch_gain, 9);#else      pitch_gain = GAIN_SCALING_1*st->last_pitch_gain;   if (pitch_gain>.75)      pitch_gain=.75;#endif   pitch_gain = MULT16_16_Q15(fact,pitch_gain) + VERY_SMALL;   /* Shift all buffers by one frame */   /*speex_move(st->inBuf, st->inBuf+st->frameSize, (st->bufSize-st->frameSize)*sizeof(spx_sig_t));*/   speex_move(st->excBuf, st->excBuf+st->frameSize, (st->max_pitch + 1)*sizeof(spx_sig_t));   ALLOC(awk1, (st->lpcSize+1), spx_coef_t);   ALLOC(awk2, (st->lpcSize+1), spx_coef_t);   ALLOC(awk3, (st->lpcSize+1), spx_coef_t);   for (sub=0;sub<st->nbSubframes;sub++)   {      int offset;      spx_sig_t *sp, *exc;      /* Offset relative to start of frame */      offset = st->subframeSize*sub;      /* Original signal */      sp=st->frame+offset;      /* Excitation */      exc=st->exc+offset;      /* Excitation after post-filter*/      /* Calculate perceptually enhanced LPC filter */      if (st->lpc_enh_enabled)      {         spx_word16_t k1,k2,k3;         if (st->submodes[st->submodeID] != NULL)         {            k1=SUBMODE(lpc_enh_k1);            k2=SUBMODE(lpc_enh_k2);            k3=SUBMODE(lpc_enh_k3);         } else {            k1=k2=.7*GAMMA_SCALING;            k3=.0;         }         bw_lpc(k1, st->interp_qlpc, awk1, st->lpcSize);         bw_lpc(k2, st->interp_qlpc, awk2, st->lpcSize);         bw_lpc(k3, st->interp_qlpc, awk3, st->lpcSize);      }              /* Make up a plausible excitation */      /* FIXME: THIS CAN BE IMPROVED */      /*if (pitch_gain>.95)        pitch_gain=.95;*/      innov_gain = compute_rms(st->innov, st->frameSize);      pitch_val = st->last_pitch + SHR32((spx_int32_t)speex_rand(1+st->count_lost, &st->seed),SIG_SHIFT);      if (pitch_val > st->max_pitch)         pitch_val = st->max_pitch;      for (i=0;i<st->subframeSize;i++)      {         exc[i]= MULT16_32_Q15(pitch_gain, (exc[i-pitch_val]+VERY_SMALL)) +                MULT16_32_Q15(fact, MULT16_32_Q15(SHL(Q15ONE,15)-SHL(MULT16_16(pitch_gain,pitch_gain),1),speex_rand(innov_gain, &st->seed)));      }            for (i=0;i<st->subframeSize;i++)         sp[i]=exc[i];            /* Signal synthesis */      if (st->lpc_enh_enabled)      {         filter_mem2(sp, awk2, awk1, sp, st->subframeSize, st->lpcSize,                      st->mem_sp+st->lpcSize);         filter_mem2(sp, awk3, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,                      st->mem_sp);      } else {         for (i=0;i<st->lpcSize;i++)            st->mem_sp[st->lpcSize+i] = 0;         iir_mem2(sp, st->interp_qlpc, sp, st->subframeSize, st->lpcSize,                      st->mem_sp);      }         }   for (i=0;i<st->frameSize;i++)   {      spx_word32_t sig = PSHR32(st->frame[i],SIG_SHIFT);      if (sig>32767)         sig = 32767;      if (sig<-32767)         sig = -32767;     out[i]=sig;   }      st->first = 0;   st->count_lost++;   st->pitch_gain_buf[st->pitch_gain_buf_idx++] = PSHR(pitch_gain,9);   if (st->pitch_gain_buf_idx > 2) /* rollover */      st->pitch_gain_buf_idx = 0;}