]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/adpcm.c
Move shared tables to aactab.c and add declarations to aactab.h. Also sync with
[ffmpeg] / libavcodec / adpcm.c
index 0e5160424ba5050e93c425574e2ae7b6523c64bc..c4fb3eeb6d81e90d0652dcdc7f3132ac55d72ae2 100644 (file)
@@ -563,7 +563,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx,
         //Init the encoder state
         for(i=0; i<avctx->channels; i++){
             c->status[i].step_index = av_clip(c->status[i].step_index, 0, 63); // clip step so it fits 6 bits
-            put_bits(&pb, 16, samples[i] & 0xFFFF);
+            put_sbits(&pb, 16, samples[i]);
             put_bits(&pb, 6, c->status[i].step_index);
             c->status[i].prev_sample = (signed short)samples[i];
         }
@@ -698,6 +698,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
     default:
         break;
     }
+    avctx->sample_fmt = SAMPLE_FMT_S16;
     return 0;
 }
 
@@ -1599,6 +1600,7 @@ AVCodec name ## _encoder = {                    \
     adpcm_encode_frame,                         \
     adpcm_encode_close,                         \
     NULL,                                       \
+    .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, \
     .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
 };
 #else