diff options
author | Måns Rullgård <mans@mansr.com> | 2010-07-10 22:09:01 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-07-10 22:09:01 +0000 |
commit | e6b22522c94cfccda97018e52ab65da8c69d8a56 (patch) | |
tree | 4ecb09a4ae3f895d70ab882d841347d943eef0a2 /libavutil | |
parent | 6b7917ba3ba16cbbcc81d9e007b26f82dd06400f (diff) | |
download | ffmpeg-e6b22522c94cfccda97018e52ab65da8c69d8a56.tar.gz |
bswap: change ME to NE in macro names
Other parts of FFmpeg use NE (native endian) rather than ME (machine).
This makes it consistent.
Originally committed as revision 24169 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/bswap.h | 48 | ||||
-rw-r--r-- | libavutil/crc.c | 2 | ||||
-rw-r--r-- | libavutil/des.c | 8 | ||||
-rw-r--r-- | libavutil/md5.c | 4 | ||||
-rw-r--r-- | libavutil/sha.c | 6 |
5 files changed, 34 insertions, 34 deletions
diff --git a/libavutil/bswap.h b/libavutil/bswap.h index 6dd2a3511a..aee04abd96 100644 --- a/libavutil/bswap.h +++ b/libavutil/bswap.h @@ -85,34 +85,34 @@ static inline uint64_t av_const bswap_64(uint64_t x) } #endif -// be2me ... big-endian to machine-endian -// le2me ... little-endian to machine-endian +// be2ne ... big-endian to native-endian +// le2ne ... little-endian to native-endian #if HAVE_BIGENDIAN -#define be2me_16(x) (x) -#define be2me_32(x) (x) -#define be2me_64(x) (x) -#define le2me_16(x) bswap_16(x) -#define le2me_32(x) bswap_32(x) -#define le2me_64(x) bswap_64(x) -#define AV_BE2MEC(s, x) (x) -#define AV_LE2MEC(s, x) AV_BSWAPC(s, x) +#define be2ne_16(x) (x) +#define be2ne_32(x) (x) +#define be2ne_64(x) (x) +#define le2ne_16(x) bswap_16(x) +#define le2ne_32(x) bswap_32(x) +#define le2ne_64(x) bswap_64(x) +#define AV_BE2NEC(s, x) (x) +#define AV_LE2NEC(s, x) AV_BSWAPC(s, x) #else -#define be2me_16(x) bswap_16(x) -#define be2me_32(x) bswap_32(x) -#define be2me_64(x) bswap_64(x) -#define le2me_16(x) (x) -#define le2me_32(x) (x) -#define le2me_64(x) (x) -#define AV_BE2MEC(s, x) AV_BSWAPC(s, x) -#define AV_LE2MEC(s, x) (x) +#define be2ne_16(x) bswap_16(x) +#define be2ne_32(x) bswap_32(x) +#define be2ne_64(x) bswap_64(x) +#define le2ne_16(x) (x) +#define le2ne_32(x) (x) +#define le2ne_64(x) (x) +#define AV_BE2NEC(s, x) AV_BSWAPC(s, x) +#define AV_LE2NEC(s, x) (x) #endif -#define AV_BE2ME16C(x) AV_BE2MEC(16, x) -#define AV_BE2ME32C(x) AV_BE2MEC(32, x) -#define AV_BE2ME64C(x) AV_BE2MEC(64, x) -#define AV_LE2ME16C(x) AV_LE2MEC(16, x) -#define AV_LE2ME32C(x) AV_LE2MEC(32, x) -#define AV_LE2ME64C(x) AV_LE2MEC(64, x) +#define AV_BE2NE16C(x) AV_BE2NEC(16, x) +#define AV_BE2NE32C(x) AV_BE2NEC(32, x) +#define AV_BE2NE64C(x) AV_BE2NEC(64, x) +#define AV_LE2NE16C(x) AV_LE2NEC(16, x) +#define AV_LE2NE32C(x) AV_LE2NEC(32, x) +#define AV_LE2NE64C(x) AV_LE2NEC(64, x) #endif /* AVUTIL_BSWAP_H */ diff --git a/libavutil/crc.c b/libavutil/crc.c index 54133e70e1..4cad981632 100644 --- a/libavutil/crc.c +++ b/libavutil/crc.c @@ -121,7 +121,7 @@ uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t le crc = ctx[((uint8_t)crc) ^ *buffer++] ^ (crc >> 8); while(buffer<end-3){ - crc ^= le2me_32(*(const uint32_t*)buffer); buffer+=4; + crc ^= le2ne_32(*(const uint32_t*)buffer); buffer+=4; crc = ctx[3*256 + ( crc &0xFF)] ^ctx[2*256 + ((crc>>8 )&0xFF)] ^ctx[1*256 + ((crc>>16)&0xFF)] diff --git a/libavutil/des.c b/libavutil/des.c index ab66a0b59d..45913425f3 100644 --- a/libavutil/des.c +++ b/libavutil/des.c @@ -297,10 +297,10 @@ int av_des_init(AVDES *d, const uint8_t *key, int key_bits, int decrypt) { } void av_des_crypt(AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt) { - uint64_t iv_val = iv ? be2me_64(*(uint64_t *)iv) : 0; + uint64_t iv_val = iv ? be2ne_64(*(uint64_t *)iv) : 0; while (count-- > 0) { uint64_t dst_val; - uint64_t src_val = src ? be2me_64(*(const uint64_t *)src) : 0; + uint64_t src_val = src ? be2ne_64(*(const uint64_t *)src) : 0; if (decrypt) { uint64_t tmp = src_val; if (d->triple_des) { @@ -317,12 +317,12 @@ void av_des_crypt(AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t } iv_val = iv ? dst_val : 0; } - *(uint64_t *)dst = be2me_64(dst_val); + *(uint64_t *)dst = be2ne_64(dst_val); src += 8; dst += 8; } if (iv) - *(uint64_t *)iv = be2me_64(iv_val); + *(uint64_t *)iv = be2ne_64(iv_val); } #ifdef TEST diff --git a/libavutil/md5.c b/libavutil/md5.c index 39ee6242e5..b7eee730dc 100644 --- a/libavutil/md5.c +++ b/libavutil/md5.c @@ -141,7 +141,7 @@ void av_md5_update(AVMD5 *ctx, const uint8_t *src, const int len){ void av_md5_final(AVMD5 *ctx, uint8_t *dst){ int i; - uint64_t finalcount= le2me_64(ctx->len<<3); + uint64_t finalcount= le2ne_64(ctx->len<<3); av_md5_update(ctx, "\200", 1); while((ctx->len & 63)!=56) @@ -150,7 +150,7 @@ void av_md5_final(AVMD5 *ctx, uint8_t *dst){ av_md5_update(ctx, (uint8_t*)&finalcount, 8); for(i=0; i<4; i++) - ((uint32_t*)dst)[i]= le2me_32(ctx->ABCD[3-i]); + ((uint32_t*)dst)[i]= le2ne_32(ctx->ABCD[3-i]); } void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len){ diff --git a/libavutil/sha.c b/libavutil/sha.c index 5a3b57535f..f89ea52a5f 100644 --- a/libavutil/sha.c +++ b/libavutil/sha.c @@ -43,7 +43,7 @@ const int av_sha_size = sizeof(AVSHA); #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) /* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ -#define blk0(i) (block[i] = be2me_32(((const uint32_t*)buffer)[i])) +#define blk0(i) (block[i] = be2ne_32(((const uint32_t*)buffer)[i])) #define blk(i) (block[i] = rol(block[i-3] ^ block[i-8] ^ block[i-14] ^ block[i-16], 1)) #define R0(v,w,x,y,z,i) z += ((w&(x^y))^y) + blk0(i) + 0x5A827999 + rol(v, 5); w = rol(w, 30); @@ -68,7 +68,7 @@ static void sha1_transform(uint32_t state[5], const uint8_t buffer[64]) for (i = 0; i < 80; i++) { int t; if (i < 16) - t = be2me_32(((uint32_t*)buffer)[i]); + t = be2ne_32(((uint32_t*)buffer)[i]); else t = rol(block[i-3] ^ block[i-8] ^ block[i-14] ^ block[i-16], 1); block[i] = t; @@ -314,7 +314,7 @@ void av_sha_update(AVSHA* ctx, const uint8_t* data, unsigned int len) void av_sha_final(AVSHA* ctx, uint8_t *digest) { int i; - uint64_t finalcount = be2me_64(ctx->count << 3); + uint64_t finalcount = be2ne_64(ctx->count << 3); av_sha_update(ctx, "\200", 1); while ((ctx->count & 63) != 56) |