lavu/tx: correctly use a default scale parameter for all transform types

This fixes the previous commit and adds more cases (DCT-I and DST-I).

I am holding off on defining a scale parameter for FFTs as I'd like
to use a complex value for them.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Lynne 2024-02-17 20:50:48 +01:00 committed by Paul B Mahol
parent 43c0ba21ff
commit 22adbc0a28

View File

@ -937,10 +937,12 @@ av_cold int av_tx_init(AVTXContext **ctx, av_tx_fn *tx, enum AVTXType type,
if (!(flags & AV_TX_INPLACE))
flags |= FF_TX_OUT_OF_PLACE;
if (!scale && ((type == AV_TX_FLOAT_MDCT) || (type == AV_TX_INT32_MDCT) || (type == AV_TX_FLOAT_RDFT) || (AV_TX_INT32_RDFT)))
scale = &default_scale_f;
else if (!scale && ((type == AV_TX_DOUBLE_MDCT) || (type == AV_TX_DOUBLE_RDFT)))
if (!scale && ((type == AV_TX_DOUBLE_MDCT) || (type == AV_TX_DOUBLE_DCT) ||
(type == AV_TX_DOUBLE_DCT_I) || (type == AV_TX_DOUBLE_DST_I) ||
(type == AV_TX_DOUBLE_RDFT)))
scale = &default_scale_d;
else if (!scale && !TYPE_IS(FFT, type))
scale = &default_scale_f;
ret = ff_tx_init_subtx(&tmp, type, flags, NULL, len, inv, scale);
if (ret < 0)