comparison dsputil.h @ 8694:68fd157bab48 libavcodec

Add the rdft family of transforms (fft/ifft of an all real sequence) to dsputil.
author alexc
date Fri, 30 Jan 2009 20:15:48 +0000
parents 9766c268bc9f
children e9d9d946f213
comparison
equal deleted inserted replaced
8693:18737839ed27 8694:68fd157bab48
672 void (*fft_calc)(struct FFTContext *s, FFTComplex *z); 672 void (*fft_calc)(struct FFTContext *s, FFTComplex *z);
673 void (*imdct_calc)(struct MDCTContext *s, FFTSample *output, const FFTSample *input); 673 void (*imdct_calc)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
674 void (*imdct_half)(struct MDCTContext *s, FFTSample *output, const FFTSample *input); 674 void (*imdct_half)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
675 } FFTContext; 675 } FFTContext;
676 676
677 extern FFTSample* ff_cos_tabs[13];
678
677 /** 679 /**
678 * Sets up a complex FFT. 680 * Sets up a complex FFT.
679 * @param nbits log2 of the length of the input array 681 * @param nbits log2 of the length of the input array
680 * @param inverse if 0 perform the forward transform, if 1 perform the inverse 682 * @param inverse if 0 perform the forward transform, if 1 perform the inverse
681 */ 683 */
756 void ff_imdct_half_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *input); 758 void ff_imdct_half_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *input);
757 void ff_imdct_calc_sse(MDCTContext *s, FFTSample *output, const FFTSample *input); 759 void ff_imdct_calc_sse(MDCTContext *s, FFTSample *output, const FFTSample *input);
758 void ff_imdct_half_sse(MDCTContext *s, FFTSample *output, const FFTSample *input); 760 void ff_imdct_half_sse(MDCTContext *s, FFTSample *output, const FFTSample *input);
759 void ff_mdct_calc(MDCTContext *s, FFTSample *out, const FFTSample *input); 761 void ff_mdct_calc(MDCTContext *s, FFTSample *out, const FFTSample *input);
760 void ff_mdct_end(MDCTContext *s); 762 void ff_mdct_end(MDCTContext *s);
763
764 /* Real Discrete Fourier Transform */
765
766 enum RDFTransformType {
767 RDFT,
768 IRDFT,
769 RIDFT,
770 IRIDFT,
771 };
772
773 typedef struct {
774 int nbits;
775 int inverse;
776 int sign_convention;
777
778 /* pre/post rotation tables */
779 FFTSample *tcos;
780 FFTSample *tsin;
781 FFTContext fft;
782 } RDFTContext;
783
784 /**
785 * Sets up a real FFT.
786 * @param nbits log2 of the length of the input array
787 * @param trans the type of transform
788 */
789 int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans);
790 void ff_rdft_calc(RDFTContext *s, FFTSample *data);
791 void ff_rdft_end(RDFTContext *s);
761 792
762 #define WRAPPER8_16(name8, name16)\ 793 #define WRAPPER8_16(name8, name16)\
763 static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\ 794 static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\
764 return name8(s, dst , src , stride, h)\ 795 return name8(s, dst , src , stride, h)\
765 +name8(s, dst+8 , src+8 , stride, h);\ 796 +name8(s, dst+8 , src+8 , stride, h);\