diff options
author | Alex Converse <alex.converse@gmail.com> | 2009-01-30 20:15:48 +0000 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2009-01-30 20:15:48 +0000 |
commit | 686025404486c751c808aa7441da19cacef637b4 (patch) | |
tree | b07c0ab6665aaf6c6c8d081c65a1b4d8832b70a4 /libavcodec/dsputil.h | |
parent | 9d52d54df35d43b149ed1d1607fc95948df70f8c (diff) | |
download | ffmpeg-686025404486c751c808aa7441da19cacef637b4.tar.gz |
Add the rdft family of transforms (fft/ifft of an all real sequence) to dsputil.
Originally committed as revision 16864 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.h')
-rw-r--r-- | libavcodec/dsputil.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 165aef7a09..66557138bf 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -674,6 +674,8 @@ typedef struct FFTContext { void (*imdct_half)(struct MDCTContext *s, FFTSample *output, const FFTSample *input); } FFTContext; +extern FFTSample* ff_cos_tabs[13]; + /** * Sets up a complex FFT. * @param nbits log2 of the length of the input array @@ -759,6 +761,35 @@ void ff_imdct_half_sse(MDCTContext *s, FFTSample *output, const FFTSample *input void ff_mdct_calc(MDCTContext *s, FFTSample *out, const FFTSample *input); void ff_mdct_end(MDCTContext *s); +/* Real Discrete Fourier Transform */ + +enum RDFTransformType { + RDFT, + IRDFT, + RIDFT, + IRIDFT, +}; + +typedef struct { + int nbits; + int inverse; + int sign_convention; + + /* pre/post rotation tables */ + FFTSample *tcos; + FFTSample *tsin; + FFTContext fft; +} RDFTContext; + +/** + * Sets 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_calc(RDFTContext *s, FFTSample *data); +void ff_rdft_end(RDFTContext *s); + #define WRAPPER8_16(name8, name16)\ static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\ return name8(s, dst , src , stride, h)\ |