ffmpeg | branch: master | Lynne <[email protected]> | Wed Sep 28 12:59:08 2022 
+0200| [fbe4fd992f4327fcf17b2a76a823c38945b0ea13] | committer: Lynne

lavu/tx: support output stride in naive transforms

Allows them to be used in general PFAs.

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

 libavutil/tx_template.c | 8 ++++++--
 1 file 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;
     }
 }
 

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to