aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/g723_1.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2012-08-02 07:42:44 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2012-08-03 07:07:06 +0200
commit7f92db14f94eed184a4fa725436d0ed44f4327ae (patch)
treefe8c7ca5a918e08348732529e264a1d62d602e2c /libavcodec/g723_1.c
parent3680b2435101a5de56821718a71c828320d535a0 (diff)
downloadffmpeg-7f92db14f94eed184a4fa725436d0ed44f4327ae.tar.gz
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.
Diffstat (limited to 'libavcodec/g723_1.c')
-rw-r--r--libavcodec/g723_1.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c
index df14a46644..11e90e8123 100644
--- a/libavcodec/g723_1.c
+++ b/libavcodec/g723_1.c
@@ -1071,7 +1071,7 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
vector_ptr = p->excitation + PITCH_MAX;
/* 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->sid_gain, &p->cur_gain);
@@ -1086,7 +1086,7 @@ static int g723_1_decode_frame(AVCodecContext *avctx, void *data,
/* Restore the original excitation */
memcpy(p->excitation, p->prev_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 */
if (p->postfilter)