Re: [FFmpeg-devel] [PATCH 2/5] x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

2015-03-14 Thread Michael Niedermayer
On Sat, Mar 14, 2015 at 07:58:29PM +0100, Christophe Gisquet wrote:
 Hi,
 
 2015-03-14 19:07 GMT+01:00 Michael Niedermayer michae...@gmx.at:
   #define PR_WRAP(INSN) \
   static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \
  -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \
  -DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \
  +LOCAL_ALIGNED(16, static int16_t, qmat, [64]); \
  +LOCAL_ALIGNED(16, static int16_t, tmp, [64]); \
   int i; \
 
  LOCAL_ALIGNED + static looks unintended
 
 Same fix then.
 
 Best regards,
 Christophe

  ac3dsp_init.c  |2 +-
  cavsdsp.c  |4 ++--
  dct-test.c |4 ++--
  h264_qpel.c|   22 +++---
  rv40dsp_init.c |2 +-
  vc1dsp_mmx.c   |2 +-
  vp8dsp_init.c  |4 ++--
  7 files changed, 20 insertions(+), 20 deletions(-)
 d9bbc60366078bf5297a7c79aaf91d3ac3cc09d4  
 0002-x86-lavc-use-LOCAL_ALIGNED-instead-of-DECLARE_ALIGNE.patch
 From 93a8d803f6b87e2c5bd062724630e1d67804da29 Mon Sep 17 00:00:00 2001
 From: Christophe Gisquet christophe.gisq...@gmail.com
 Date: Sat, 14 Mar 2015 14:30:18 +0100
 Subject: [PATCH 2/3] x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
 
 The later may yield incorrect code for on-stack variables.

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/5] x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

2015-03-14 Thread Christophe Gisquet
Hi,

2015-03-14 19:07 GMT+01:00 Michael Niedermayer michae...@gmx.at:
  #define PR_WRAP(INSN) \
  static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \
 -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \
 -DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \
 +LOCAL_ALIGNED(16, static int16_t, qmat, [64]); \
 +LOCAL_ALIGNED(16, static int16_t, tmp, [64]); \
  int i; \

 LOCAL_ALIGNED + static looks unintended

Same fix then.

Best regards,
Christophe
From 93a8d803f6b87e2c5bd062724630e1d67804da29 Mon Sep 17 00:00:00 2001
From: Christophe Gisquet christophe.gisq...@gmail.com
Date: Sat, 14 Mar 2015 14:30:18 +0100
Subject: [PATCH 2/3] x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

The later may yield incorrect code for on-stack variables.
---
 libavcodec/x86/ac3dsp_init.c  |  2 +-
 libavcodec/x86/cavsdsp.c  |  4 ++--
 libavcodec/x86/dct-test.c |  4 ++--
 libavcodec/x86/h264_qpel.c| 22 +++---
 libavcodec/x86/rv40dsp_init.c |  2 +-
 libavcodec/x86/vc1dsp_mmx.c   |  2 +-
 libavcodec/x86/vp8dsp_init.c  |  4 ++--
 7 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
index 30a85f9..eea2736 100644
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/libavcodec/x86/ac3dsp_init.c
@@ -165,7 +165,7 @@ static void ac3_downmix_sse(float **samples, float (*matrix)[2],
matrix_cmp[3][0] == matrix_cmp[4][0]) {
 MIX5(IF1, IF0);
 } else {
-DECLARE_ALIGNED(16, float, matrix_simd)[AC3_MAX_CHANNELS][2][4];
+LOCAL_ALIGNED(16, float, matrix_simd, [AC3_MAX_CHANNELS], [2][4]);
 float *samp[AC3_MAX_CHANNELS];
 
 for (j = 0; j  in_ch; j++)
diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c
index 190f6ee..f142db6 100644
--- a/libavcodec/x86/cavsdsp.c
+++ b/libavcodec/x86/cavsdsp.c
@@ -139,10 +139,10 @@ static inline void cavs_idct8_1d(int16_t *block, uint64_t bias)
 static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
 {
 int i;
-DECLARE_ALIGNED(16, int16_t, b2)[64];
+LOCAL_ALIGNED(16, int16_t, b2, [64]);
 
 for(i=0; i2; i++){
-DECLARE_ALIGNED(8, uint64_t, tmp);
+LOCAL_ALIGNED(8, uint64_t, tmp);
 
 cavs_idct8_1d(block+4*i, ff_pw_4.a);
 
diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c
index d1a5067..193a69e 100644
--- a/libavcodec/x86/dct-test.c
+++ b/libavcodec/x86/dct-test.c
@@ -28,8 +28,8 @@ void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
 
 #define PR_WRAP(INSN) \
 static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \
-DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \
-DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \
+LOCAL_ALIGNED(16, int16_t, qmat, [64]); \
+LOCAL_ALIGNED(16, int16_t, tmp, [64]); \
 int i; \
  \
 for(i=0; i64; i++){ \
diff --git a/libavcodec/x86/h264_qpel.c b/libavcodec/x86/h264_qpel.c
index b4cb9b1..33a7fb0 100644
--- a/libavcodec/x86/h264_qpel.c
+++ b/libavcodec/x86/h264_qpel.c
@@ -282,7 +282,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, const uin
 #define H264_MC_V(OPNAME, SIZE, MMX, ALIGN) \
 static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
 ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, temp, stride, stride, SIZE);\
 }\
@@ -294,7 +294,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, const uin
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
 ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, temp, stride, stride, SIZE);\
 }\
@@ -302,41 +302,41 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, const uin
 #define H264_MC_HV(OPNAME, SIZE, MMX, ALIGN) \
 static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\
 }\
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\
 ff_ ## OPNAME ## 

[FFmpeg-devel] [PATCH 2/5] x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

2015-03-14 Thread Christophe Gisquet
The later may yield incorrect code for on-stack variables.
---
 libavcodec/x86/ac3dsp_init.c  |  2 +-
 libavcodec/x86/cavsdsp.c  |  4 ++--
 libavcodec/x86/dct-test.c |  4 ++--
 libavcodec/x86/h264_qpel.c| 22 +++---
 libavcodec/x86/rv40dsp_init.c |  2 +-
 libavcodec/x86/vc1dsp_mmx.c   |  2 +-
 libavcodec/x86/vp8dsp_init.c  |  4 ++--
 7 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
index 30a85f9..eea2736 100644
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/libavcodec/x86/ac3dsp_init.c
@@ -165,7 +165,7 @@ static void ac3_downmix_sse(float **samples, float 
(*matrix)[2],
matrix_cmp[3][0] == matrix_cmp[4][0]) {
 MIX5(IF1, IF0);
 } else {
-DECLARE_ALIGNED(16, float, matrix_simd)[AC3_MAX_CHANNELS][2][4];
+LOCAL_ALIGNED(16, float, matrix_simd, [AC3_MAX_CHANNELS], [2][4]);
 float *samp[AC3_MAX_CHANNELS];
 
 for (j = 0; j  in_ch; j++)
diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c
index 190f6ee..f142db6 100644
--- a/libavcodec/x86/cavsdsp.c
+++ b/libavcodec/x86/cavsdsp.c
@@ -139,10 +139,10 @@ static inline void cavs_idct8_1d(int16_t *block, uint64_t 
bias)
 static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride)
 {
 int i;
-DECLARE_ALIGNED(16, int16_t, b2)[64];
+LOCAL_ALIGNED(16, int16_t, b2, [64]);
 
 for(i=0; i2; i++){
-DECLARE_ALIGNED(8, uint64_t, tmp);
+LOCAL_ALIGNED(8, uint64_t, tmp);
 
 cavs_idct8_1d(block+4*i, ff_pw_4.a);
 
diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c
index d1a5067..8e8da0c 100644
--- a/libavcodec/x86/dct-test.c
+++ b/libavcodec/x86/dct-test.c
@@ -28,8 +28,8 @@ void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
 
 #define PR_WRAP(INSN) \
 static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \
-DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \
-DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \
+LOCAL_ALIGNED(16, static int16_t, qmat, [64]); \
+LOCAL_ALIGNED(16, static int16_t, tmp, [64]); \
 int i; \
  \
 for(i=0; i64; i++){ \
diff --git a/libavcodec/x86/h264_qpel.c b/libavcodec/x86/h264_qpel.c
index b4cb9b1..33a7fb0 100644
--- a/libavcodec/x86/h264_qpel.c
+++ b/libavcodec/x86/h264_qpel.c
@@ -282,7 +282,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## 
MMX(uint8_t *dst, const uin
 #define H264_MC_V(OPNAME, SIZE, MMX, ALIGN) \
 static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, const 
uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
 ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, temp, stride, 
stride, SIZE);\
 }\
@@ -294,7 +294,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## 
MMX(uint8_t *dst, const uin
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, const 
uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
 ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, temp, 
stride, stride, SIZE);\
 }\
@@ -302,41 +302,41 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## 
MMX(uint8_t *dst, const uin
 #define H264_MC_HV(OPNAME, SIZE, MMX, ALIGN) \
 static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, const 
uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, 
temp, stride, SIZE);\
 }\
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, const 
uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\
 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, 
temp, stride, SIZE);\
 }\
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, const 
uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\
 ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\
 ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, 
src+stride, temp, stride, SIZE);\
 }\
 \
 static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## MMX(uint8_t *dst, const 
uint8_t *src, ptrdiff_t stride)\
 {\
-DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\
+LOCAL_ALIGNED(ALIGN, 

Re: [FFmpeg-devel] [PATCH 2/5] x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED

2015-03-14 Thread Michael Niedermayer
On Sat, Mar 14, 2015 at 03:30:25PM +, Christophe Gisquet wrote:
 The later may yield incorrect code for on-stack variables.
 ---
  libavcodec/x86/ac3dsp_init.c  |  2 +-
  libavcodec/x86/cavsdsp.c  |  4 ++--
  libavcodec/x86/dct-test.c |  4 ++--
  libavcodec/x86/h264_qpel.c| 22 +++---
  libavcodec/x86/rv40dsp_init.c |  2 +-
  libavcodec/x86/vc1dsp_mmx.c   |  2 +-
  libavcodec/x86/vp8dsp_init.c  |  4 ++--
  7 files changed, 20 insertions(+), 20 deletions(-)
[...]
 diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c
 index d1a5067..8e8da0c 100644
 --- a/libavcodec/x86/dct-test.c
 +++ b/libavcodec/x86/dct-test.c
 @@ -28,8 +28,8 @@ void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
  
  #define PR_WRAP(INSN) \
  static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \
 -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \
 -DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \
 +LOCAL_ALIGNED(16, static int16_t, qmat, [64]); \
 +LOCAL_ALIGNED(16, static int16_t, tmp, [64]); \
  int i; \

LOCAL_ALIGNED + static looks unintended

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct answer.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel