[FFmpeg-soc] [soc]: r2636 - mlp/mlpdec.c

ramiro subversion at mplayerhq.hu
Tue Jul 1 17:40:32 CEST 2008


Author: ramiro
Date: Tue Jul  1 17:40:32 2008
New Revision: 2636

Log:
Read filter_coeff_q from context once per channel.

Modified:
   mlp/mlpdec.c

Modified: mlp/mlpdec.c
==============================================================================
--- mlp/mlpdec.c	(original)
+++ mlp/mlpdec.c	Tue Jul  1 17:40:32 2008
@@ -730,7 +730,8 @@ static int read_decoding_params(MLPDecod
  */
 
 static int filter_sample(MLPDecodeContext *m, unsigned int quant_step_size,
-                         unsigned int channel, int32_t residual)
+                         unsigned int channel, int32_t residual,
+                         unsigned int filter_coeff_q)
 {
     unsigned int i, j, index;
     int64_t accum = 0;
@@ -746,7 +747,7 @@ static int filter_sample(MLPDecodeContex
             accum += (int64_t)m->filter_state[channel][j][INDEX(channel,j,i)] *
                      m->filter_coeff[channel][j][i];
 
-    accum = accum >> m->filter_coeff_q[channel][FIR];
+    accum = accum >> filter_coeff_q;
     result = (accum + residual) & ~((1 << quant_step_size) - 1);
 
     index = INDEX(channel, FIR, -1);
@@ -801,11 +802,12 @@ static int read_block_data(MLPDecodeCont
 
     for (ch = s->min_channel; ch <= s->max_channel; ch++) {
         unsigned int quant_step_size = s->quant_step_size[ch];
+        unsigned int filter_coeff_q = m->filter_coeff_q[ch][FIR];
 
         for (i = 0; i < s->blocksize; i++) {
             int32_t sample = m->sample_buffer[i + s->blockpos][ch];
 
-            sample = filter_sample(m, quant_step_size, ch, sample);
+            sample = filter_sample(m, quant_step_size, ch, sample, filter_coeff_q);
 
             m->sample_buffer[i + s->blockpos][ch] = sample;
         }



More information about the FFmpeg-soc mailing list