- ff_fft_init(&q->fft, 7, 1);
- dsputil_init(&q->dsp, avctx);
+ if (avctx->codec_id == AV_CODEC_ID_IAC) {
+ iac_generate_tabs(q, avctx->sample_rate);
+ } else {
+ memcpy(q->cyclTab, cyclTab, sizeof(cyclTab));
+ memcpy(q->cyclTab2, cyclTab2, sizeof(cyclTab2));
+ memcpy(q->weights1, imc_weights1, sizeof(imc_weights1));
+ memcpy(q->weights2, imc_weights2, sizeof(imc_weights2));
+ }
+
+ if ((ret = ff_fft_init(&q->fft, 7, 1))) {
+ av_log(avctx, AV_LOG_INFO, "FFT init failed\n");
+ return ret;
+ }
+ ff_dsputil_init(&q->dsp, avctx);
+ avpriv_float_dsp_init(&q->fdsp, avctx->flags & CODEC_FLAG_BITEXACT);
+ avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
+ avctx->channel_layout = avctx->channels == 1 ? AV_CH_LAYOUT_MONO
+ : AV_CH_LAYOUT_STEREO;
+
+ avcodec_get_frame_defaults(&q->frame);
+ avctx->coded_frame = &q->frame;
+