diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-02 23:12:34 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-02 23:12:34 +0400 |
commit | 2330eb147412b96bef148b120e5a3897c9c87858 (patch) | |
tree | f53aa47a22318e11b2b2cc39784798a9cd3aa9cf /libavutil/arm | |
parent | 2cda0429aa764d157569d7534777c58dac8a4962 (diff) | |
parent | ababec7b95d84e911ecda6056e8b8c90287a6e7a (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
arm: intreadwrite: disable inline asm for gcc 4.7 and later
arm: intreadwrite: fix inline asm constraints for gcc 4.6 and later
indeo3: fix motion vector validation
pcm_bluray: set bits_per_raw_sample for > 16-bit
twinvq: fix out of bounds array access
lavr: use 8.8 instead of 10.6 as the 16-bit fixed-point mixing coeff type
Conflicts:
doc/APIchanges
libavcodec/indeo3.c
libavcodec/pcm-mpeg.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/arm')
-rw-r--r-- | libavutil/arm/intreadwrite.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libavutil/arm/intreadwrite.h b/libavutil/arm/intreadwrite.h index 0292aabafd..4a19a0cc22 100644 --- a/libavutil/arm/intreadwrite.h +++ b/libavutil/arm/intreadwrite.h @@ -21,14 +21,20 @@ #include <stdint.h> #include "config.h" +#include "libavutil/attributes.h" -#if HAVE_FAST_UNALIGNED && HAVE_INLINE_ASM +#if HAVE_FAST_UNALIGNED && HAVE_INLINE_ASM && !AV_GCC_VERSION_AT_LEAST(4,7) #define AV_RN16 AV_RN16 static av_always_inline unsigned AV_RN16(const void *p) { + const uint8_t *q = p; unsigned v; - __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(*(const uint16_t *)p)); +#ifdef __thumb__ + __asm__ ("ldrh %0, %1" : "=r"(v) : "m"(q[0]), "m"(q[1])); +#else + __asm__ ("ldrh %0, %1" : "=r"(v) : "Uq"(q[0]), "m"(q[1])); +#endif return v; } @@ -41,8 +47,9 @@ static av_always_inline void AV_WN16(void *p, uint16_t v) #define AV_RN32 AV_RN32 static av_always_inline uint32_t AV_RN32(const void *p) { + const struct __attribute__((packed)) { uint32_t v; } *q = p; uint32_t v; - __asm__ ("ldr %0, %1" : "=r"(v) : "m"(*(const uint32_t *)p)); + __asm__ ("ldr %0, %1" : "=r"(v) : "m"(*q)); return v; } @@ -55,11 +62,12 @@ static av_always_inline void AV_WN32(void *p, uint32_t v) #define AV_RN64 AV_RN64 static av_always_inline uint64_t AV_RN64(const void *p) { + const struct __attribute__((packed)) { uint32_t v; } *q = p; uint64_t v; __asm__ ("ldr %Q0, %1 \n\t" "ldr %R0, %2 \n\t" : "=&r"(v) - : "m"(*(const uint32_t*)p), "m"(*((const uint32_t*)p+1))); + : "m"(q[0]), "m"(q[1])); return v; } |