[FFmpeg-cvslog] r15033 - trunk/libavcodec/dca.c

Michael Niedermayer michaelni
Sat Aug 30 00:42:01 CEST 2008


On Fri, Aug 29, 2008 at 11:17:42PM +0200, Benjamin Larsson wrote:
> michael wrote:
> > Author: michael
> > Date: Fri Aug 29 20:37:40 2008
> > New Revision: 15033
> > 
> > Log:
> > Half the size of subband_fir_noidea and get rid of memmove & memset of it.
> > 
> > 
> > Modified:
> >    trunk/libavcodec/dca.c
> > 
> > Modified: trunk/libavcodec/dca.c
> > ==============================================================================
> > --- trunk/libavcodec/dca.c	(original)
> > +++ trunk/libavcodec/dca.c	Fri Aug 29 20:37:40 2008
> > @@ -158,7 +158,7 @@ typedef struct {
> >      /* Subband samples history (for ADPCM) */
> >      float subband_samples_hist[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][4];
> >      float subband_fir_hist[DCA_PRIM_CHANNELS_MAX][512];
> > -    float subband_fir_noidea[DCA_PRIM_CHANNELS_MAX][64];
> > +    float subband_fir_noidea[DCA_PRIM_CHANNELS_MAX][32];
> >  
> >      int output;                 ///< type of output
> >      int bias;                   ///< output bias
> > @@ -693,20 +693,19 @@ static void qmf_32_subbands(DCAContext *
> >          }
> >  
> >          /* Multiply by filter coefficients */
> > -        for (k = 31, i = 0; i < 32; i++, k--)
> > +        for (k = 31, i = 0; i < 32; i++, k--){
> > +            float a= subband_fir_hist2[i];
> > +            float b= 0;
> >              for (j = 0; j < 512; j += 64){
> > -                subband_fir_hist2[i]    += prCoeff[i+j]  * ( subband_fir_hist[i+j] - subband_fir_hist[j+k]);
> > -                subband_fir_hist2[i+32] += prCoeff[i+j+32]*(-subband_fir_hist[i+j] - subband_fir_hist[j+k]);
> > +                a += prCoeff[i+j   ]*( subband_fir_hist[i+j] - subband_fir_hist[j+k]);
> > +                b += prCoeff[i+j+32]*(-subband_fir_hist[i+j] - subband_fir_hist[j+k]);
> >              }
> > -
> > -        /* Create 32 PCM output samples */
> > -        for (i = 0; i < 32; i++)
> > -            samples_out[chindex++] = subband_fir_hist2[i] * scale + bias;
> > +            samples_out[chindex++] = a * scale + bias;
> > +            subband_fir_hist2[i] = b;
> > +        }
> >  
> >          /* Update working arrays */
> >          memmove(&subband_fir_hist[32], &subband_fir_hist[0], (512 - 32) * sizeof(float));
> > -        memmove(&subband_fir_hist2[0], &subband_fir_hist2[32], 32 * sizeof(float));
> > -        memset(&subband_fir_hist2[32], 0, 32 * sizeof(float));
> >      }
> >  }
> >  
> 
> Patch ok.

applied

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

> ... defining _GNU_SOURCE...
For the love of all that is holy, and some that is not, don't do that.
-- Luca & Mans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20080830/b1dc631b/attachment.pgp>



More information about the ffmpeg-cvslog mailing list