lavu/tx: support output stride in naive transforms

Allows them to be used in general PFAs.
This commit is contained in:
Lynne 2022-09-28 12:59:08 +02:00
parent 68cabf8750
commit fbe4fd992f
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464

View File

@ -880,6 +880,8 @@ static void TX_NAME(ff_tx_fft_naive)(AVTXContext *s, void *_dst, void *_src,
const int n = s->len; const int n = s->len;
double phase = s->inv ? 2.0*M_PI/n : -2.0*M_PI/n; double phase = s->inv ? 2.0*M_PI/n : -2.0*M_PI/n;
stride /= sizeof(*dst);
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
TXComplex tmp = { 0 }; TXComplex tmp = { 0 };
for (int j = 0; j < n; j++) { 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.re += res.re;
tmp.im += res.im; 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; TXComplex *dst = _dst;
const int n = s->len; const int n = s->len;
stride /= sizeof(*dst);
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
TXComplex tmp = { 0 }; TXComplex tmp = { 0 };
for (int j = 0; j < n; j++) { 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.re += res.re;
tmp.im += res.im; tmp.im += res.im;
} }
dst[i] = tmp; dst[i*stride] = tmp;
} }
} }