aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-05-19 01:49:53 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-05-19 01:49:53 +0000
commit10fc8424234aa214a2dc40eab1c1beaefb0f3066 (patch)
treea26ded851cb844a5b265df3243052a041ef293ad
parentd4327e368f9db5301bcc14542ea4b5236a200ed6 (diff)
downloadffmpeg-10fc8424234aa214a2dc40eab1c1beaefb0f3066.tar.gz
fixing alignment for alignment picky cpus
Originally committed as revision 535 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/dsputil.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index 7e389f00f0..51aaa28975 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -249,11 +249,21 @@ void add_pixels_clamped_c(const DCTELEM *block, UINT8 *pixels, int line_size)
}
}
-//FIXME someone with a alignemtent picky cpu should change these
+#ifdef __GNUC__
+
+struct unaligned_64 { uint64_t l; } __attribute__((packed));
+struct unaligned_32 { uint32_t l; } __attribute__((packed));
+
+#define LD32(a) (((const struct unaligned_32 *) (a))->l)
+#define LD64(a) (((const struct unaligned_64 *) (a))->l)
+
+#else /* __GNUC__ */
#define LD32(a) (*((uint32_t*)(a)))
#define LD64(a) (*((uint64_t*)(a)))
+#endif /* !__GNUC__ */
+
#if 0
#define PIXOP2(OPNAME, OP) \