diff mbox series

[FFmpeg-devel] lavu/tx: correctly use a default scale parameter for all transform types

Message ID NqscNrG--3-9@lynne.ee
State New
Headers show
Series [FFmpeg-devel] lavu/tx: correctly use a default scale parameter for all transform types | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Lynne Feb. 17, 2024, 7:53 p.m. UTC
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.

Patch attached.

Comments

Lynne Feb. 18, 2024, 3:23 p.m. UTC | #1
Feb 17, 2024, 20:53 by dev@lynne.ee:

> 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.
>
> Patch attached.
>

Pushed mine, which also added D(C/S)Ts.
diff mbox series

Patch

From 5b58ac6995cd52c3d61d46f5d4eca42a686752b7 Mon Sep 17 00:00:00 2001
From: Lynne <dev@lynne.ee>
Date: Sat, 17 Feb 2024 20:50:48 +0100
Subject: [PATCH] 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.
---
 libavutil/tx.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavutil/tx.c b/libavutil/tx.c
index cc360cff31..f991618b4b 100644
--- a/libavutil/tx.c
+++ b/libavutil/tx.c
@@ -914,10 +914,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)
-- 
2.43.0.381.gb435a96ce8