aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Caldwell <saintdev@gmail.com>2012-01-27 22:23:40 -0700
committerMichael Niedermayer <michaelni@gmx.at>2012-03-16 06:29:10 +0100
commit43625c5128af5287e89c81566b48dfd1e6acb499 (patch)
treed058d2aa3eec53fbb3bde8d6d1c998b512ac1a04
parent9f82cbf7c11b2eca98a38fc9f1ca3a2ba1066a36 (diff)
downloadffmpeg-43625c5128af5287e89c81566b48dfd1e6acb499.tar.gz
aacenc: Fix a bug where deinterleaved samples were stored in the wrong place.
10l: Forgot to adjust deinterleave for new location of incoming samples in 7946a5a. This produced incorrect, but surprisingly listenable results. Thanks to Justin Ruggles for the report. Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commit dc7e7d4dd96eebd430e7bfa847b751add0e126ab) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/aacenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 55f028687c..e507a34de6 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -487,10 +487,10 @@ static void deinterleave_input_samples(AACEncContext *s,
const float *sptr = samples + channel_map[ch];
/* copy last 1024 samples of previous frame to the start of the current frame */
- memcpy(&s->planar_samples[ch][0], &s->planar_samples[ch][1024], 1024 * sizeof(s->planar_samples[0][0]));
+ memcpy(&s->planar_samples[ch][1024], &s->planar_samples[ch][2048], 1024 * sizeof(s->planar_samples[0][0]));
/* deinterleave */
- for (i = 1024; i < 1024 * 2; i++) {
+ for (i = 2048; i < 3072; i++) {
s->planar_samples[ch][i] = *sptr;
sptr += sinc;
}