Mercurial > libavutil.hg
changeset 371:30e766822b5a libavutil
* renaming (ST|LD)(16|32|64) -> AV_(R|W)N(16|32|64)
author | romansh |
---|---|
date | Thu, 09 Aug 2007 17:01:15 +0000 |
parents | de3dc287f939 |
children | 317edea5d1a8 |
files | intreadwrite.h |
diffstat | 1 files changed, 36 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/intreadwrite.h Thu Aug 09 00:12:40 2007 +0000 +++ b/intreadwrite.h Thu Aug 09 17:01:15 2007 +0000 @@ -28,23 +28,23 @@ struct unaligned_32 { uint32_t l; } __attribute__((packed)); struct unaligned_16 { uint16_t l; } __attribute__((packed)); -#define LD16(a) (((const struct unaligned_16 *) (a))->l) -#define LD32(a) (((const struct unaligned_32 *) (a))->l) -#define LD64(a) (((const struct unaligned_64 *) (a))->l) +#define AV_RN16(a) (((const struct unaligned_16 *) (a))->l) +#define AV_RN32(a) (((const struct unaligned_32 *) (a))->l) +#define AV_RN64(a) (((const struct unaligned_64 *) (a))->l) -#define ST16(a, b) (((struct unaligned_16 *) (a))->l) = (b) -#define ST32(a, b) (((struct unaligned_32 *) (a))->l) = (b) -#define ST64(a, b) (((struct unaligned_64 *) (a))->l) = (b) +#define AV_WN16(a, b) (((struct unaligned_16 *) (a))->l) = (b) +#define AV_WN32(a, b) (((struct unaligned_32 *) (a))->l) = (b) +#define AV_WN64(a, b) (((struct unaligned_64 *) (a))->l) = (b) #else /* __GNUC__ */ -#define LD16(a) (*((uint16_t*)(a))) -#define LD32(a) (*((uint32_t*)(a))) -#define LD64(a) (*((uint64_t*)(a))) +#define AV_RN16(a) (*((uint16_t*)(a))) +#define AV_RN32(a) (*((uint32_t*)(a))) +#define AV_RN64(a) (*((uint64_t*)(a))) -#define ST16(a, b) *((uint16_t*)(a)) = (b) -#define ST32(a, b) *((uint32_t*)(a)) = (b) -#define ST64(a, b) *((uint64_t*)(a)) = (b) +#define AV_WN16(a, b) *((uint16_t*)(a)) = (b) +#define AV_WN32(a, b) *((uint32_t*)(a)) = (b) +#define AV_WN64(a, b) *((uint64_t*)(a)) = (b) #endif /* !__GNUC__ */ @@ -57,17 +57,17 @@ #ifdef HAVE_FAST_UNALIGNED # ifdef WORDS_BIGENDIAN -# define AV_RB16(x) LD16(x) -# define AV_WB16(p, d) ST16(p, d) +# define AV_RB16(x) AV_RN16(x) +# define AV_WB16(p, d) AV_WN16(p, d) -# define AV_RL16(x) bswap_16(LD16(x)) -# define AV_WL16(p, d) ST16(p, bswap_16(d)) +# define AV_RL16(x) bswap_16(AV_RN16(x)) +# define AV_WL16(p, d) AV_WN16(p, bswap_16(d)) # else /* WORDS_BIGENDIAN */ -# define AV_RB16(x) bswap_16(LD16(x)) -# define AV_WB16(p, d) ST16(p, bswap_16(d)) +# define AV_RB16(x) bswap_16(AV_RN16(x)) +# define AV_WB16(p, d) AV_WN16(p, bswap_16(d)) -# define AV_RL16(x) LD16(x) -# define AV_WL16(p, d) ST16(p, d) +# define AV_RL16(x) AV_RN16(x) +# define AV_WL16(p, d) AV_WN16(p, d) # endif #else /* HAVE_FAST_UNALIGNED */ #define AV_RB16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) @@ -100,17 +100,17 @@ #ifdef HAVE_FAST_UNALIGNED # ifdef WORDS_BIGENDIAN -# define AV_RB32(x) LD32(x) -# define AV_WB32(p, d) ST32(p, d) +# define AV_RB32(x) AV_RN32(x) +# define AV_WB32(p, d) AV_WN32(p, d) -# define AV_RL32(x) bswap_32(LD32(x)) -# define AV_WL32(p, d) ST32(p, bswap_32(d)) +# define AV_RL32(x) bswap_32(AV_RN32(x)) +# define AV_WL32(p, d) AV_WN32(p, bswap_32(d)) # else /* WORDS_BIGENDIAN */ -# define AV_RB32(x) bswap_32(LD32(x)) -# define AV_WB32(p, d) ST32(p, bswap_32(d)) +# define AV_RB32(x) bswap_32(AV_RN32(x)) +# define AV_WB32(p, d) AV_WN32(p, bswap_32(d)) -# define AV_RL32(x) LD32(x) -# define AV_WL32(p, d) ST32(p, d) +# define AV_RL32(x) AV_RN32(x) +# define AV_WL32(p, d) AV_WN32(p, d) # endif #else /* HAVE_FAST_UNALIGNED */ #define AV_RB32(x) ((((uint8_t*)(x))[0] << 24) | \ @@ -136,17 +136,17 @@ #ifdef HAVE_FAST_UNALIGNED # ifdef WORDS_BIGENDIAN -# define AV_RB64(x) LD64(x) -# define AV_WB64(p, d) ST64(p, d) +# define AV_RB64(x) AV_RN64(x) +# define AV_WB64(p, d) AV_WN64(p, d) -# define AV_RL64(x) bswap_64(LD64(x)) -# define AV_WL64(p, d) ST64(p, bswap_64(d)) +# define AV_RL64(x) bswap_64(AV_RN64(x)) +# define AV_WL64(p, d) AV_WN64(p, bswap_64(d)) # else /* WORDS_BIGENDIAN */ -# define AV_RB64(x) bswap_64(LD64(x)) -# define AV_WB64(p, d) ST64(p, bswap_64(d)) +# define AV_RB64(x) bswap_64(AV_RN64(x)) +# define AV_WB64(p, d) AV_WN64(p, bswap_64(d)) -# define AV_RL64(x) LD64(x) -# define AV_WL64(p, d) ST64(p, d) +# define AV_RL64(x) AV_RN64(x) +# define AV_WL64(p, d) AV_WN64(p, d) # endif #else /* HAVE_FAST_UNALIGNED */ #define AV_RB64(x) (((uint64_t)((uint8_t*)(x))[0] << 56) | \