summaryrefslogtreecommitdiff
path: root/libavutil/x86/bswap.h
diff options
context:
space:
mode:
authorJason Garrett-Glaser <jason@x264.com>2011-04-22 17:59:55 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2011-04-22 20:05:48 -0400
commit15919ee48f507a4ca17147e7247f5cb68f752c2c (patch)
tree59b0a98820c3682cefc2ccca67c1255f1697cd00 /libavutil/x86/bswap.h
parent6ffd7eddb832a21f51661038620ef655640ee83f (diff)
bswap: use native types for av_bwap16().
This prevents a call to bytestream_get_be16() using a movzwl both before and after the ror instruction, which is obviously inefficient. Arm uses the same trick also. Sintel decoding goes from (avg+SD) 9.856 +/- 0.003 to 9.797 +/- 0.003 sec. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavutil/x86/bswap.h')
-rw-r--r--libavutil/x86/bswap.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavutil/x86/bswap.h b/libavutil/x86/bswap.h
index 28e3fecb1b..b60d9ccd6c 100644
--- a/libavutil/x86/bswap.h
+++ b/libavutil/x86/bswap.h
@@ -29,9 +29,9 @@
#include "libavutil/attributes.h"
#define av_bswap16 av_bswap16
-static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
+static av_always_inline av_const unsigned av_bswap16(unsigned x)
{
- __asm__("rorw $8, %0" : "+r"(x));
+ __asm__("rorw $8, %w0" : "+r"(x));
return x;
}