[FFmpeg-cvslog] r22827 - in trunk/libavcodec: dca.c synth_filter.c synth_filter.h

mru subversion
Sat Apr 10 18:27:53 CEST 2010


Author: mru
Date: Sat Apr 10 18:27:53 2010
New Revision: 22827

Log:
Make synth_filter a function pointer

Modified:
   trunk/libavcodec/dca.c
   trunk/libavcodec/synth_filter.c
   trunk/libavcodec/synth_filter.h

Modified: trunk/libavcodec/dca.c
==============================================================================
--- trunk/libavcodec/dca.c	Sat Apr 10 18:27:47 2010	(r22826)
+++ trunk/libavcodec/dca.c	Sat Apr 10 18:27:53 2010	(r22827)
@@ -253,6 +253,7 @@ typedef struct {
     int debug_flag;             ///< used for suppressing repeated error messages output
     DSPContext dsp;
     FFTContext imdct;
+    SynthFilterContext synth;
 } DCAContext;
 
 static const uint16_t dca_vlc_offs[] = {
@@ -775,7 +776,7 @@ static void qmf_32_subbands(DCAContext *
         for (; i < 32; i++)
             s->raXin[i] = 0.0;
 
-        ff_synth_filter_float(&s->imdct,
+        s->synth.synth_filter_float(&s->imdct,
                               s->subband_fir_hist[chans], &s->hist_index[chans],
                               s->subband_fir_noidea[chans], prCoeff,
                               samples_out, s->raXin, scale, bias);
@@ -1298,6 +1299,7 @@ static av_cold int dca_decode_init(AVCod
 
     dsputil_init(&s->dsp, avctx);
     ff_mdct_init(&s->imdct, 6, 1, 1.0);
+    ff_synth_filter_init(&s->synth);
 
     for(i = 0; i < 6; i++)
         s->samples_chanptr[i] = s->samples + i * 256;

Modified: trunk/libavcodec/synth_filter.c
==============================================================================
--- trunk/libavcodec/synth_filter.c	Sat Apr 10 18:27:47 2010	(r22826)
+++ trunk/libavcodec/synth_filter.c	Sat Apr 10 18:27:53 2010	(r22827)
@@ -21,7 +21,7 @@
 #include "fft.h"
 #include "synth_filter.h"
 
-void ff_synth_filter_float(FFTContext *imdct,
+static void synth_filter_float(FFTContext *imdct,
                            float *synth_buf_ptr, int *synth_buf_offset,
                            float synth_buf2[32], const float window[512],
                            float out[32], const float in[32], float scale, float bias)
@@ -55,3 +55,10 @@ void ff_synth_filter_float(FFTContext *i
     }
     *synth_buf_offset= (*synth_buf_offset - 32)&511;
 }
+
+av_cold void ff_synth_filter_init(SynthFilterContext *c)
+{
+    c->synth_filter_float = synth_filter_float;
+
+    if (ARCH_ARM) ff_synth_filter_init_arm(c);
+}

Modified: trunk/libavcodec/synth_filter.h
==============================================================================
--- trunk/libavcodec/synth_filter.h	Sat Apr 10 18:27:47 2010	(r22826)
+++ trunk/libavcodec/synth_filter.h	Sat Apr 10 18:27:53 2010	(r22827)
@@ -23,9 +23,14 @@
 
 #include "fft.h"
 
-void ff_synth_filter_float(FFTContext *imdct,
-                           float *synth_buf_ptr, int *synth_buf_offset,
-                           float synth_buf2[32], const float window[512],
-                           float out[32], const float in[32], float scale, float bias);
+typedef struct SynthFilterContext {
+    void (*synth_filter_float)(FFTContext *imdct,
+                               float *synth_buf_ptr, int *synth_buf_offset,
+                               float synth_buf2[32], const float window[512],
+                               float out[32], const float in[32],
+                               float scale, float bias);
+} SynthFilterContext;
+
+void ff_synth_filter_init(SynthFilterContext *c);
 
 #endif /* AVCODEC_SYNTH_FILTER_H */



More information about the ffmpeg-cvslog mailing list