Mercurial > libavutil.hg
comparison arm/bswap.h @ 993:f8db9a2bae05 libavutil
Add av_ prefix to bswap macros
author | mru |
---|---|
date | Sat, 10 Jul 2010 22:12:30 +0000 |
parents | 4d9ad0ed07d0 |
children |
comparison
equal
deleted
inserted
replaced
992:a13125b5be3a | 993:f8db9a2bae05 |
---|---|
24 #include "libavutil/attributes.h" | 24 #include "libavutil/attributes.h" |
25 | 25 |
26 #ifdef __ARMCC_VERSION | 26 #ifdef __ARMCC_VERSION |
27 | 27 |
28 #if HAVE_ARMV6 | 28 #if HAVE_ARMV6 |
29 #define bswap_16 bswap_16 | 29 #define av_bswap16 av_bswap16 |
30 static av_always_inline av_const unsigned bswap_16(unsigned x) | 30 static av_always_inline av_const unsigned av_bswap16(unsigned x) |
31 { | 31 { |
32 __asm { rev16 x, x } | 32 __asm { rev16 x, x } |
33 return x; | 33 return x; |
34 } | 34 } |
35 | 35 |
36 #define bswap_32 bswap_32 | 36 #define av_bswap32 av_bswap32 |
37 static av_always_inline av_const uint32_t bswap_32(uint32_t x) | 37 static av_always_inline av_const uint32_t av_bswap32(uint32_t x) |
38 { | 38 { |
39 return __rev(x); | 39 return __rev(x); |
40 } | 40 } |
41 #endif /* HAVE_ARMV6 */ | 41 #endif /* HAVE_ARMV6 */ |
42 | 42 |
43 #elif HAVE_INLINE_ASM | 43 #elif HAVE_INLINE_ASM |
44 | 44 |
45 #if HAVE_ARMV6 | 45 #if HAVE_ARMV6 |
46 #define bswap_16 bswap_16 | 46 #define av_bswap16 av_bswap16 |
47 static av_always_inline av_const unsigned bswap_16(unsigned x) | 47 static av_always_inline av_const unsigned av_bswap16(unsigned x) |
48 { | 48 { |
49 __asm__("rev16 %0, %0" : "+r"(x)); | 49 __asm__("rev16 %0, %0" : "+r"(x)); |
50 return x; | 50 return x; |
51 } | 51 } |
52 #endif | 52 #endif |
53 | 53 |
54 #define bswap_32 bswap_32 | 54 #define av_bswap32 av_bswap32 |
55 static av_always_inline av_const uint32_t bswap_32(uint32_t x) | 55 static av_always_inline av_const uint32_t av_bswap32(uint32_t x) |
56 { | 56 { |
57 #if HAVE_ARMV6 | 57 #if HAVE_ARMV6 |
58 __asm__("rev %0, %0" : "+r"(x)); | 58 __asm__("rev %0, %0" : "+r"(x)); |
59 #else | 59 #else |
60 uint32_t t; | 60 uint32_t t; |