[FFmpeg-cvslog] lavu/tx: support out-of-place transforms in fft_inplace

Lynne git at videolan.org
Thu Nov 24 16:59:20 EET 2022


ffmpeg | branch: master | Lynne <dev at lynne.ee> | Thu Nov 17 20:06:43 2022 +0100| [fff3e1d8489ee83949f67faba8908755846a6f4f] | committer: Lynne

lavu/tx: support out-of-place transforms in fft_inplace

This makes testing easier, as a unified path can be used for in/out of
place transforms.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fff3e1d8489ee83949f67faba8908755846a6f4f
---

 libavutil/tx_template.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/libavutil/tx_template.c b/libavutil/tx_template.c
index 2a8afcb02a..5274133ec4 100644
--- a/libavutil/tx_template.c
+++ b/libavutil/tx_template.c
@@ -773,6 +773,7 @@ static void TX_NAME(ff_tx_fft)(AVTXContext *s, void *_dst,
 static void TX_NAME(ff_tx_fft_inplace)(AVTXContext *s, void *_dst,
                                        void *_src, ptrdiff_t stride)
 {
+    TXComplex *src = _src;
     TXComplex *dst = _dst;
     TXComplex tmp;
     const int *map = s->sub->map;
@@ -781,16 +782,16 @@ static void TX_NAME(ff_tx_fft_inplace)(AVTXContext *s, void *_dst,
 
     src_idx = *inplace_idx++;
     do {
-        tmp = dst[src_idx];
+        tmp = src[src_idx];
         dst_idx = map[src_idx];
         do {
-            FFSWAP(TXComplex, tmp, dst[dst_idx]);
+            FFSWAP(TXComplex, tmp, src[dst_idx]);
             dst_idx = map[dst_idx];
         } while (dst_idx != src_idx); /* Can be > as well, but was less predictable */
-        dst[dst_idx] = tmp;
+        src[dst_idx] = tmp;
     } while ((src_idx = *inplace_idx++));
 
-    s->fn[0](&s->sub[0], dst, dst, stride);
+    s->fn[0](&s->sub[0], dst, src, stride);
 }
 
 static const FFTXCodelet TX_NAME(ff_tx_fft_def) = {
@@ -810,13 +811,13 @@ static const FFTXCodelet TX_NAME(ff_tx_fft_inplace_def) = {
     .name       = TX_NAME_STR("fft_inplace"),
     .function   = TX_NAME(ff_tx_fft_inplace),
     .type       = TX_TYPE(FFT),
-    .flags      = AV_TX_UNALIGNED | AV_TX_INPLACE,
+    .flags      = AV_TX_UNALIGNED | FF_TX_OUT_OF_PLACE | AV_TX_INPLACE,
     .factors[0] = TX_FACTOR_ANY,
     .min_len    = 2,
     .max_len    = TX_LEN_UNLIMITED,
     .init       = TX_NAME(ff_tx_fft_init),
     .cpu_flags  = FF_TX_CPU_FLAGS_ALL,
-    .prio       = FF_TX_PRIO_BASE,
+    .prio       = FF_TX_PRIO_BASE - 512,
 };
 
 static av_cold int TX_NAME(ff_tx_fft_init_naive_small)(AVTXContext *s,



More information about the ffmpeg-cvslog mailing list