summaryrefslogtreecommitdiff
path: root/libavcodec/dsputil.h
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-02-07 14:54:46 -0800
committerRonald S. Bultje <rsbultje@gmail.com>2012-02-07 14:54:46 -0800
commit9b027c0d0794b50e3b638cca4bed925638ab68bc (patch)
treeb80ff16b181cea5a942f413c4ccb54e66e51acd5 /libavcodec/dsputil.h
parent4ff6dea390be1d57817919105ee76b708e247d64 (diff)
dsputil: set STRIDE_ALIGN to 16 for x86 also.
This fixes crashes in e.g. PNG decoding with SSE2 enabled. In fact, many x86 optimizations for codecs assume that our buffer strides are 16-byte aligned.
Diffstat (limited to 'libavcodec/dsputil.h')
-rw-r--r--libavcodec/dsputil.h18
1 files changed, 2 insertions, 16 deletions
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h
index 579b54bac9..cadde7d25a 100644
--- a/libavcodec/dsputil.h
+++ b/libavcodec/dsputil.h
@@ -655,23 +655,9 @@ void ff_intrax8dsp_init(DSPContext* c, AVCodecContext *avctx);
void ff_mlp_init(DSPContext* c, AVCodecContext *avctx);
void ff_mlp_init_x86(DSPContext* c, AVCodecContext *avctx);
-#if ARCH_ARM
-
-#if HAVE_NEON
+#if (ARCH_ARM && HAVE_NEON) || ARCH_PPC || HAVE_MMI || HAVE_MMX
# define STRIDE_ALIGN 16
-#endif
-
-#elif ARCH_PPC
-
-#define STRIDE_ALIGN 16
-
-#elif HAVE_MMI
-
-#define STRIDE_ALIGN 16
-
-#endif
-
-#ifndef STRIDE_ALIGN
+#else
# define STRIDE_ALIGN 8
#endif