]>
iEval git - fdkaac.git/blob - src/m4af_endian.h
2 * Copyright (C) 2013 nu774
3 * For conditions of distribution and use, see copyright notice in COPYING
17 # define m4af_htob16(x) htobe16(x)
18 # define m4af_htob32(x) htobe32(x)
19 # define m4af_htob64(x) htobe64(x)
20 # define m4af_btoh16(x) be16toh(x)
21 # define m4af_btoh32(x) be32toh(x)
22 # define m4af_btoh64(x) be64toh(x)
23 # define m4af_htol16(x) htole16(x)
24 # define m4af_htol32(x) htole32(x)
25 # define m4af_htol64(x) htole64(x)
26 # define m4af_ltoh16(x) le16toh(x)
27 # define m4af_ltoh32(x) le32toh(x)
28 # define m4af_ltoh64(x) le64toh(x)
30 # define m4af_htob16(x) (x)
31 # define m4af_htob32(x) (x)
32 # define m4af_htob64(x) (x)
33 # define m4af_btoh16(x) (x)
34 # define m4af_btoh32(x) (x)
35 # define m4af_btoh64(x) (x)
36 # define m4af_ltoh16(x) m4af_swap16(x)
37 # define m4af_ltoh32(x) m4af_swap32(x)
38 # define m4af_ltoh64(x) m4af_swap64(x)
39 # define m4af_htol16(x) m4af_swap16(x)
40 # define m4af_htol32(x) m4af_swap32(x)
41 # define m4af_htol64(x) m4af_swap64(x)
43 # define m4af_htob16(x) m4af_swap16(x)
44 # define m4af_htob32(x) m4af_swap32(x)
45 # define m4af_htob64(x) m4af_swap64(x)
46 # define m4af_btoh16(x) m4af_swap16(x)
47 # define m4af_btoh32(x) m4af_swap32(x)
48 # define m4af_btoh64(x) m4af_swap64(x)
49 # define m4af_ltoh16(x) (x)
50 # define m4af_ltoh32(x) (x)
51 # define m4af_ltoh64(x) (x)
52 # define m4af_htol16(x) (x)
53 # define m4af_htol32(x) (x)
54 # define m4af_htol64(x) (x)
59 # define m4af_swap16(x) _byteswap_ushort(x)
60 # define m4af_swap32(x) _byteswap_ulong(x)
61 # define m4af_swap64(x) _byteswap_uint64(x)
63 # include <byteswap.h>
64 # define m4af_swap16(x) bswap_16(x)
65 # define m4af_swap32(x) bswap_32(x)
66 # define m4af_swap64(x) bswap_64(x)
68 static inline uint16_t m4af_swap16(uint16_t x
)
70 return (x
>> 8) | (x
<< 8);
73 static inline uint32_t m4af_swap32(uint32_t x
)
75 return (m4af_htob16(x
) << 16) | m4af_htob16(x
>> 16);
78 static inline uint64_t m4af_swap64(uint64_t x
)
80 return ((uint64_t)m4af_htob32(x
) << 32) | m4af_htob32(x
>> 32);
84 #endif /* M4AF_ENDIAN_H */
This page took 0.048413 seconds and 4 git commands to generate.