|
|
|
@ -33,8 +33,8 @@ |
|
|
|
|
#include "libavutil/common.h" |
|
|
|
|
|
|
|
|
|
#include "avfft.h" |
|
|
|
|
#include "imdct15.h" |
|
|
|
|
#include "opus.h" |
|
|
|
|
#include "opus_imdct.h" |
|
|
|
|
|
|
|
|
|
// minimal iMDCT size to make SIMD opts easier
|
|
|
|
|
#define CELT_MIN_IMDCT_SIZE 120 |
|
|
|
@ -66,9 +66,9 @@ do { \ |
|
|
|
|
(d).im = -ri + ir; \
|
|
|
|
|
} while (0) |
|
|
|
|
|
|
|
|
|
av_cold void ff_celt_imdct_uninit(CeltIMDCTContext **ps) |
|
|
|
|
av_cold void ff_imdct15_uninit(IMDCT15Context **ps) |
|
|
|
|
{ |
|
|
|
|
CeltIMDCTContext *s = *ps; |
|
|
|
|
IMDCT15Context *s = *ps; |
|
|
|
|
int i; |
|
|
|
|
|
|
|
|
|
if (!s) |
|
|
|
@ -84,12 +84,12 @@ av_cold void ff_celt_imdct_uninit(CeltIMDCTContext **ps) |
|
|
|
|
av_freep(ps); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void celt_imdct_half(CeltIMDCTContext *s, float *dst, const float *src, |
|
|
|
|
ptrdiff_t stride, float scale); |
|
|
|
|
static void imdct15_half(IMDCT15Context *s, float *dst, const float *src, |
|
|
|
|
ptrdiff_t stride, float scale); |
|
|
|
|
|
|
|
|
|
av_cold int ff_celt_imdct_init(CeltIMDCTContext **ps, int N) |
|
|
|
|
av_cold int ff_imdct15_init(IMDCT15Context **ps, int N) |
|
|
|
|
{ |
|
|
|
|
CeltIMDCTContext *s; |
|
|
|
|
IMDCT15Context *s; |
|
|
|
|
int len2 = 15 * (1 << N); |
|
|
|
|
int len = 2 * len2; |
|
|
|
|
int i, j; |
|
|
|
@ -134,16 +134,17 @@ av_cold int ff_celt_imdct_init(CeltIMDCTContext **ps, int N) |
|
|
|
|
for (j = 15; j < 19; j++) |
|
|
|
|
s->exptab[0][j] = s->exptab[0][j - 15]; |
|
|
|
|
|
|
|
|
|
s->imdct_half = celt_imdct_half; |
|
|
|
|
s->imdct_half = imdct15_half; |
|
|
|
|
|
|
|
|
|
if (ARCH_AARCH64) |
|
|
|
|
ff_celt_imdct_init_aarch64(s); |
|
|
|
|
ff_imdct15_init_aarch64(s); |
|
|
|
|
|
|
|
|
|
*ps = s; |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
|
|
fail: |
|
|
|
|
ff_celt_imdct_uninit(&s); |
|
|
|
|
ff_imdct15_uninit(&s); |
|
|
|
|
return AVERROR(ENOMEM); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -180,7 +181,8 @@ static void fft5(FFTComplex *out, const FFTComplex *in, ptrdiff_t stride) |
|
|
|
|
out[4].im = in[0].im + z[0][3].im + z[1][2].im + z[2][1].im + z[3][0].im; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void fft15(CeltIMDCTContext *s, FFTComplex *out, const FFTComplex *in, ptrdiff_t stride) |
|
|
|
|
static void fft15(IMDCT15Context *s, FFTComplex *out, const FFTComplex *in, |
|
|
|
|
ptrdiff_t stride) |
|
|
|
|
{ |
|
|
|
|
const FFTComplex *exptab = s->exptab[0]; |
|
|
|
|
FFTComplex tmp[5]; |
|
|
|
@ -215,7 +217,7 @@ static void fft15(CeltIMDCTContext *s, FFTComplex *out, const FFTComplex *in, pt |
|
|
|
|
/*
|
|
|
|
|
* FFT of the length 15 * (2^N) |
|
|
|
|
*/ |
|
|
|
|
static void fft_calc(CeltIMDCTContext *s, FFTComplex *out, const FFTComplex *in, |
|
|
|
|
static void fft_calc(IMDCT15Context *s, FFTComplex *out, const FFTComplex *in, |
|
|
|
|
int N, ptrdiff_t stride) |
|
|
|
|
{ |
|
|
|
|
if (N) { |
|
|
|
@ -241,8 +243,8 @@ static void fft_calc(CeltIMDCTContext *s, FFTComplex *out, const FFTComplex *in, |
|
|
|
|
fft15(s, out, in, stride); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void celt_imdct_half(CeltIMDCTContext *s, float *dst, const float *src, |
|
|
|
|
ptrdiff_t stride, float scale) |
|
|
|
|
static void imdct15_half(IMDCT15Context *s, float *dst, const float *src, |
|
|
|
|
ptrdiff_t stride, float scale) |
|
|
|
|
{ |
|
|
|
|
FFTComplex *z = (FFTComplex *)dst; |
|
|
|
|
const int len8 = s->len4 / 2; |