diff options
author | Lynne <dev@lynne.ee> | 2022-09-28 12:59:08 +0200 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2022-11-24 15:58:31 +0100 |
commit | fbe4fd992f4327fcf17b2a76a823c38945b0ea13 (patch) | |
tree | 1e48c3a992f87174396ac2669b0e45c1945b05a3 /libavutil | |
parent | 68cabf875015610decda7e564dc5697f6c21f707 (diff) | |
download | ffmpeg-fbe4fd992f4327fcf17b2a76a823c38945b0ea13.tar.gz |
lavu/tx: support output stride in naive transforms
Allows them to be used in general PFAs.
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/tx_template.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libavutil/tx_template.c b/libavutil/tx_template.c index 747731a06d..228209521b 100644 --- a/libavutil/tx_template.c +++ b/libavutil/tx_template.c @@ -880,6 +880,8 @@ static void TX_NAME(ff_tx_fft_naive)(AVTXContext *s, void *_dst, void *_src, const int n = s->len; double phase = s->inv ? 2.0*M_PI/n : -2.0*M_PI/n; + stride /= sizeof(*dst); + for (int i = 0; i < n; i++) { TXComplex tmp = { 0 }; for (int j = 0; j < n; j++) { @@ -893,7 +895,7 @@ static void TX_NAME(ff_tx_fft_naive)(AVTXContext *s, void *_dst, void *_src, tmp.re += res.re; tmp.im += res.im; } - dst[i] = tmp; + dst[i*stride] = tmp; } } @@ -904,6 +906,8 @@ static void TX_NAME(ff_tx_fft_naive_small)(AVTXContext *s, void *_dst, void *_sr TXComplex *dst = _dst; const int n = s->len; + stride /= sizeof(*dst); + for (int i = 0; i < n; i++) { TXComplex tmp = { 0 }; for (int j = 0; j < n; j++) { @@ -913,7 +917,7 @@ static void TX_NAME(ff_tx_fft_naive_small)(AVTXContext *s, void *_dst, void *_sr tmp.re += res.re; tmp.im += res.im; } - dst[i] = tmp; + dst[i*stride] = tmp; } } |