changeset 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 75bab19c59a2
children 8d369aee733f
files dsputil.h fft.c mdct.c
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dsputil.h	Fri Sep 11 02:01:18 2009 +0000
+++ b/dsputil.h	Fri Sep 11 02:24:19 2009 +0000
@@ -682,6 +682,7 @@
     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);
 } FFTContext;
 
 extern FFTSample* const ff_cos_tabs[13];
@@ -739,6 +740,12 @@
     s->fft.imdct_half(s, output, input);
 }
 
+static inline void ff_mdct_calc(MDCTContext *s, FFTSample *output,
+                                const FFTSample *input)
+{
+    s->fft.mdct_calc(s, output, input);
+}
+
 /**
  * Generate a Kaiser-Bessel Derived Window.
  * @param   window  pointer to half window
@@ -764,6 +771,7 @@
 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_imdct_calc_3dn(MDCTContext *s, FFTSample *output, const FFTSample *input);
 void ff_imdct_half_3dn(MDCTContext *s, FFTSample *output, const FFTSample *input);
 void ff_imdct_calc_3dn2(MDCTContext *s, FFTSample *output, const FFTSample *input);
@@ -772,7 +780,6 @@
 void ff_imdct_half_sse(MDCTContext *s, FFTSample *output, const FFTSample *input);
 void ff_imdct_calc_neon(MDCTContext *s, FFTSample *output, const FFTSample *input);
 void ff_imdct_half_neon(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 */
--- a/fft.c	Fri Sep 11 02:01:18 2009 +0000
+++ b/fft.c	Fri Sep 11 02:24:19 2009 +0000
@@ -86,6 +86,7 @@
     s->fft_calc    = ff_fft_calc_c;
     s->imdct_calc  = ff_imdct_calc_c;
     s->imdct_half  = ff_imdct_half_c;
+    s->mdct_calc   = ff_mdct_calc_c;
     s->exptab1     = NULL;
 
 #if HAVE_MMX && HAVE_YASM
--- a/mdct.c	Fri Sep 11 02:01:18 2009 +0000
+++ b/mdct.c	Fri Sep 11 02:24:19 2009 +0000
@@ -180,7 +180,7 @@
  * @param input N samples
  * @param out N/2 samples
  */
-void ff_mdct_calc(MDCTContext *s, FFTSample *out, const FFTSample *input)
+void ff_mdct_calc_c(MDCTContext *s, FFTSample *out, const FFTSample *input)
 {
     int i, j, n, n8, n4, n2, n3;
     FFTSample re, im;