diff options
author | Måns Rullgård <mans@mansr.com> | 2009-09-20 17:30:20 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2009-09-20 17:30:20 +0000 |
commit | 01b2214758ce2bc664bb4468f11ac0f041a337c1 (patch) | |
tree | 521c649aa1fb7c812e6db5191737cdb7ac413e7b /libavcodec/dsputil.h | |
parent | ec129499b85e3d33a750d49862a73c2d19f61490 (diff) | |
download | ffmpeg-01b2214758ce2bc664bb4468f11ac0f041a337c1.tar.gz |
Merge FFTContext and MDCTContext
Originally committed as revision 19931 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.h')
-rw-r--r-- | libavcodec/dsputil.h | 44 |
1 files changed, 19 insertions, 25 deletions
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index d9d7d16817..985120e06f 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -665,8 +665,6 @@ void get_psnr(uint8_t *orig_image[3], uint8_t *coded_image[3], FFTSample type */ typedef float FFTSample; -struct MDCTContext; - typedef struct FFTComplex { FFTSample re, im; } FFTComplex; @@ -678,11 +676,16 @@ typedef struct FFTContext { FFTComplex *exptab; FFTComplex *exptab1; /* only used by SSE code */ FFTComplex *tmp_buf; + int mdct_size; /* size of MDCT (i.e. number of input data * 2) */ + int mdct_bits; /* n = 2^nbits */ + /* pre/post rotation tables */ + FFTSample *tcos; + FFTSample *tsin; void (*fft_permute)(struct FFTContext *s, FFTComplex *z); void (*fft_calc)(struct FFTContext *s, FFTComplex *z); - void (*imdct_calc)(struct MDCTContext *s, FFTSample *output, const FFTSample *input); - void (*imdct_half)(struct MDCTContext *s, FFTSample *output, const FFTSample *input); - void (*mdct_calc)(struct MDCTContext *s, FFTSample *output, const FFTSample *input); + void (*imdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input); + void (*imdct_half)(struct FFTContext *s, FFTSample *output, const FFTSample *input); + void (*mdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input); int split_radix; } FFTContext; @@ -720,28 +723,19 @@ void ff_fft_end(FFTContext *s); /* MDCT computation */ -typedef struct MDCTContext { - int n; /* size of MDCT (i.e. number of input data * 2) */ - int nbits; /* n = 2^nbits */ - /* pre/post rotation tables */ - FFTSample *tcos; - FFTSample *tsin; - FFTContext fft; -} MDCTContext; - -static inline void ff_imdct_calc(MDCTContext *s, FFTSample *output, const FFTSample *input) +static inline void ff_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input) { - s->fft.imdct_calc(s, output, input); + s->imdct_calc(s, output, input); } -static inline void ff_imdct_half(MDCTContext *s, FFTSample *output, const FFTSample *input) +static inline void ff_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input) { - s->fft.imdct_half(s, output, input); + s->imdct_half(s, output, input); } -static inline void ff_mdct_calc(MDCTContext *s, FFTSample *output, +static inline void ff_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input) { - s->fft.mdct_calc(s, output, input); + s->mdct_calc(s, output, input); } /** @@ -768,11 +762,11 @@ extern float ff_sine_2048[2048]; extern float ff_sine_4096[4096]; extern float * const ff_sine_windows[13]; -int ff_mdct_init(MDCTContext *s, int nbits, int inverse, double scale); -void ff_imdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input); -void ff_imdct_half_c(MDCTContext *s, FFTSample *output, const FFTSample *input); -void ff_mdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input); -void ff_mdct_end(MDCTContext *s); +int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale); +void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input); +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 */ |