]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/adpcm.c
Perform the DC prediction reversal immediately after decoding all of
[ffmpeg] / libavcodec / adpcm.c
index 4d2146f23a2b2a9a8c83ea833225deb4f4bd802e..13f20b4293830dcfdc698648d495dc1e58cacc20 100644 (file)
@@ -191,7 +191,6 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
         break;
     default:
         return -1;
-        break;
     }
 
     avctx->coded_frame= avcodec_alloc_frame();
@@ -648,12 +647,12 @@ static int adpcm_encode_frame(AVCodecContext *avctx,
                     *dst++ = buf[0][i] | (buf[1][i] << 4);
             }
         } else
-        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;
-        }
+            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:
         return -1;
@@ -1632,7 +1631,7 @@ AVCodec name ## _encoder = {                    \
     adpcm_encode_frame,                         \
     adpcm_encode_close,                         \
     NULL,                                       \
-    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, \
+    .sample_fmts = (const enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, \
     .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
 };
 #else