changeset 7547:8226017a65ae libavcodec

mdct wrapper function to match fft
author lorenm
date Tue, 12 Aug 2008 00:38:30 +0000
parents 97383e012cb9
children 3d1b177a1b8c
files ac3dec.c atrac3.c cook.c dsputil.h fft.c mdct.c nellymoserdec.c vorbis_dec.c wmadec.c
diffstat 9 files changed, 23 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ac3dec.c	Tue Aug 12 00:36:36 2008 +0000
+++ b/ac3dec.c	Tue Aug 12 00:38:30 2008 +0000
@@ -605,7 +605,7 @@
         }
 
         /* run standard IMDCT */
-        s->imdct_256.fft.imdct_calc(&s->imdct_256, o_ptr, x);
+        ff_imdct_calc(&s->imdct_256, o_ptr, x);
 
         /* reverse the post-rotation & reordering from standard IMDCT */
         for(k=0; k<32; k++) {
@@ -642,8 +642,7 @@
         if (s->block_switch[ch]) {
             do_imdct_256(s, ch);
         } else {
-            s->imdct_512.fft.imdct_calc(&s->imdct_512, s->tmp_output,
-                                        s->transform_coeffs[ch]);
+            ff_imdct_calc(&s->imdct_512, s->tmp_output, s->transform_coeffs[ch]);
         }
         /* For the first half of the block, apply the window, add the delay
            from the previous block, and send to output */
--- a/atrac3.c	Tue Aug 12 00:36:36 2008 +0000
+++ b/atrac3.c	Tue Aug 12 00:38:30 2008 +0000
@@ -208,7 +208,7 @@
             FFSWAP(float, pInput[i], pInput[255-i]);
     }
 
-    mdct_ctx.fft.imdct_calc(&mdct_ctx,pOutput,pInput);
+    ff_imdct_calc(&mdct_ctx,pOutput,pInput);
 
     /* Perform windowing on the output. */
     dsp.vector_fmul(pOutput,mdct_window,512);
--- a/cook.c	Tue Aug 12 00:36:36 2008 +0000
+++ b/cook.c	Tue Aug 12 00:38:30 2008 +0000
@@ -733,7 +733,7 @@
     int i;
 
     /* Inverse modified discrete cosine transform */
-    q->mdct_ctx.fft.imdct_calc(&q->mdct_ctx, q->mono_mdct_output, inbuffer);
+    ff_imdct_calc(&q->mdct_ctx, q->mono_mdct_output, inbuffer);
 
     q->imlt_window (q, buffer1, gains_ptr, previous_buffer);
 
--- a/dsputil.h	Tue Aug 12 00:36:36 2008 +0000
+++ b/dsputil.h	Tue Aug 12 00:38:30 2008 +0000
@@ -676,6 +676,15 @@
     FFTContext fft;
 } MDCTContext;
 
+static inline void ff_imdct_calc(MDCTContext *s, FFTSample *output, const FFTSample *input)
+{
+    s->fft.imdct_calc(s, output, input);
+}
+static inline void ff_imdct_half(MDCTContext *s, FFTSample *output, const FFTSample *input)
+{
+    s->fft.imdct_half(s, output, input);
+}
+
 /**
  * Generate a Kaiser-Bessel Derived Window.
  * @param   window  pointer to half window
@@ -692,8 +701,8 @@
 void ff_sine_window_init(float *window, int n);
 
 int ff_mdct_init(MDCTContext *s, int nbits, int inverse);
-void ff_imdct_calc(MDCTContext *s, FFTSample *output, const FFTSample *input);
-void ff_imdct_half(MDCTContext *s, FFTSample *output, const FFTSample *input);
+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_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);
--- a/fft.c	Tue Aug 12 00:36:36 2008 +0000
+++ b/fft.c	Tue Aug 12 00:38:30 2008 +0000
@@ -87,8 +87,8 @@
 
     s->fft_permute = ff_fft_permute_c;
     s->fft_calc = ff_fft_calc_c;
-    s->imdct_calc = ff_imdct_calc;
-    s->imdct_half = ff_imdct_half;
+    s->imdct_calc = ff_imdct_calc_c;
+    s->imdct_half = ff_imdct_half_c;
     s->exptab1 = NULL;
 
 #if defined HAVE_MMX && defined HAVE_YASM
--- a/mdct.c	Tue Aug 12 00:36:36 2008 +0000
+++ b/mdct.c	Tue Aug 12 00:38:30 2008 +0000
@@ -106,7 +106,7 @@
  * @param output N/2 samples
  * @param input N/2 samples
  */
-void ff_imdct_half(MDCTContext *s, FFTSample *output, const FFTSample *input)
+void ff_imdct_half_c(MDCTContext *s, FFTSample *output, const FFTSample *input)
 {
     int k, n8, n4, n2, n, j;
     const uint16_t *revtab = s->fft.revtab;
@@ -150,14 +150,14 @@
  * @param input N/2 samples
  * @param tmp N/2 samples
  */
-void ff_imdct_calc(MDCTContext *s, FFTSample *output, const FFTSample *input)
+void ff_imdct_calc_c(MDCTContext *s, FFTSample *output, const FFTSample *input)
 {
     int k;
     int n = 1 << s->nbits;
     int n2 = n >> 1;
     int n4 = n >> 2;
 
-    ff_imdct_half(s, output+n4, input);
+    ff_imdct_half_c(s, output+n4, input);
 
     for(k = 0; k < n4; k++) {
         output[k] = -output[n2-k-1];
--- a/nellymoserdec.c	Tue Aug 12 00:36:36 2008 +0000
+++ b/nellymoserdec.c	Tue Aug 12 00:38:30 2008 +0000
@@ -119,7 +119,7 @@
         memset(&aptr[NELLY_FILL_LEN], 0,
                (NELLY_BUF_LEN - NELLY_FILL_LEN) * sizeof(float));
 
-        s->imdct_ctx.fft.imdct_calc(&s->imdct_ctx, s->imdct_out, aptr);
+        ff_imdct_calc(&s->imdct_ctx, s->imdct_out, aptr);
         /* XXX: overlapping and windowing should be part of a more
            generic imdct function */
         overlap_and_window(s, s->state, aptr, s->imdct_out);
--- a/vorbis_dec.c	Tue Aug 12 00:36:36 2008 +0000
+++ b/vorbis_dec.c	Tue Aug 12 00:38:30 2008 +0000
@@ -1528,7 +1528,7 @@
         float *buf=residue;
         const float *win=vc->win[blockflag&previous_window];
 
-        vc->mdct[0].fft.imdct_half(&vc->mdct[blockflag], buf, floor);
+        ff_imdct_half(&vc->mdct[blockflag], buf, floor);
 
         if(blockflag == previous_window) {
             vc->dsp.vector_fmul_window(ret, saved, buf, win, fadd_bias, blocksize/4);
--- a/wmadec.c	Tue Aug 12 00:36:36 2008 +0000
+++ b/wmadec.c	Tue Aug 12 00:38:30 2008 +0000
@@ -688,7 +688,7 @@
         n = s->block_len;
         n4 = s->block_len / 2;
         if(s->channel_coded[ch]){
-            s->mdct_ctx[bsize].fft.imdct_calc(&s->mdct_ctx[bsize], s->output, s->coefs[ch]);
+            ff_imdct_calc(&s->mdct_ctx[bsize], s->output, s->coefs[ch]);
         }else
             memset(s->output, 0, sizeof(s->output));