|
|
@@ -61,16 +61,12 @@ struct FFTContext { |
|
|
|
|
|
|
|
#if CONFIG_HARDCODED_TABLES |
|
|
|
#define COSTABLE_CONST const |
|
|
|
#define SINTABLE_CONST const |
|
|
|
#else |
|
|
|
#define COSTABLE_CONST |
|
|
|
#define SINTABLE_CONST |
|
|
|
#endif |
|
|
|
|
|
|
|
#define COSTABLE(size) \ |
|
|
|
COSTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_cos_##size)[size/2] |
|
|
|
#define SINTABLE(size) \ |
|
|
|
SINTABLE_CONST DECLARE_ALIGNED(16, FFTSample, ff_sin_##size)[size/2] |
|
|
|
|
|
|
|
extern COSTABLE(16); |
|
|
|
extern COSTABLE(32); |
|
|
@@ -93,20 +89,6 @@ extern COSTABLE_CONST FFTSample* const ff_cos_tabs[17]; |
|
|
|
*/ |
|
|
|
void ff_init_ff_cos_tabs(int index); |
|
|
|
|
|
|
|
extern SINTABLE(16); |
|
|
|
extern SINTABLE(32); |
|
|
|
extern SINTABLE(64); |
|
|
|
extern SINTABLE(128); |
|
|
|
extern SINTABLE(256); |
|
|
|
extern SINTABLE(512); |
|
|
|
extern SINTABLE(1024); |
|
|
|
extern SINTABLE(2048); |
|
|
|
extern SINTABLE(4096); |
|
|
|
extern SINTABLE(8192); |
|
|
|
extern SINTABLE(16384); |
|
|
|
extern SINTABLE(32768); |
|
|
|
extern SINTABLE(65536); |
|
|
|
|
|
|
|
/** |
|
|
|
* Set up a complex FFT. |
|
|
|
* @param nbits log2 of the length of the input array |
|
|
@@ -127,51 +109,4 @@ void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input); |
|
|
|
void ff_mdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input); |
|
|
|
void ff_mdct_end(FFTContext *s); |
|
|
|
|
|
|
|
/* Real Discrete Fourier Transform */ |
|
|
|
|
|
|
|
struct RDFTContext { |
|
|
|
int nbits; |
|
|
|
int inverse; |
|
|
|
int sign_convention; |
|
|
|
|
|
|
|
/* pre/post rotation tables */ |
|
|
|
const FFTSample *tcos; |
|
|
|
SINTABLE_CONST FFTSample *tsin; |
|
|
|
FFTContext fft; |
|
|
|
void (*rdft_calc)(struct RDFTContext *s, FFTSample *z); |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
* Set up a real FFT. |
|
|
|
* @param nbits log2 of the length of the input array |
|
|
|
* @param trans the type of transform |
|
|
|
*/ |
|
|
|
int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans); |
|
|
|
void ff_rdft_end(RDFTContext *s); |
|
|
|
|
|
|
|
void ff_rdft_init_arm(RDFTContext *s); |
|
|
|
|
|
|
|
/* Discrete Cosine Transform */ |
|
|
|
|
|
|
|
struct DCTContext { |
|
|
|
int nbits; |
|
|
|
int inverse; |
|
|
|
RDFTContext rdft; |
|
|
|
const float *costab; |
|
|
|
FFTSample *csc2; |
|
|
|
void (*dct_calc)(struct DCTContext *s, FFTSample *data); |
|
|
|
void (*dct32)(FFTSample *out, const FFTSample *in); |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
* Set up DCT. |
|
|
|
* @param nbits size of the input array: |
|
|
|
* (1 << nbits) for DCT-II, DCT-III and DST-I |
|
|
|
* (1 << nbits) + 1 for DCT-I |
|
|
|
* |
|
|
|
* @note the first element of the input of DST-I is ignored |
|
|
|
*/ |
|
|
|
int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType type); |
|
|
|
void ff_dct_end (DCTContext *s); |
|
|
|
|
|
|
|
#endif /* AVCODEC_FFT_H */ |