[FFmpeg-cvslog] r14703 - in trunk/libavcodec: ac3dec.c atrac3.c cook.c dsputil.h fft.c mdct.c nellymoserdec.c vorbis_dec.c wmadec.c

lorenm subversion
Tue Aug 12 02:38:30 CEST 2008


Author: lorenm
Date: Tue Aug 12 02:38:30 2008
New Revision: 14703

Log:
mdct wrapper function to match fft


Modified:
   trunk/libavcodec/ac3dec.c
   trunk/libavcodec/atrac3.c
   trunk/libavcodec/cook.c
   trunk/libavcodec/dsputil.h
   trunk/libavcodec/fft.c
   trunk/libavcodec/mdct.c
   trunk/libavcodec/nellymoserdec.c
   trunk/libavcodec/vorbis_dec.c
   trunk/libavcodec/wmadec.c

Modified: trunk/libavcodec/ac3dec.c
==============================================================================
--- trunk/libavcodec/ac3dec.c	(original)
+++ trunk/libavcodec/ac3dec.c	Tue Aug 12 02:38:30 2008
@@ -605,7 +605,7 @@ static void do_imdct_256(AC3DecodeContex
         }
 
         /* 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 @@ static inline void do_imdct(AC3DecodeCon
         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 */

Modified: trunk/libavcodec/atrac3.c
==============================================================================
--- trunk/libavcodec/atrac3.c	(original)
+++ trunk/libavcodec/atrac3.c	Tue Aug 12 02:38:30 2008
@@ -208,7 +208,7 @@ static void IMLT(float *pInput, float *p
             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);

Modified: trunk/libavcodec/cook.c
==============================================================================
--- trunk/libavcodec/cook.c	(original)
+++ trunk/libavcodec/cook.c	Tue Aug 12 02:38:30 2008
@@ -733,7 +733,7 @@ static void imlt_gain(COOKContext *q, fl
     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);
 

Modified: trunk/libavcodec/dsputil.h
==============================================================================
--- trunk/libavcodec/dsputil.h	(original)
+++ trunk/libavcodec/dsputil.h	Tue Aug 12 02:38:30 2008
@@ -676,6 +676,15 @@ typedef struct MDCTContext {
     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_kbd_window_init(float *window, f
 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);

Modified: trunk/libavcodec/fft.c
==============================================================================
--- trunk/libavcodec/fft.c	(original)
+++ trunk/libavcodec/fft.c	Tue Aug 12 02:38:30 2008
@@ -87,8 +87,8 @@ int ff_fft_init(FFTContext *s, int nbits
 
     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

Modified: trunk/libavcodec/mdct.c
==============================================================================
--- trunk/libavcodec/mdct.c	(original)
+++ trunk/libavcodec/mdct.c	Tue Aug 12 02:38:30 2008
@@ -106,7 +106,7 @@ int ff_mdct_init(MDCTContext *s, int nbi
  * @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 @@ void ff_imdct_half(MDCTContext *s, FFTSa
  * @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];

Modified: trunk/libavcodec/nellymoserdec.c
==============================================================================
--- trunk/libavcodec/nellymoserdec.c	(original)
+++ trunk/libavcodec/nellymoserdec.c	Tue Aug 12 02:38:30 2008
@@ -119,7 +119,7 @@ static void nelly_decode_block(NellyMose
         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);

Modified: trunk/libavcodec/vorbis_dec.c
==============================================================================
--- trunk/libavcodec/vorbis_dec.c	(original)
+++ trunk/libavcodec/vorbis_dec.c	Tue Aug 12 02:38:30 2008
@@ -1528,7 +1528,7 @@ static int vorbis_parse_audio_packet(vor
         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);

Modified: trunk/libavcodec/wmadec.c
==============================================================================
--- trunk/libavcodec/wmadec.c	(original)
+++ trunk/libavcodec/wmadec.c	Tue Aug 12 02:38:30 2008
@@ -688,7 +688,7 @@ next:
         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));
 




More information about the ffmpeg-cvslog mailing list