From b2bf3cfe322549cdc7bbc1603642ff4137a5e2bb Mon Sep 17 00:00:00 2001 From: Vitor Sessak Date: Sun, 15 Nov 2009 10:41:46 +0000 Subject: Implement ff_decode_pitch_lag() that is used by both AMR and SIPR. Based on code written by Colin McQuillan during his SoC project. Originally committed as revision 20540 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/acelp_pitch_delay.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libavcodec/acelp_pitch_delay.h') diff --git a/libavcodec/acelp_pitch_delay.h b/libavcodec/acelp_pitch_delay.h index 42307d2bba..2413145beb 100644 --- a/libavcodec/acelp_pitch_delay.h +++ b/libavcodec/acelp_pitch_delay.h @@ -234,4 +234,22 @@ float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy, float *prediction_error, float energy_mean, const float *pred_table); + +/** + * Decode the adaptive codebook index to the integer and fractional parts + * of the pitch lag for one subframe at 1/3 fractional precision. + * + * The choice of pitch lag is described in 3GPP TS 26.090 section 5.6.1. + * + * @param lag_int integer part of pitch lag of the current subframe + * @param lag_frac fractional part of pitch lag of the current subframe + * @param pitch_index parsed adaptive codebook (pitch) index + * @param prev_lag_int integer part of pitch lag for the previous subframe + * @param subframe current subframe number + * @param third_as_first treat the third frame the same way as the first + */ +void ff_decode_pitch_lag(int *lag_int, int *lag_frac, int pitch_index, + const int prev_lag_int, const int subframe, + int third_as_first, int resolution); + #endif /* AVCODEC_ACELP_PITCH_DELAY_H */ -- cgit v1.2.3