Make binkaudio work with ff_float_to_int16_interleave_c (martin at martin dot st)
[libav.git] / libavcodec / binkaudio.c
index 7462ab7..5fbc2de 100644 (file)
@@ -125,7 +125,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
         s->coeffs_ptr[i] = s->coeffs + i * s->frame_len;
 
     if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == CODEC_ID_BINKAUDIO_RDFT)
-        ff_rdft_init(&s->trans.rdft, frame_len_bits, IRIDFT);
+        ff_rdft_init(&s->trans.rdft, frame_len_bits, DFT_C2R);
     else if (CONFIG_BINKAUDIO_DCT_DECODER)
         ff_dct_init(&s->trans.dct, frame_len_bits, 1);
     else
@@ -222,6 +222,11 @@ static void decode_block(BinkAudioContext *s, short *out, int use_dct)
             ff_rdft_calc(&s->trans.rdft, coeffs);
     }
 
+    if (s->dsp.float_to_int16_interleave == ff_float_to_int16_interleave_c) {
+        for (i = 0; i < s->channels; i++)
+            for (j = 0; j < s->frame_len; j++)
+                s->coeffs_ptr[i][j] = 385.0 + s->coeffs_ptr[i][j]*(1.0/32767.0);
+    }
     s->dsp.float_to_int16_interleave(out, (const float **)s->coeffs_ptr, s->frame_len, s->channels);
 
     if (!s->first) {