changeset 2795:de03cac6f7c2 libavcodec

yamaha adpcm nibbles in the wrong order fix by (Vidar Madsen: vidarino, gmail com)
author michael
date Sat, 16 Jul 2005 11:18:42 +0000
parents ed1ab1566353
children 95c35706acbb
files adpcm.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/adpcm.c	Fri Jul 15 06:51:36 2005 +0000
+++ b/adpcm.c	Sat Jul 16 11:18:42 2005 +0000
@@ -406,8 +406,8 @@
         for (; n>0; n--) {
             for(i = 0; i < avctx->channels; i++) {
                 int nibble;
-                nibble  = adpcm_yamaha_compress_sample(&c->status[i], samples[i]) << 4;
-                nibble |= adpcm_yamaha_compress_sample(&c->status[i], samples[i+avctx->channels]);
+                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;
@@ -1047,14 +1047,14 @@
         while (src < buf + buf_size) {
             if (st) {
                 *samples++ = adpcm_yamaha_expand_nibble(&c->status[0],
-                        (src[0] >> 4) & 0x0F);
+                        src[0] & 0x0F);
                 *samples++ = adpcm_yamaha_expand_nibble(&c->status[1],
-                        src[0] & 0x0F);
+                        (src[0] >> 4) & 0x0F);
             } else {
                 *samples++ = adpcm_yamaha_expand_nibble(&c->status[0],
-                        (src[0] >> 4) & 0x0F);
+                        src[0] & 0x0F);
                 *samples++ = adpcm_yamaha_expand_nibble(&c->status[0],
-                        src[0] & 0x0F);
+                        (src[0] >> 4) & 0x0F);
             }
             src++;
         }