---
typo fixed, rebased onto the v2 patch and using FFMAX(N, 19)
libavcodec/opus_imdct.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/libavcodec/opus_imdct.c b/libavcodec/opus_imdct.c
index 671f8d5..d4ffd95 100644
--- a/libavcodec/opus_imdct.c
+++ b/libavcodec/opus_imdct.c
@@ -27,6 +27,7 @@
#include <math.h>
#include "libavutil/attributes.h"
+#include "libavutil/common.h"
#include "fft.h"
#include "opus.h"
@@ -121,7 +122,7 @@ av_cold int ff_celt_imdct_init(CeltIMDCTContext **ps, int N)
for (i = 0; i < FF_ARRAY_ELEMS(s->exptab); i++) {
int N = 15 * (1 << i);
- s->exptab[i] = av_malloc(sizeof(*s->exptab[i]) * N);
+ s->exptab[i] = av_malloc(sizeof(*s->exptab[i]) * FFMAX(N, 19));
if (!s->exptab[i])
goto fail;
@@ -131,6 +132,10 @@ av_cold int ff_celt_imdct_init(CeltIMDCTContext **ps, int
N)
}
}
+ // wrap around to simplify fft15
+ for (j = 15; j < 19; j++)
+ s->exptab[0][j] = s->exptab[0][j - 15];
+
*ps = s;
return 0;
@@ -192,9 +197,8 @@ static void fft15(CeltIMDCTContext *s, FFTComplex *out,
const FFTComplex *in, in
out[k].re = tmp[k].re + t1.re + t2.re;
out[k].im = tmp[k].im + t1.im + t2.im;
- // FIXME
CMUL(t1, tmp1[k], exptab[k + 5]);
- CMUL(t2, tmp2[k], k < 3 ? exptab[2 * (k + 5)] : exptab[2 * (k + 5) -
15]);
+ CMUL(t2, tmp2[k], exptab[2 * (k + 5)]);
out[k + 5].re = tmp[k].re + t1.re + t2.re;
out[k + 5].im = tmp[k].im + t1.im + t2.im;
--
1.9.2
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel