exc[i]=MULT16_32_Q13(SHL(sgain[0],7),e[2][i])+MULT16_32_Q13(SHL(sgain[1],7),e[1][i])+MULT16_32_Q13(SHL(sgain[2],7),e[0][i]);
exc[i]=SHL(MULT16_32_Q14(SHL(sgain[0],7),e[2][i])+MULT16_32_Q14(SHL(sgain[1],7),e[1][i])+MULT16_32_Q14(SHL(sgain[2],7),e[0][i]),1);
void pitch_unquant_3tap(spx_sig_t exc[],                    /* Excitation */int   start,                    /* Smallest pitch value allowed */int   end,                      /* Largest pitch value allowed */spx_word16_t pitch_coef,               /* Voicing (pitch) coefficient */void *par,int   nsf,                      /* Number of samples in subframe */int *pitch_val,spx_word16_t *gain_val,SpeexBits *bits,char *stack,int count_lost,int subframe_offset,spx_word16_t last_pitch_gain,int cdbk_offset){   int i;   int pitch;   int gain_index;   float gain[3];   signed char *gain_cdbk;   int gain_cdbk_size;   ltp_params *params;#ifdef FIXED_POINT   spx_word16_t sgain[3];#endif   params = (ltp_params*) par;   gain_cdbk_size = 1<<params->gain_bits;   gain_cdbk = params->gain_cdbk + 3*gain_cdbk_size*cdbk_offset;   pitch = speex_bits_unpack_unsigned(bits, params->pitch_bits);   pitch += start;   gain_index = speex_bits_unpack_unsigned(bits, params->gain_bits);   /*printf ("decode pitch: %d %d\n", pitch, gain_index);*/#ifdef FIXED_POINT   sgain[0] = 32+(spx_word16_t)gain_cdbk[gain_index*3];   sgain[1] = 32+(spx_word16_t)gain_cdbk[gain_index*3+1];   sgain[2] = 32+(spx_word16_t)gain_cdbk[gain_index*3+2];#else   gain[0] = 0.015625*gain_cdbk[gain_index*3]+.5;   gain[1] = 0.015625*gain_cdbk[gain_index*3+1]+.5;   gain[2] = 0.015625*gain_cdbk[gain_index*3+2]+.5;#endif   if (count_lost && pitch > subframe_offset)   {      float gain_sum;#ifdef FIXED_POINT      gain[0] = 0.015625*sgain[0];      gain[1] = 0.015625*sgain[1];      gain[2] = 0.015625*sgain[2];#endif      if (1) {	 float tmp = count_lost < 4 ? GAIN_SCALING_1*last_pitch_gain : 0.4 * GAIN_SCALING_1 * last_pitch_gain;         if (tmp>.95)            tmp=.95;         gain_sum = fabs(gain[1]);         if (gain[0]>0)            gain_sum += gain[0];         else            gain_sum -= .5*gain[0];         if (gain[2]>0)            gain_sum += gain[2];         else            gain_sum -= .5*gain[2];	 if (gain_sum > tmp) {	    float fact = tmp/gain_sum;	    for (i=0;i<3;i++)	       gain[i]*=fact;	 }      }      if (0) {      gain_sum = fabs(gain[0])+fabs(gain[1])+fabs(gain[2]);	 if (gain_sum>.95) {         float fact = .95/gain_sum;         for (i=0;i<3;i++)            gain[i]*=fact;      }   }   }   *pitch_val = pitch;   gain_val[0]=sgain[0];   gain_val[1]=sgain[1];   gain_val[2]=sgain[2];   {      spx_sig_t *e[3];      spx_sig_t *tmp2;      tmp2=PUSH(stack, 3*nsf, spx_sig_t);      e[0]=tmp2;      e[1]=tmp2+nsf;      e[2]=tmp2+2*nsf;            for (i=0;i<3;i++)      {         int j;         int pp=pitch+1-i;#if 0         for (j=0;j<nsf;j++)         {            if (j-pp<0)               e[i][j]=exc[j-pp];            else if (j-pp-pitch<0)               e[i][j]=exc[j-pp-pitch];            else               e[i][j]=0;         }#else         {            int tmp1, tmp3;            tmp1=nsf;            if (tmp1>pp)               tmp1=pp;            for (j=0;j<tmp1;j++)               e[i][j]=exc[j-pp];            tmp3=nsf;            if (tmp3>pp+pitch)               tmp3=pp+pitch;            for (j=tmp1;j<tmp3;j++)               e[i][j]=exc[j-pp-pitch];            for (j=tmp3;j<nsf;j++)               e[i][j]=0;         }#endif      }#ifdef FIXED_POINT      {         for (i=0;i<nsf;i++)            exc[i]=MULT16_32_Q13(SHL(sgain[0],7),e[2][i])+MULT16_32_Q13(SHL(sgain[1],7),e[1][i])+MULT16_32_Q13(SHL(sgain[2],7),e[0][i]);      }#else      for (i=0;i<nsf;i++)         exc[i]=gain[0]*e[2][i]+gain[1]*e[1][i]+gain[2]*e[0][i];#endif   }}