From 89a9042291e2f54be98e54e8e8fa50ee3fe7d1a6 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 6 Apr 2024 07:30:07 +0200 Subject: [PATCH] lavc/avfft: fix RDFT wrapper stride Per the lavu/tx docs: > * For forward transforms (R2C), stride must be the spacing between two > * samples in bytes. For inverse transforms, the stride must be set > * to the spacing between two complex values in bytes. The code did the reverse. The stride parameter is currently not respected for RDFT transforms, but has to be correct, for a potential future change. --- libavcodec/avfft.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/avfft.c b/libavcodec/avfft.c index 627fd7a0be..f6787937f6 100644 --- a/libavcodec/avfft.c +++ b/libavcodec/avfft.c @@ -158,7 +158,7 @@ RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans) return NULL; } - s->stride = (trans == DFT_C2R) ? sizeof(float) : sizeof(AVComplexFloat); + s->stride = (trans == DFT_C2R) ? sizeof(AVComplexFloat) : sizeof(float); s->len = 1 << nbits; s->inv = trans == IDFT_C2R;