]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/nellymoserdec.c
Declare WMV1/WMV2/VC-1 decoder dependency on the H.263 decoder in configure.
[ffmpeg] / libavcodec / nellymoserdec.c
index ff70854800401af6abb6c4adbaf986dc454d6633..8ed4298fc2bf4fbba683d967c7a5d3af1bd9c90a 100644 (file)
@@ -38,7 +38,7 @@
 #include "dsputil.h"
 
 #define ALT_BITSTREAM_READER_LE
-#include "bitstream.h"
+#include "get_bits.h"
 
 
 typedef struct NellyMoserDecodeContext {
@@ -50,7 +50,7 @@ typedef struct NellyMoserDecodeContext {
     int             add_bias;
     float           scale_bias;
     DSPContext      dsp;
-    MDCTContext     imdct_ctx;
+    FFTContext      imdct_ctx;
     DECLARE_ALIGNED_16(float,imdct_out[NELLY_BUF_LEN * 2]);
 } NellyMoserDecodeContext;
 
@@ -103,7 +103,7 @@ static void nelly_decode_block(NellyMoserDecodeContext *s,
         aptr = audio + i * NELLY_BUF_LEN;
 
         init_get_bits(&s->gb, block, NELLY_BLOCK_LEN * 8);
-        skip_bits(&s->gb, NELLY_HEADER_BITS + i*NELLY_DETAIL_BITS);
+        skip_bits_long(&s->gb, NELLY_HEADER_BITS + i*NELLY_DETAIL_BITS);
 
         for (j = 0; j < NELLY_FILL_LEN; j++) {
             if (bits[j] <= 0) {
@@ -129,8 +129,8 @@ static av_cold int decode_init(AVCodecContext * avctx) {
     NellyMoserDecodeContext *s = avctx->priv_data;
 
     s->avctx = avctx;
-    av_lfg_init(&s->random_state, ff_random_get_seed());
-    ff_mdct_init(&s->imdct_ctx, 8, 1);
+    av_lfg_init(&s->random_state, 0);
+    ff_mdct_init(&s->imdct_ctx, 8, 1, 1.0);
 
     dsputil_init(&s->dsp, avctx);
 
@@ -153,7 +153,9 @@ static av_cold int decode_init(AVCodecContext * avctx) {
 
 static int decode_tag(AVCodecContext * avctx,
                       void *data, int *data_size,
-                      const uint8_t * buf, int buf_size) {
+                      AVPacket *avpkt) {
+    const uint8_t *buf = avpkt->data;
+    int buf_size = avpkt->size;
     NellyMoserDecodeContext *s = avctx->priv_data;
     int blocks, i;
     int16_t* samples;
@@ -168,6 +170,8 @@ static int decode_tag(AVCodecContext * avctx,
             blocks = 1; break;
         case 128:   // 11025Hz
             blocks = 2; break;
+        case 192:   // 16000Hz
+            blocks = 3; break;
         case 256:   // 22050Hz
             blocks = 4; break;
         case 512:   // 44100Hz