[FFmpeg-soc] [soc]: r2769 - amr/amrnbfloatdec.c
superdump
subversion at mplayerhq.hu
Sat Jul 12 22:26:03 CEST 2008
Author: superdump
Date: Sat Jul 12 22:26:03 2008
New Revision: 2769
Log:
- Use previous integer pitch lag for search range calculation
- Update previous integer pitch lag at the end of each frame
Modified:
amr/amrnbfloatdec.c
Modified: amr/amrnbfloatdec.c
==============================================================================
--- amr/amrnbfloatdec.c (original)
+++ amr/amrnbfloatdec.c Sat Jul 12 22:26:03 2008
@@ -1039,6 +1039,9 @@ static void update_state(AMRContext *p)
p->prediction_error[2] = p->prediction_error[3];
p->prediction_error[3] = 20.0*log10f(p->fixed_gain_factor);
+ // update pitch lag history
+ p->prev_pitch_lag_int = p->pitch_lag_int;
+
// update gain history
memmove(&p->pitch_gain[0], &p->pitch_gain[1], 4*sizeof(float));
memmove(&p->fixed_gain[0], &p->fixed_gain[1], 4*sizeof(float));
@@ -1104,7 +1107,7 @@ static int amrnb_decode_frame(AVCodecCon
/*** adaptive code book (pitch) vector decoding ***/
// find the search range
- p->search_range_min = FFMAX(p->pitch_lag_int - 5, p->cur_frame_mode == MODE_122 ? PITCH_LAG_MIN_MODE_122 : PITCH_LAG_MIN);
+ p->search_range_min = FFMAX(p->prev_pitch_lag_int - 5, p->cur_frame_mode == MODE_122 ? PITCH_LAG_MIN_MODE_122 : PITCH_LAG_MIN);
p->search_range_max = p->search_range_min + 9;
if(p->search_range_max > PITCH_LAG_MAX) {
p->search_range_max = PITCH_LAG_MAX;
More information about the FFmpeg-soc
mailing list