summaryrefslogtreecommitdiff
path: root/libavcodec/adpcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r--libavcodec/adpcm.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 8184378a16..4d2146f23a 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -648,14 +648,11 @@ static int adpcm_encode_frame(AVCodecContext *avctx,
*dst++ = buf[0][i] | (buf[1][i] << 4);
}
} else
- for (; n>0; n--) {
- for(i = 0; i < avctx->channels; i++) {
- int nibble;
- nibble = adpcm_yamaha_compress_sample(&c->status[i], samples[i]);
- nibble |= adpcm_yamaha_compress_sample(&c->status[i], samples[i+avctx->channels]) << 4;
- *dst++ = nibble;
- }
- samples += 2 * avctx->channels;
+ for (n *= avctx->channels; n>0; n--) {
+ int nibble;
+ nibble = adpcm_yamaha_compress_sample(&c->status[ 0], *samples++);
+ nibble |= adpcm_yamaha_compress_sample(&c->status[st], *samples++) << 4;
+ *dst++ = nibble;
}
break;
default: