[SCM] libav/experimental: DCA: use some type-punning in qmf_32_subbands()

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:05:57 UTC 2013


The following commit has been merged in the experimental branch:
commit 0dc7df28dd50167722550fb20c57327398e32e9f
Author: Måns Rullgård <mans at mansr.com>
Date:   Mon Apr 12 11:14:48 2010 +0000

    DCA: use some type-punning in qmf_32_subbands()
    
    Originally committed as revision 22847 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/dca.c b/libavcodec/dca.c
index dc164e4..596756c 100644
--- a/libavcodec/dca.c
+++ b/libavcodec/dca.c
@@ -30,6 +30,7 @@
 #include <stddef.h>
 #include <stdio.h>
 
+#include "libavutil/intreadwrite.h"
 #include "avcodec.h"
 #include "dsputil.h"
 #include "fft.h"
@@ -770,8 +771,8 @@ static void qmf_32_subbands(DCAContext * s, int chans,
     for (subindex = 0; subindex < 8; subindex++) {
         /* Load in one sample from each subband and clear inactive subbands */
         for (i = 0; i < s->subband_activity[chans]; i++){
-            if((i-1)&2) s->raXin[i] = -samples_in[i][subindex];
-            else        s->raXin[i] =  samples_in[i][subindex];
+            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;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list