diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-10 02:14:44 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-10 02:25:41 +0200 |
commit | 61930bd0d7154b6f3f8c8d2398c056c20e921652 (patch) | |
tree | 54108723e1482e5d20a152f7a46c67ea51441965 /libavutil/mips/intreadwrite.h | |
parent | 35894ebbf9bef18a31dbb90a8a8818fbdc85a184 (diff) | |
parent | c8b4a3999bc7f3732a537cdec6475918a65d6e78 (diff) | |
download | ffmpeg-61930bd0d7154b6f3f8c8d2398c056c20e921652.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (27 commits)
libxvid: Give more suitable names to libxvid-related files.
libxvid: Separate libxvid encoder from libxvid rate control code.
jpeglsdec: Remove write-only variable in ff_jpegls_decode_lse().
fate: cosmetics: lowercase some comments
fate: Give more consistent names to some RealVideo/RealAudio tests.
lavfi: add avfilter_get_audio_buffer_ref_from_arrays().
lavfi: add extended_data to AVFilterBuffer.
lavc: check that extended_data is properly set in avcodec_encode_audio2().
lavc: pad last audio frame with silence when needed.
samplefmt: add a function for filling a buffer with silence.
samplefmt: add a function for copying audio samples.
lavr: do not try to copy to uninitialized output audio data.
lavr: make avresample_read() with NULL output discard samples.
fate: split idroq audio and video into separate tests
fate: improve dependencies
fate: add convenient shorthands for ea-vp6, libavcodec, libavutil tests
fate: split some combined tests into separate audio and video tests
fate: fix dependencies for probe tests
mips: intreadwrite: fix inline asm for gcc 4.8
mips: intreadwrite: remove unnecessary inline asm
...
Conflicts:
cmdutils.h
configure
doc/APIchanges
doc/filters.texi
ffmpeg.c
ffplay.c
libavcodec/internal.h
libavcodec/jpeglsdec.c
libavcodec/libschroedingerdec.c
libavcodec/libxvid.c
libavcodec/libxvid_rc.c
libavcodec/utils.c
libavcodec/version.h
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/buffersink.h
tests/Makefile
tests/fate/aac.mak
tests/fate/audio.mak
tests/fate/demux.mak
tests/fate/ea.mak
tests/fate/image.mak
tests/fate/libavutil.mak
tests/fate/lossless-audio.mak
tests/fate/lossless-video.mak
tests/fate/microsoft.mak
tests/fate/qt.mak
tests/fate/real.mak
tests/fate/screen.mak
tests/fate/video.mak
tests/fate/voice.mak
tests/fate/vqf.mak
tests/ref/fate/ea-mad
tests/ref/fate/ea-tqi
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/mips/intreadwrite.h')
-rw-r--r-- | libavutil/mips/intreadwrite.h | 66 |
1 files changed, 7 insertions, 59 deletions
diff --git a/libavutil/mips/intreadwrite.h b/libavutil/mips/intreadwrite.h index cd4a9a9a67..9ba0491372 100644 --- a/libavutil/mips/intreadwrite.h +++ b/libavutil/mips/intreadwrite.h @@ -24,75 +24,23 @@ #include <stdint.h> #include "config.h" -#if HAVE_INLINE_ASM +#if ARCH_MIPS64 && HAVE_INLINE_ASM #define AV_RN32 AV_RN32 static av_always_inline uint32_t AV_RN32(const void *p) { + struct __attribute__((packed)) u32 { uint32_t v; }; + const uint8_t *q = p; + const struct u32 *pl = (const struct u32 *)(q + 3 * !HAVE_BIGENDIAN); + const struct u32 *pr = (const struct u32 *)(q + 3 * HAVE_BIGENDIAN); uint32_t v; __asm__ ("lwl %0, %1 \n\t" "lwr %0, %2 \n\t" : "=&r"(v) - : "m"(*(const uint32_t *)((const uint8_t *)p+3*!HAVE_BIGENDIAN)), - "m"(*(const uint32_t *)((const uint8_t *)p+3*HAVE_BIGENDIAN))); + : "m"(*pl), "m"(*pr)); return v; } -#define AV_WN32 AV_WN32 -static av_always_inline void AV_WN32(void *p, uint32_t v) -{ - __asm__ ("swl %2, %0 \n\t" - "swr %2, %1 \n\t" - : "=m"(*(uint32_t *)((uint8_t *)p+3*!HAVE_BIGENDIAN)), - "=m"(*(uint32_t *)((uint8_t *)p+3*HAVE_BIGENDIAN)) - : "r"(v)); -} - -#if ARCH_MIPS64 - -#define AV_RN64 AV_RN64 -static av_always_inline uint64_t AV_RN64(const void *p) -{ - uint64_t v; - __asm__ ("ldl %0, %1 \n\t" - "ldr %0, %2 \n\t" - : "=&r"(v) - : "m"(*(const uint64_t *)((const uint8_t *)p+7*!HAVE_BIGENDIAN)), - "m"(*(const uint64_t *)((const uint8_t *)p+7*HAVE_BIGENDIAN))); - return v; -} - -#define AV_WN64 AV_WN64 -static av_always_inline void AV_WN64(void *p, uint64_t v) -{ - __asm__ ("sdl %2, %0 \n\t" - "sdr %2, %1 \n\t" - : "=m"(*(uint64_t *)((uint8_t *)p+7*!HAVE_BIGENDIAN)), - "=m"(*(uint64_t *)((uint8_t *)p+7*HAVE_BIGENDIAN)) - : "r"(v)); -} - -#else - -#define AV_RN64 AV_RN64 -static av_always_inline uint64_t AV_RN64(const void *p) -{ - union { uint64_t v; uint32_t hl[2]; } v; - v.hl[0] = AV_RN32(p); - v.hl[1] = AV_RN32((const uint8_t *)p + 4); - return v.v; -} - -#define AV_WN64 AV_WN64 -static av_always_inline void AV_WN64(void *p, uint64_t v) -{ - union { uint64_t v; uint32_t hl[2]; } vv = { v }; - AV_WN32(p, vv.hl[0]); - AV_WN32((uint8_t *)p + 4, vv.hl[1]); -} - -#endif /* ARCH_MIPS64 */ - -#endif /* HAVE_INLINE_ASM */ +#endif /* ARCH_MIPS64 && HAVE_INLINE_ASM */ #endif /* AVUTIL_MIPS_INTREADWRITE_H */ |