[FFmpeg-soc] [soc]: r1714 - in eac3: ac3dec.c ac3dec.h eac3dec.c

jbr subversion at mplayerhq.hu
Sun Dec 30 21:03:01 CET 2007


Author: jbr
Date: Sun Dec 30 21:03:01 2007
New Revision: 1714

Log:
share the whole IMDCT function instead of just the 256-point function

Modified:
   eac3/ac3dec.c
   eac3/ac3dec.h
   eac3/eac3dec.c

Modified: eac3/ac3dec.c
==============================================================================
--- eac3/ac3dec.c	(original)
+++ eac3/ac3dec.c	Sun Dec 30 21:03:01 2007
@@ -564,21 +564,21 @@ void ff_ac3_do_rematrixing(AC3DecodeCont
 /**
  * Perform the 256-point IMDCT
  */
-void ff_ac3_do_imdct_256(float *o_ptr, float *transform_coeffs,
-                         MDCTContext *imdct_256, float *tmp_imdct)
+static void do_imdct_256(AC3DecodeContext *ctx, int chindex)
 {
     int i, k;
     DECLARE_ALIGNED_16(float, x[128]);
     FFTComplex z[2][64];
+    float *o_ptr = ctx->tmp_output;
 
     for(i=0; i<2; i++) {
         /* de-interleave coefficients */
         for(k=0; k<128; k++) {
-            x[k] = transform_coeffs[2*k+i];
+            x[k] = ctx->transform_coeffs[chindex][2*k+i];
         }
 
         /* run standard IMDCT */
-        imdct_256->fft.imdct_calc(imdct_256, o_ptr, x, tmp_imdct);
+        ctx->imdct_256.fft.imdct_calc(&ctx->imdct_256, o_ptr, x, ctx->tmp_imdct);
 
         /* reverse the post-rotation & reordering from standard IMDCT */
         for(k=0; k<32; k++) {
@@ -607,7 +607,7 @@ void ff_ac3_do_imdct_256(float *o_ptr, f
  * Convert frequency domain coefficients to time-domain audio samples.
  * reference: Section 7.9.4 Transformation Equations
  */
-static inline void do_imdct(AC3DecodeContext *ctx)
+void ff_ac3_do_imdct(AC3DecodeContext *ctx)
 {
     int ch;
     int channels;
@@ -619,8 +619,7 @@ static inline void do_imdct(AC3DecodeCon
 
     for (ch=1; ch<=channels; ch++) {
         if (ctx->block_switch[ch]) {
-            ff_ac3_do_imdct_256(ctx->tmp_output, ctx->transform_coeffs[ch],
-                                &ctx->imdct_256, ctx->tmp_imdct);
+            do_imdct_256(ctx, ch);
         } else {
             ctx->imdct_512.fft.imdct_calc(&ctx->imdct_512, ctx->tmp_output,
                                           ctx->transform_coeffs[ch],
@@ -955,7 +954,7 @@ static int ac3_parse_audio_block(AC3Deco
         }
     }
 
-    do_imdct(ctx);
+    ff_ac3_do_imdct(ctx);
 
     /* downmix output if needed */
     if(ctx->channels != ctx->out_channels && !((ctx->output_mode & AC3_OUTPUT_LFEON) &&

Modified: eac3/ac3dec.h
==============================================================================
--- eac3/ac3dec.h	(original)
+++ eac3/ac3dec.h	Sun Dec 30 21:03:01 2007
@@ -252,8 +252,7 @@ void ff_ac3_remove_dithering(AC3DecodeCo
 
 void ff_ac3_do_rematrixing(AC3DecodeContext *s);
 
-void ff_ac3_do_imdct_256(float *tmp_output, float *transform_coeffs,
-        MDCTContext *imdct_256, float *tmp_imdct);
+void ff_ac3_do_imdct(AC3DecodeContext *s);
 
 void ff_ac3_downmix(float samples[AC3_MAX_CHANNELS][256], int nfchans,
                         int output_mode, float coef[AC3_MAX_CHANNELS][2]);

Modified: eac3/eac3dec.c
==============================================================================
--- eac3/eac3dec.c	(original)
+++ eac3/eac3dec.c	Sun Dec 30 21:03:01 2007
@@ -1167,32 +1167,6 @@ static int parse_audblk(AC3DecodeContext
     return 0;
 }
 
-/**
- * Performs Inverse MDCT transform
- */
-static void do_imdct(AC3DecodeContext *ctx){
-    int ch;
-
-    for (ch = 1; ch <= ctx->fbw_channels + ctx->lfe_on; ch++) {
-        if (ctx->block_switch[ch]) {
-            /* 256-point IMDCT */
-            ff_ac3_do_imdct_256(ctx->tmp_output, ctx->transform_coeffs[ch],
-                    &ctx->imdct_256, ctx->tmp_imdct);
-        } else {
-            /* 512-point IMDCT */
-            ctx->imdct_512.fft.imdct_calc(&ctx->imdct_512, ctx->tmp_output,
-                    ctx->transform_coeffs[ch],
-                    ctx->tmp_imdct);
-        }
-        /* apply window function, overlap/add output, save delay */
-        ctx->dsp.vector_fmul_add_add(ctx->output[ch-1], ctx->tmp_output,
-                ctx->window, ctx->delay[ch-1], 0,
-                AC3_BLOCK_SIZE, 1);
-        ctx->dsp.vector_fmul_reverse(ctx->delay[ch-1], ctx->tmp_output+256,
-                ctx->window, AC3_BLOCK_SIZE);
-    }
-}
-
 static int eac3_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
         uint8_t *buf, int buf_size){
     int16_t *out_samples = (int16_t *)data;
@@ -1252,7 +1226,7 @@ static int eac3_decode_frame(AVCodecCont
             }
         }
 
-        do_imdct(c);
+        ff_ac3_do_imdct(c);
 
         // TODO: Transient Pre-Noise Cross-Fading
 



More information about the FFmpeg-soc mailing list