[FFmpeg-cvslog] lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

Christophe Gisquet git at videolan.org
Sat Mar 14 21:58:40 CET 2015


ffmpeg | branch: master | Christophe Gisquet <christophe.gisquet at gmail.com> | Sat Mar 14 14:26:16 2015 +0100| [3814f92fd77f8f09fa6f88333b8d06512b6ced82] | committer: Michael Niedermayer

lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

The later may yield incorrect code for on-stack variables.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/dct-test.c           |    2 +-
 libavcodec/h264_loopfilter.c    |   10 +++++-----
 libavcodec/proresenc_anatoliy.c |    3 ++-
 libavcodec/vp8.c                |    2 +-
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index 30eca3e..56e1a62 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -66,7 +66,7 @@ static const struct algo fdct_tab[] = {
 };
 
 static void ff_prores_idct_wrap(int16_t *dst){
-    DECLARE_ALIGNED(16, static int16_t, qmat)[64];
+    LOCAL_ALIGNED(16, int16_t, qmat, [64]);
     int i;
 
     for(i=0; i<64; i++){
diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c
index a7b6878..c221f98 100644
--- a/libavcodec/h264_loopfilter.c
+++ b/libavcodec/h264_loopfilter.c
@@ -355,7 +355,7 @@ static av_always_inline void h264_filter_mb_fast_internal(H264Context *h,
         }
         return;
     } else {
-        LOCAL_ALIGNED_8(int16_t, bS, [2], [4][4]);
+        LOCAL_ALIGNED(8, int16_t, bS, [2], [4][4]);
         int edges;
         if( IS_8x8DCT(mb_type) && (h->cbp&7) == 7 && !chroma444 ) {
             edges = 4;
@@ -492,7 +492,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u
             int j;
 
             for(j=0; j<2; j++, mbn_xy += h->mb_stride){
-                DECLARE_ALIGNED(8, int16_t, bS)[4];
+                LOCAL_ALIGNED(8, int16_t, bS, [4]);
                 int qp;
                 if (IS_INTRA(mb_type | h->cur_pic.mb_type[mbn_xy])) {
                     AV_WN64A(bS, 0x0003000300030003ULL);
@@ -529,7 +529,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u
                 }
             }
         }else{
-            DECLARE_ALIGNED(8, int16_t, bS)[4];
+            LOCAL_ALIGNED(8, int16_t, bS, [4]);
             int qp;
 
             if( IS_INTRA(mb_type|mbm_type)) {
@@ -612,7 +612,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u
 
     /* Calculate bS */
     for( edge = 1; edge < edges; edge++ ) {
-        DECLARE_ALIGNED(8, int16_t, bS)[4];
+        LOCAL_ALIGNED(8, int16_t, bS, [4]);
         int qp;
         const int deblock_edge = !IS_8x8DCT(mb_type & (edge<<24)); // (edge&1) && IS_8x8DCT(mb_type)
 
@@ -719,7 +719,7 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint
         /* First vertical edge is different in MBAFF frames
          * There are 8 different bS to compute and 2 different Qp
          */
-        DECLARE_ALIGNED(8, int16_t, bS)[8];
+        LOCAL_ALIGNED(8, int16_t, bS, [8]);
         int qp[2];
         int bqp[2];
         int rqp[2];
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 634ff08..bf6e671 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -286,7 +286,8 @@ static int encode_slice_plane(AVCodecContext *avctx, int mb_count,
 {
     ProresContext* ctx = avctx->priv_data;
     FDCTDSPContext *fdsp = &ctx->fdsp;
-    DECLARE_ALIGNED(16, int16_t, blocks)[DEFAULT_SLICE_MB_WIDTH << 8], *block;
+    LOCAL_ALIGNED(16, int16_t, blocks, [DEFAULT_SLICE_MB_WIDTH << 8]);
+    int16_t *block;
     int i, blocks_per_slice;
     PutBitContext pb;
 
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 4b32347..8d6cbe1 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -1615,7 +1615,7 @@ void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3],
             for (x = 0; x < 4; x++) {
                 int copy = 0, linesize = s->linesize;
                 uint8_t *dst = ptr + 4 * x;
-                DECLARE_ALIGNED(4, uint8_t, copy_dst)[5 * 8];
+                LOCAL_ALIGNED(4, uint8_t, copy_dst, [5 * 8]);
 
                 if ((y == 0 || x == 3) && mb_y == 0) {
                     topright = tr_top;



More information about the ffmpeg-cvslog mailing list