提交 15919ee4 编写于 作者: J Jason Garrett-Glaser 提交者: Ronald S. Bultje

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: NRonald S. Bultje <rsbultje@gmail.com>
上级 6ffd7edd
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册