Revision 547b7bcb libavutil/bswap.h

View differences:

libavutil/bswap.h
42 42
#   include "x86/bswap.h"
43 43
#endif
44 44

  
45
#define AV_BSWAP16C(x) (((x) << 8 & 0xff00)  | ((x) >> 8 & 0x00ff))
46
#define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C(x >> 16))
47
#define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C(x >> 32))
48

  
49
#define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
50

  
45 51
#ifndef bswap_16
46 52
static av_always_inline av_const uint16_t bswap_16(uint16_t x)
47 53
{
......
89 95
#define le2me_16(x) bswap_16(x)
90 96
#define le2me_32(x) bswap_32(x)
91 97
#define le2me_64(x) bswap_64(x)
98
#define AV_BE2MEC(s, x) (x)
99
#define AV_LE2MEC(s, x) AV_BSWAPC(s, x)
92 100
#else
93 101
#define be2me_16(x) bswap_16(x)
94 102
#define be2me_32(x) bswap_32(x)
......
96 104
#define le2me_16(x) (x)
97 105
#define le2me_32(x) (x)
98 106
#define le2me_64(x) (x)
107
#define AV_BE2MEC(s, x) AV_BSWAPC(s, x)
108
#define AV_LE2MEC(s, x) (x)
99 109
#endif
100 110

  
111
#define AV_BE2ME16C(x) AV_BE2MEC(16, x)
112
#define AV_BE2ME32C(x) AV_BE2MEC(32, x)
113
#define AV_BE2ME64C(x) AV_BE2MEC(64, x)
114
#define AV_LE2ME16C(x) AV_LE2MEC(16, x)
115
#define AV_LE2ME32C(x) AV_LE2MEC(32, x)
116
#define AV_LE2ME64C(x) AV_LE2MEC(64, x)
117

  
101 118
#endif /* AVUTIL_BSWAP_H */

Also available in: Unified diff