diff options
author | Lynne <dev@lynne.ee> | 2022-11-17 20:06:43 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2022-11-24 15:58:30 +0100 |
commit | fff3e1d8489ee83949f67faba8908755846a6f4f (patch) | |
tree | a61be0fd75c30e751656573b953b3491cfa65a8c | |
parent | d260796f119682274c83e2f1465f56f3e314c4a4 (diff) | |
download | ffmpeg-fff3e1d8489ee83949f67faba8908755846a6f4f.tar.gz |
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.
-rw-r--r-- | libavutil/tx_template.c | 13 |
1 files 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, |