comparison dsputil.h @ 10161:a349795e8dca libavcodec

Prepare for optimised forward MDCT implementations This adds a function pointer for forward MDCT to FFTContext and initialises it with the existing C function. ff_calc_mdct() is changed to an inline function calling the selected version as done for other fft/mdct functions.
author mru
date Fri, 11 Sep 2009 02:24:19 +0000
parents 7a63015e4627
children 8d369aee733f
comparison
equal deleted inserted replaced
10160:75bab19c59a2 10161:a349795e8dca
680 FFTComplex *tmp_buf; 680 FFTComplex *tmp_buf;
681 void (*fft_permute)(struct FFTContext *s, FFTComplex *z); 681 void (*fft_permute)(struct FFTContext *s, FFTComplex *z);
682 void (*fft_calc)(struct FFTContext *s, FFTComplex *z); 682 void (*fft_calc)(struct FFTContext *s, FFTComplex *z);
683 void (*imdct_calc)(struct MDCTContext *s, FFTSample *output, const FFTSample *input); 683 void (*imdct_calc)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
684 void (*imdct_half)(struct MDCTContext *s, FFTSample *output, const FFTSample *input); 684 void (*imdct_half)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
685 void (*mdct_calc)(struct MDCTContext *s, FFTSample *output, const FFTSample *input);
685 } FFTContext; 686 } FFTContext;
686 687
687 extern FFTSample* const ff_cos_tabs[13]; 688 extern FFTSample* const ff_cos_tabs[13];
688 689
689 /** 690 /**
737 static inline void ff_imdct_half(MDCTContext *s, FFTSample *output, const FFTSample *input) 738 static inline void ff_imdct_half(MDCTContext *s, FFTSample *output, const FFTSample *input)
738 { 739 {
739 s->fft.imdct_half(s, output, input); 740 s->fft.imdct_half(s, output, input);
740 } 741 }
741 742
743 static inline void ff_mdct_calc(MDCTContext *s, FFTSample *output,
744 const FFTSample *input)
745 {
746 s->fft.mdct_calc(s, output, input);
747 }
748
742 /** 749 /**
743 * Generate a Kaiser-Bessel Derived Window. 750 * Generate a Kaiser-Bessel Derived Window.
744 * @param window pointer to half window 751 * @param window pointer to half window
745 * @param alpha determines window shape 752 * @param alpha determines window shape
746 * @param n size of half window 753 * @param n size of half window
762 extern float * const ff_sine_windows[6]; 769 extern float * const ff_sine_windows[6];
763 770
764 int ff_mdct_init(MDCTContext *s, int nbits, int inverse, double scale); 771 int ff_mdct_init(MDCTContext *s, int nbits, int inverse, double scale);
765 void ff_imdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input); 772 void ff_imdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input);
766 void ff_imdct_half_c(MDCTContext *s, FFTSample *output, const FFTSample *input); 773 void ff_imdct_half_c(MDCTContext *s, FFTSample *output, const FFTSample *input);
774 void ff_mdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input);
767 void ff_imdct_calc_3dn(MDCTContext *s, FFTSample *output, const FFTSample *input); 775 void ff_imdct_calc_3dn(MDCTContext *s, FFTSample *output, const FFTSample *input);
768 void ff_imdct_half_3dn(MDCTContext *s, FFTSample *output, const FFTSample *input); 776 void ff_imdct_half_3dn(MDCTContext *s, FFTSample *output, const FFTSample *input);
769 void ff_imdct_calc_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *input); 777 void ff_imdct_calc_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *input);
770 void ff_imdct_half_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *input); 778 void ff_imdct_half_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *input);
771 void ff_imdct_calc_sse(MDCTContext *s, FFTSample *output, const FFTSample *input); 779 void ff_imdct_calc_sse(MDCTContext *s, FFTSample *output, const FFTSample *input);
772 void ff_imdct_half_sse(MDCTContext *s, FFTSample *output, const FFTSample *input); 780 void ff_imdct_half_sse(MDCTContext *s, FFTSample *output, const FFTSample *input);
773 void ff_imdct_calc_neon(MDCTContext *s, FFTSample *output, const FFTSample *input); 781 void ff_imdct_calc_neon(MDCTContext *s, FFTSample *output, const FFTSample *input);
774 void ff_imdct_half_neon(MDCTContext *s, FFTSample *output, const FFTSample *input); 782 void ff_imdct_half_neon(MDCTContext *s, FFTSample *output, const FFTSample *input);
775 void ff_mdct_calc(MDCTContext *s, FFTSample *out, const FFTSample *input);
776 void ff_mdct_end(MDCTContext *s); 783 void ff_mdct_end(MDCTContext *s);
777 784
778 /* Real Discrete Fourier Transform */ 785 /* Real Discrete Fourier Transform */
779 786
780 enum RDFTransformType { 787 enum RDFTransformType {