diff options
author | Marc Hoffman <mmh@pleasantst.com> | 2007-04-24 23:21:29 +0000 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2007-04-24 23:21:29 +0000 |
commit | 20d45dc2a8c3e4eb133b7947122d5c2ad7d3d79c (patch) | |
tree | 2840828b1579203ae11a3e7dbd0b4711deb8a620 /libavutil | |
parent | 6baa294326a4b0986fe3cd1beb8a53258a91f065 (diff) | |
download | ffmpeg-streaming-20d45dc2a8c3e4eb133b7947122d5c2ad7d3d79c.zip ffmpeg-streaming-20d45dc2a8c3e4eb133b7947122d5c2ad7d3d79c.tar.gz |
Faster 32 bit byteswaping code for Blackfin.
200% faster on BF537 compiled with gcc 4.1.
patch by Marc Hoffman, mmh pleasantst com
Originally committed as revision 8802 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/bswap.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavutil/bswap.h b/libavutil/bswap.h index 03d613d..8ef01b2 100644 --- a/libavutil/bswap.h +++ b/libavutil/bswap.h @@ -125,6 +125,18 @@ static av_always_inline uint32_t bswap_32(uint32_t x){ : "+r"(x), "+r"(t)); return x; } + +#elif defined(ARCH_BFIN) +static av_always_inline uint32_t bswap_32(uint32_t x){ + unsigned tmp; + asm("%1 = %0 >> 8 (V);\n\t" + "%0 = %0 << 8 (V);\n\t" + "%0 = %0 | %1;\n\t" + "%0 = PACK(%0.L, %0.H);\n\t" + : "+d"(x), "=&d"(tmp)); + return x; +} + #else static av_always_inline uint32_t bswap_32(uint32_t x){ x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); |