/** * Calculate the pitch vector by interpolating the past excitation at the pitch * pitch lag using a b60 hamming windowed sinc function * * @param p pointer to the AMRContext * @param lag_int integer part of pitch lag * @param lag_frac fractional part of pitch lag * * @return void */ static void interp_pitch_vector(AMRContext *p, int lag_int, int lag_frac) { int n, i; float *b60_idx1, *b60_idx2, *exc_idx; lag_frac *= -1; if(p->cur_frame_mode != MODE_122) { lag_frac <<= 1; } if(lag_frac < 0) { lag_frac += 6; lag_int--; } b60_idx1 = &b60[ lag_frac]; b60_idx2 = &b60[6 - lag_frac]; exc_idx = &p->prev_excitation[-lag_int]; for(n=0; npitch_vector[n] += b60_idx1[6*i] * exc_idx[-i]; } exc_idx++; for(i=0; i<10; i++) { p->pitch_vector[n] += b60_idx2[6*i] * exc_idx[ i]; } exc_idx++; } }