summaryrefslogtreecommitdiff
path: root/libavcodec/adpcmenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-08-23 14:23:08 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-08-23 14:33:33 +0200
commit104f42e69485557a7d603047e1d29c44bbd12562 (patch)
treef70179c1693b6fe212ac4090f49ea1ed843f92d4 /libavcodec/adpcmenc.c
parentc2271fa7f9a88afb374300c7320b57b870969926 (diff)
parent7b44061f4be1075eefbc2eec649f38dd0dbfcc82 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: doc/APIchanges: add an entry for codec descriptors. vorbisenc: set AVCodecContext.bit_rate to 0 vorbisenc: fix quality parameter FATE: add ALAC encoding tests lpc: fix alignment of windowed samples for odd maximum LPC order alacenc: use s16p sample format as input alacenc: remove unneeded sample_fmt check alacenc: fix max_frame_size calculation for the final frame adpcm_swf: Use correct sample offsets when using trellis. rtmp: support strict rtmp servers mjpegdec: support AVRn interlaced x86: remove FASTDIV inline asm Conflicts: doc/APIchanges libavcodec/mjpegdec.c libavcodec/vorbisenc.c libavutil/x86/intmath.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/adpcmenc.c')
-rw-r--r--libavcodec/adpcmenc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index 3af81cbc21..a3194abb3c 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -616,10 +616,11 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
if (avctx->trellis > 0) {
FF_ALLOC_OR_GOTO(avctx, buf, 2 * n, error);
- adpcm_compress_trellis(avctx, samples + 2, buf, &c->status[0], n);
+ adpcm_compress_trellis(avctx, samples + avctx->channels, buf,
+ &c->status[0], n);
if (avctx->channels == 2)
- adpcm_compress_trellis(avctx, samples + 3, buf + n,
- &c->status[1], n);
+ adpcm_compress_trellis(avctx, samples + avctx->channels + 1,
+ buf + n, &c->status[1], n);
for (i = 0; i < n; i++) {
put_bits(&pb, 4, buf[i]);
if (avctx->channels == 2)