summaryrefslogtreecommitdiff
path: root/libavcodec/twinvq.c
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2022-10-29 11:05:06 +0200
committerLynne <dev@lynne.ee>2022-11-06 14:39:33 +0100
commit7af43a46d9c373e3561ea081869663a26047c35a (patch)
treeef3dbd55c7cb3f0026a23b996a7164ac985ecc24 /libavcodec/twinvq.c
parent60c704677aeedada7e70b2afa8676c4973b9e145 (diff)
downloadffmpeg-7af43a46d9c373e3561ea081869663a26047c35a.tar.gz
twinvq: convert to lavu/tx
Diffstat (limited to 'libavcodec/twinvq.c')
-rw-r--r--libavcodec/twinvq.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c
index 3ed053bee2..85eca9fc5c 100644
--- a/libavcodec/twinvq.c
+++ b/libavcodec/twinvq.c
@@ -329,7 +329,8 @@ static const uint8_t wtype_to_wsize[] = { 0, 0, 2, 2, 2, 1, 0, 1, 1 };
static void imdct_and_window(TwinVQContext *tctx, enum TwinVQFrameType ftype,
int wtype, float *in, float *prev, int ch)
{
- FFTContext *mdct = &tctx->mdct_ctx[ftype];
+ AVTXContext *tx = tctx->tx[ftype];
+ av_tx_fn tx_fn = tctx->tx_fn[ftype];
const TwinVQModeTab *mtab = tctx->mtab;
int bsize = mtab->size / mtab->fmode[ftype].sub;
int size = mtab->size;
@@ -358,7 +359,7 @@ static void imdct_and_window(TwinVQContext *tctx, enum TwinVQFrameType ftype,
wsize = types_sizes[wtype_to_wsize[sub_wtype]];
- mdct->imdct_half(mdct, buf1 + bsize * j, in + bsize * j);
+ tx_fn(tx, buf1 + bsize * j, in + bsize * j, sizeof(float));
tctx->fdsp->vector_fmul_window(out2, prev_buf + (bsize - wsize) / 2,
buf1 + bsize * j,
@@ -544,8 +545,9 @@ static av_cold int init_mdct_win(TwinVQContext *tctx)
for (i = 0; i < 3; i++) {
int bsize = tctx->mtab->size / tctx->mtab->fmode[i].sub;
- if ((ret = ff_mdct_init(&tctx->mdct_ctx[i], av_log2(bsize) + 1, 1,
- -sqrt(norm / bsize) / (1 << 15))))
+ const float scale = -sqrt(norm / bsize) / (1 << 15);
+ if ((ret = av_tx_init(&tctx->tx[i], &tctx->tx_fn[i], AV_TX_FLOAT_MDCT,
+ 1, bsize, &scale, 0)))
return ret;
}
@@ -746,7 +748,7 @@ av_cold int ff_twinvq_decode_close(AVCodecContext *avctx)
int i;
for (i = 0; i < 3; i++) {
- ff_mdct_end(&tctx->mdct_ctx[i]);
+ av_tx_uninit(&tctx->tx[i]);
av_freep(&tctx->cos_tabs[i]);
}