[1/2] atrac3plusdsp: Use LOCAL_ALIGNED for stack variables

Message ID 1490698118-14758-1-git-send-email-martin@martin.st
State Superseded
Headers show

Commit Message

Martin Storsjö March 28, 2017, 10:48 a.m.
This fixes warnings like these with ARMCC:
alignment for an auto object may not be larger than 8
---
 libavcodec/atrac3plusdsp.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Patch

diff --git a/libavcodec/atrac3plusdsp.c b/libavcodec/atrac3plusdsp.c
index 468f098..c1a54ae 100644
--- a/libavcodec/atrac3plusdsp.c
+++ b/libavcodec/atrac3plusdsp.c
@@ -177,12 +177,14 @@  static void waves_synth(Atrac3pWaveSynthParams *synth_param,
 void ff_atrac3p_generate_tones(Atrac3pChanUnitCtx *ch_unit, AVFloatDSPContext *fdsp,
                                int ch_num, int sb, float *out)
 {
-    DECLARE_ALIGNED(32, float, wavreg1)[128] = { 0 };
-    DECLARE_ALIGNED(32, float, wavreg2)[128] = { 0 };
+    LOCAL_ALIGNED_32(float, wavreg1, [128]);
+    LOCAL_ALIGNED_32(float, wavreg2, [128]);
     int i, reg1_env_nonzero, reg2_env_nonzero;
     Atrac3pWavesData *tones_now  = &ch_unit->channels[ch_num].tones_info_prev[sb];
     Atrac3pWavesData *tones_next = &ch_unit->channels[ch_num].tones_info[sb];
 
+    memset(wavreg1, 0, sizeof(float) * 128);
+    memset(wavreg2, 0, sizeof(float) * 128);
     /* reconstruct full envelopes for both overlapping regions
      * from truncated bitstream data */
     if (tones_next->pend_env.has_start_point &&
@@ -599,8 +601,8 @@  void ff_atrac3p_ipqf(FFTContext *dct_ctx, Atrac3pIPQFChannelCtx *hist,
                      const float *in, float *out)
 {
     int i, s, sb, t, pos_now, pos_next;
-    DECLARE_ALIGNED(32, float, idct_in)[ATRAC3P_SUBBANDS];
-    DECLARE_ALIGNED(32, float, idct_out)[ATRAC3P_SUBBANDS];
+    LOCAL_ALIGNED_32(float, idct_in,  [ATRAC3P_SUBBANDS]);
+    LOCAL_ALIGNED_32(float, idct_out, [ATRAC3P_SUBBANDS]);
 
     memset(out, 0, ATRAC3P_FRAME_SAMPLES * sizeof(*out));