[FFmpeg-cvslog] dca: clear inactive subbands only once in qmf_32_subbands()

Mans Rullgard git at videolan.org
Sat Oct 1 21:38:57 CEST 2011


ffmpeg | branch: release/0.8 | Mans Rullgard <mans at mansr.com> | Wed Sep 28 21:00:35 2011 +0100| [626f11b3bc92011896ae2502788adb423cbd74d9] | committer: Michael Niedermayer

dca: clear inactive subbands only once in qmf_32_subbands()

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 at mansr.com>
(cherry picked from commit bf00a73ace9b1aba790b75dcb26d43adfceb769f)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=626f11b3bc92011896ae2502788adb423cbd74d9
---

 libavcodec/dca.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index 5166fc5..69df8f4 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -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],



More information about the ffmpeg-cvslog mailing list