35 # define RSCALE(x) (x) 37 # define RSCALE(x) ((x) >> 1) 49 memset(s, 0,
sizeof(*s));
96 theta = 1.0 / 8.0 + (scale < 0 ? n4 : 0);
97 scale = sqrt(fabs(scale));
99 alpha = 2 * M_PI * (i + theta) / n;
100 s->
tcos[i*tstep] =
FIX15(-cos(alpha) * scale);
101 s->
tsin[i*tstep] =
FIX15(-sin(alpha) * scale);
117 int k, n8, n4, n2, n, j;
118 const uint16_t *revtab = s->
revtab;
131 in2 = input + n2 - 1;
132 for(k = 0; k < n4; k++) {
134 CMUL(z[j].
re, z[j].
im, *in2, *in1, tcos[k], tsin[k]);
141 for(k = 0; k < n8; k++) {
143 CMUL(r0, i1, z[n8-k-1].
im, z[n8-k-1].
re, tsin[n8-k-1], tcos[n8-k-1]);
144 CMUL(r1, i0, z[n8+k ].
im, z[n8+k ].
re, tsin[n8+k ], tcos[n8+k ]);
166 for(k = 0; k < n4; k++) {
167 output[k] = -output[n2-k-1];
168 output[n-k-1] = output[n2+k];
179 int i, j, n, n8, n4, n2, n3;
181 const uint16_t *revtab = s->
revtab;
194 re =
RSCALE(-input[2*i+n3] - input[n3-1-2*i]);
195 im =
RSCALE(-input[n4+2*i] + input[n4-1-2*i]);
197 CMUL(x[j].re, x[j].im, re, im, -tcos[i], tsin[i]);
199 re =
RSCALE( input[2*i] - input[n2-1-2*i]);
200 im =
RSCALE(-input[n2+2*i] - input[ n-1-2*i]);
202 CMUL(x[j].re, x[j].im, re, im, -tcos[n8 + i], tsin[n8 + i]);
210 CMUL(i1, r0, x[n8-i-1].re, x[n8-i-1].im, -tsin[n8-i-1], -tcos[n8-i-1]);
211 CMUL(i0, r1, x[n8+i ].re, x[n8+i ].im, -tsin[n8+i ], -tcos[n8+i ]);
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
av_cold int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale)
init MDCT or IMDCT computation.
av_cold void ff_mdct_init_aarch64(FFTContext *s)
void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input)
Compute the middle half of the inverse MDCT of size N = 2^nbits, thus excluding the parts that can be...
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
#define CMUL(dre, dim, are, aim, bre, bim)
void ff_mdct_calc_c(FFTContext *s, FFTSample *out, const FFTSample *input)
Compute MDCT of size N = 2^nbits.
void(* mdct_calcw)(struct FFTContext *s, FFTDouble *output, const FFTSample *input)
av_cold void ff_mdct_end(FFTContext *s)
void(* mdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input)
void(* imdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input)
void ff_mdct_init_x86(FFTContext *s)
void ff_mdct_init_ppc(FFTContext *s)
void(* imdct_half)(struct FFTContext *s, FFTSample *output, const FFTSample *input)
av_cold void ff_mdct_fixed_init_arm(FFTContext *s)
common internal and external API header
av_cold void ff_mdct_init_arm(FFTContext *s)
void ff_mdct_calcw_c(FFTContext *s, FFTDouble *output, const FFTSample *input)
void(* fft_calc)(struct FFTContext *s, FFTComplex *z)
Do a complex FFT with the parameters defined in ff_fft_init().
static uint32_t inverse(uint32_t v)
find multiplicative inverse modulo 2 ^ 32
enum mdct_permutation_type mdct_permutation
void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input)
Compute inverse MDCT of size N = 2^nbits.