summaryrefslogtreecommitdiff
path: root/libavutil/bswap.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-13 00:29:25 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-13 00:39:48 +0100
commit8bc7fe4daf5c26555d77e2261c96ee14a800fad4 (patch)
tree71999a1eb8bacb609b5789b34de369ed4b049cd4 /libavutil/bswap.h
parentc83ef636a665b2e17f1b6745a98ec7a5719264df (diff)
parent58c42af722cebecd86e340dc3ed9ec44b1fe4a55 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: doxygen: misc consistency, spelling and wording fixes vcr1: drop unnecessary emms_c() calls without MMX code Replace all uses of av_close_input_file() with avformat_close_input(). lavf: add avformat_close_input(). lavf: deprecate av_close_input_stream(). lavf doxy: add some basic demuxing documentation. lavf doxy: add some general lavf information. lavf doxy: add misc utility functions to a group. lavf doxy: add av_guess_codec/format to the encoding group. lavf doxy: add core functions to a doxy group. Add basic libavdevice documentation. lavc: convert error_recognition to err_recognition. avconv: update -map option help text x86: Require 7 registers for the cabac asm x86: bswap: remove test for bswap instruction bswap: make generic implementation more compiler-friendly h264: remove useless cast proresdec: fix decode_slice() prototype Conflicts: configure doc/APIchanges ffprobe.c libavcodec/avcodec.h libavcodec/celp_math.h libavcodec/h264.c libavfilter/src_movie.c libavformat/anm.c libavformat/avformat.h libavformat/version.h libavutil/avstring.h libavutil/bswap.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/bswap.h')
-rw-r--r--libavutil/bswap.h19
1 files changed, 2 insertions, 17 deletions
diff --git a/libavutil/bswap.h b/libavutil/bswap.h
index 303bcf3532..06f654816d 100644
--- a/libavutil/bswap.h
+++ b/libavutil/bswap.h
@@ -65,29 +65,14 @@ static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
#ifndef av_bswap32
static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
{
- x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
- x= (x>>16) | (x<<16);
- return x;
+ return AV_BSWAP32C(x);
}
#endif
#ifndef av_bswap64
static inline uint64_t av_const av_bswap64(uint64_t x)
{
-#if 0
- x= ((x<< 8)&0xFF00FF00FF00FF00ULL) | ((x>> 8)&0x00FF00FF00FF00FFULL);
- x= ((x<<16)&0xFFFF0000FFFF0000ULL) | ((x>>16)&0x0000FFFF0000FFFFULL);
- return (x>>32) | (x<<32);
-#else
- union {
- uint64_t ll;
- uint32_t l[2];
- } w, r;
- w.ll = x;
- r.l[0] = av_bswap32 (w.l[1]);
- r.l[1] = av_bswap32 (w.l[0]);
- return r.ll;
-#endif
+ return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
}
#endif