diff options
author | Lynne <dev@lynne.ee> | 2022-11-01 08:45:27 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2022-11-06 14:39:39 +0100 |
commit | 978963a77b27d52000f83c647ef46b6d0c390326 (patch) | |
tree | 41c0d775508b5d534ac69f3ab51819695c328f13 /libavcodec/wmaenc.c | |
parent | 6ba0aa1770ba29eb4126c6a706f6b0cd3809648f (diff) | |
download | ffmpeg-978963a77b27d52000f83c647ef46b6d0c390326.tar.gz |
wma: convert to lavu/tx
Converts both the decoder and encoders.
Diffstat (limited to 'libavcodec/wmaenc.c')
-rw-r--r-- | libavcodec/wmaenc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c index 90bb6949cb..2c647af13b 100644 --- a/libavcodec/wmaenc.c +++ b/libavcodec/wmaenc.c @@ -92,7 +92,9 @@ static av_cold int encode_init(AVCodecContext *avctx) /* init MDCT */ for (i = 0; i < s->nb_block_sizes; i++) { - ret = ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 0, 1.0); + float scale = 1.0f; + ret = av_tx_init(&s->mdct_ctx[i], &s->mdct_fn[i], AV_TX_FLOAT_MDCT, + 0, 1 << (s->frame_len_bits - i), &scale, 0); if (ret < 0) return ret; } @@ -112,7 +114,8 @@ static int apply_window_and_mdct(AVCodecContext *avctx, const AVFrame *frame) const float *const *audio = (const float *const *) frame->extended_data; int len = frame->nb_samples; int window_index = s->frame_len_bits - s->block_len_bits; - FFTContext *mdct = &s->mdct_ctx[window_index]; + AVTXContext *mdct = s->mdct_ctx[window_index]; + av_tx_fn mdct_fn = s->mdct_fn[window_index]; int ch; const float *win = s->windows[window_index]; int window_len = 1 << s->block_len_bits; @@ -124,7 +127,7 @@ static int apply_window_and_mdct(AVCodecContext *avctx, const AVFrame *frame) s->fdsp->vector_fmul_reverse(&s->output[window_len], s->frame_out[ch], win, len); s->fdsp->vector_fmul(s->frame_out[ch], s->frame_out[ch], win, len); - mdct->mdct_calc(mdct, s->coefs[ch], s->output); + mdct_fn(mdct, s->coefs[ch], s->output, sizeof(float)); if (!isfinite(s->coefs[ch][0])) { av_log(avctx, AV_LOG_ERROR, "Input contains NaN/+-Inf\n"); return AVERROR(EINVAL); |