146 int main(
int argc,
char **argv)
155 if (!ref || !data || !rdft_context || !irdft_context)
157 for (i=0; i<
LEN; i++) {
158 ref[i] = data[i] = i*456 + 123 + i*i;
163 for (i=0; i<
LEN; i++) {
164 if (fabs(ref[i] - data[i]/LEN*2) > 1) {
165 fprintf(stderr,
"Failed at %d (%f %f)\n", i, ref[i], data[i]/LEN*2);
av_cold void ff_rdft_end(RDFTContext *s)
void(* dct_calc)(struct DCTContext *s, FFTSample *data)
ptrdiff_t const GLvoid * data
av_cold void av_fft_end(FFTContext *s)
void(* mdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input)
void av_mdct_end(FFTContext *s)
memory handling functions
FFTContext * av_mdct_init(int nbits, int inverse, double scale)
DCTContext * av_dct_init(int nbits, enum DCTTransformType type)
Set up DCT.
void(* fft_permute)(struct FFTContext *s, FFTComplex *z)
Do the permutation needed BEFORE calling fft_calc().
void av_fft_permute(FFTContext *s, FFTComplex *z)
Do the permutation needed BEFORE calling ff_fft_calc().
Macro definitions for various function/variable attributes.
void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input)
FFTContext * av_fft_init(int nbits, int inverse)
Set up a complex FFT.
void(* rdft_calc)(struct RDFTContext *s, FFTSample *z)
void av_rdft_calc(RDFTContext *s, FFTSample *data)
void(* imdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input)
void av_rdft_end(RDFTContext *s)
RDFTContext * av_rdft_init(int nbits, enum RDFTransformType trans)
Set up a real FFT.
void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
void(* imdct_half)(struct FFTContext *s, FFTSample *output, const FFTSample *input)
void av_dct_end(DCTContext *s)
av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
Set up DCT.
void(* fft_calc)(struct FFTContext *s, FFTComplex *z)
Do a complex FFT with the parameters defined in ff_fft_init().
void av_dct_calc(DCTContext *s, FFTSample *data)
av_cold void ff_dct_end(DCTContext *s)
void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
static uint32_t inverse(uint32_t v)
find multiplicative inverse modulo 2 ^ 32
#define av_malloc_array(a, b)
int main(int argc, char **argv)
av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans)
Set up a real FFT.
void av_fft_calc(FFTContext *s, FFTComplex *z)
Do a complex FFT with the parameters defined in av_fft_init().
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...