]> git.sesse.net Git - ffmpeg/commitdiff
dca: clear inactive subbands only once in qmf_32_subbands()
authorMans Rullgard <mans@mansr.com>
Wed, 28 Sep 2011 20:00:35 +0000 (21:00 +0100)
committerMans Rullgard <mans@mansr.com>
Thu, 29 Sep 2011 11:34:17 +0000 (12:34 +0100)
Writing zeros to the high entries in the array need only be
done once as the cutoff position is constant throughout the
loop.

Signed-off-by: Mans Rullgard <mans@mansr.com>
libavcodec/dca.c

index db794a72fd1f7e0c6b226ed46fa1e98f8470383c..735d7ba9da54f7afdf076b7cc69924b43fe9130c 100644 (file)
@@ -898,6 +898,9 @@ static void qmf_32_subbands(DCAContext * s, int chans,
     else                        /* Perfect reconstruction */
         prCoeff = fir_32bands_perfect;
 
+    for (i = sb_act; i < 32; i++)
+        s->raXin[i] = 0.0;
+
     /* Reconstructed channel sample index */
     for (subindex = 0; subindex < 8; subindex++) {
         /* Load in one sample from each subband and clear inactive subbands */
@@ -905,8 +908,6 @@ static void qmf_32_subbands(DCAContext * s, int chans,
             uint32_t v = AV_RN32A(&samples_in[i][subindex]) ^ ((i-1)&2)<<30;
             AV_WN32A(&s->raXin[i], v);
         }
-        for (; i < 32; i++)
-            s->raXin[i] = 0.0;
 
         s->synth.synth_filter_float(&s->imdct,
                               s->subband_fir_hist[chans], &s->hist_index[chans],