[FFmpeg-cvslog] aacsbr: align some arrays

Mans Rullgard git at videolan.org
Sun Jan 29 00:58:39 CET 2012


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Fri Jan 13 14:31:18 2012 +0000| [8996ed2b7324f35798c4198b495f8a6955d2047d] | committer: Mans Rullgard

aacsbr: align some arrays

Signed-off-by: Mans Rullgard <mans at mansr.com>

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

 libavcodec/aacsbr.c     |    8 +++++---
 libavcodec/aacsbrdata.h |    4 +++-
 libavcodec/sbr.h        |   12 ++++++------
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c
index 01601b0..3a30fca 100644
--- a/libavcodec/aacsbr.c
+++ b/libavcodec/aacsbr.c
@@ -1220,7 +1220,8 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
 {
     int k;
     for (k = 0; k < k0; k++) {
-        float phi[3][2][2], dk;
+        LOCAL_ALIGNED_16(float, phi, [3], [2][2]);
+        float dk;
 
         dsp->autocorrelate(X_low[k], phi);
 
@@ -1580,8 +1581,9 @@ static void sbr_hf_assemble(float Y[2][38][64][2], const float X_high[64][40][2]
     for (e = 0; e < ch_data->bs_num_env; e++) {
         for (i = 2 * ch_data->t_env[e]; i < 2 * ch_data->t_env[e + 1]; i++) {
             int phi_sign = (1 - 2*(kx & 1));
-            float g_filt_tab[48], *g_filt;
-            float q_filt_tab[48], *q_filt;
+            LOCAL_ALIGNED_16(float, g_filt_tab, [48]);
+            LOCAL_ALIGNED_16(float, q_filt_tab, [48]);
+            float *g_filt, *q_filt;
 
             if (h_SL && e != e_a[0] && e != e_a[1]) {
                 g_filt = g_filt_tab;
diff --git a/libavcodec/aacsbrdata.h b/libavcodec/aacsbrdata.h
index 02491c3..fb02a77 100644
--- a/libavcodec/aacsbrdata.h
+++ b/libavcodec/aacsbrdata.h
@@ -352,7 +352,8 @@ static DECLARE_ALIGNED(16, float, sbr_qmf_window_us)[640] = {
      0.8537385600,
 };
 
-const float ff_sbr_noise_table[512][2] = {
+/* First two entries repeated at end to simplify SIMD implementations. */
+const DECLARE_ALIGNED(16, float, ff_sbr_noise_table)[][2] = {
 {-0.99948153278296, -0.59483417516607}, { 0.97113454393991, -0.67528515225647},
 { 0.14130051758487, -0.95090983575689}, {-0.47005496701697, -0.37340549728647},
 { 0.80705063769351,  0.29653668284408}, {-0.38981478896926,  0.89572605717087},
@@ -609,6 +610,7 @@ const float ff_sbr_noise_table[512][2] = {
 {-0.93412041758744,  0.41374052024363}, { 0.96063943315511,  0.93116709541280},
 { 0.97534253457837,  0.86150930812689}, { 0.99642466504163,  0.70190043427512},
 {-0.94705089665984, -0.29580042814306}, { 0.91599807087376, -0.98147830385781},
+{-0.99948153278296, -0.59483417516607}, { 0.97113454393991, -0.67528515225647},
 };
 
 #endif /* AVCODEC_AACSBRDATA_H */
diff --git a/libavcodec/sbr.h b/libavcodec/sbr.h
index 58f4b61..7d06fad 100644
--- a/libavcodec/sbr.h
+++ b/libavcodec/sbr.h
@@ -88,8 +88,8 @@ typedef struct {
     ///QMF values of the original signal
     float              W[2][32][32][2];
     ///QMF output of the HF adjustor
-    float              Y[2][38][64][2];
-    float              g_temp[42][48];
+    DECLARE_ALIGNED(16, float, Y)[2][38][64][2];
+    DECLARE_ALIGNED(16, float, g_temp)[42][48];
     float              q_temp[42][48];
     uint8_t            s_indexmapped[8][48];
     ///Envelope scalefactors
@@ -156,15 +156,15 @@ typedef struct {
     uint8_t            patch_num_subbands[6];
     uint8_t            patch_start_subband[6];
     ///QMF low frequency input to the HF generator
-    float              X_low[32][40][2];
+    DECLARE_ALIGNED(16, float, X_low)[32][40][2];
     ///QMF output of the HF generator
-    float              X_high[64][40][2];
+    DECLARE_ALIGNED(16, float, X_high)[64][40][2];
     ///QMF values of the reconstructed signal
     DECLARE_ALIGNED(16, float, X)[2][2][38][64];
     ///Zeroth coefficient used to filter the subband signals
-    float              alpha0[64][2];
+    DECLARE_ALIGNED(16, float, alpha0)[64][2];
     ///First coefficient used to filter the subband signals
-    float              alpha1[64][2];
+    DECLARE_ALIGNED(16, float, alpha1)[64][2];
     ///Dequantized envelope scalefactors, remapped
     float              e_origmapped[7][48];
     ///Dequantized noise scalefactors, remapped



More information about the ffmpeg-cvslog mailing list