Mercurial > mplayer.hg
comparison liba52/bitstream.h @ 27454:2eb96f52529a
Drop av_always_inline definition. It is duplicated from libavutil and
unlikely to make any difference. This reduces the diff to upstream.
author | diego |
---|---|
date | Tue, 26 Aug 2008 22:38:12 +0000 |
parents | bbcf29a2733d |
children | 25337a2147e7 |
comparison
equal
deleted
inserted
replaced
27453:bbcf29a2733d | 27454:2eb96f52529a |
---|---|
24 * along with this program; if not, write to the Free Software | 24 * along with this program; if not, write to the Free Software |
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
26 */ | 26 */ |
27 | 27 |
28 /* code from ffmpeg/libavcodec */ | 28 /* code from ffmpeg/libavcodec */ |
29 #if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC_ == 3 && __GNUC_MINOR__ > 0) | |
30 # define av_always_inline __attribute__((always_inline)) inline | |
31 #else | |
32 # define av_always_inline inline | |
33 #endif | |
34 | |
35 #if defined(__sparc__) || defined(hpux) | 29 #if defined(__sparc__) || defined(hpux) |
36 /* | 30 /* |
37 * the alt bitstream reader performs unaligned memory accesses; that doesn't work | 31 * the alt bitstream reader performs unaligned memory accesses; that doesn't work |
38 * on sparc/hpux. For now, disable ALT_BITSTREAM_READER. | 32 * on sparc/hpux. For now, disable ALT_BITSTREAM_READER. |
39 */ | 33 */ |
45 /* used to avoid misaligned exceptions on some archs (alpha, ...) */ | 39 /* used to avoid misaligned exceptions on some archs (alpha, ...) */ |
46 #if defined (ARCH_X86) || defined(HAVE_ARMV6) | 40 #if defined (ARCH_X86) || defined(HAVE_ARMV6) |
47 # define unaligned32(a) (*(uint32_t*)(a)) | 41 # define unaligned32(a) (*(uint32_t*)(a)) |
48 #else | 42 #else |
49 # ifdef __GNUC__ | 43 # ifdef __GNUC__ |
50 static av_always_inline uint32_t unaligned32(const void *v) { | 44 static inline uint32_t unaligned32(const void *v) { |
51 struct Unaligned { | 45 struct Unaligned { |
52 uint32_t i; | 46 uint32_t i; |
53 } __attribute__((packed)); | 47 } __attribute__((packed)); |
54 | 48 |
55 return ((const struct Unaligned *) v)->i; | 49 return ((const struct Unaligned *) v)->i; |
84 } | 78 } |
85 | 79 |
86 # else | 80 # else |
87 | 81 |
88 # define swab32(x) __generic_swab32(x) | 82 # define swab32(x) __generic_swab32(x) |
89 static av_always_inline const uint32_t __generic_swab32(uint32_t x) | 83 static inline const uint32_t __generic_swab32(uint32_t x) |
90 { | 84 { |
91 return ((((uint8_t*)&x)[0] << 24) | (((uint8_t*)&x)[1] << 16) | | 85 return ((((uint8_t*)&x)[0] << 24) | (((uint8_t*)&x)[1] << 16) | |
92 (((uint8_t*)&x)[2] << 8) | (((uint8_t*)&x)[3])); | 86 (((uint8_t*)&x)[2] << 8) | (((uint8_t*)&x)[3])); |
93 } | 87 } |
94 # endif | 88 # endif |