Commit 7f92db14 authored by Kostya Shishkov's avatar Kostya Shishkov

g723_1: save/restore excitation with offset to store LPC history

The same buffer with saved data is used later in LPC reconstruction, so
it should have some head space for LPC history.
parent 3680b243
...@@ -1071,7 +1071,7 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data, ...@@ -1071,7 +1071,7 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
vector_ptr = p->excitation + PITCH_MAX; vector_ptr = p->excitation + PITCH_MAX;
/* Save the excitation */ /* Save the excitation */
memcpy(p->audio, vector_ptr, FRAME_LEN * sizeof(*p->audio)); memcpy(p->audio + LPC_ORDER, vector_ptr, FRAME_LEN * sizeof(*p->audio));
p->interp_index = comp_interp_index(p, p->pitch_lag[1], p->interp_index = comp_interp_index(p, p->pitch_lag[1],
&p->sid_gain, &p->cur_gain); &p->sid_gain, &p->cur_gain);
...@@ -1086,7 +1086,7 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data, ...@@ -1086,7 +1086,7 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
/* Restore the original excitation */ /* Restore the original excitation */
memcpy(p->excitation, p->prev_excitation, memcpy(p->excitation, p->prev_excitation,
PITCH_MAX * sizeof(*p->excitation)); PITCH_MAX * sizeof(*p->excitation));
memcpy(vector_ptr, p->audio, FRAME_LEN * sizeof(*vector_ptr)); memcpy(vector_ptr, p->audio + LPC_ORDER, FRAME_LEN * sizeof(*vector_ptr));
/* Peform pitch postfiltering */ /* Peform pitch postfiltering */
if (p->postfilter) if (p->postfilter)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment