Commit 5d7a0c80 authored by romansh's avatar romansh

* renaming (ST|LD)(16|32|64) -> AV_(R|W)N(16|32|64)




git-svn-id: file:///var/local/repositories/ffmpeg/trunk@10023 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 4b5e026a
...@@ -212,7 +212,7 @@ void ff_cavs_load_intra_pred_chroma(AVSContext *h) { ...@@ -212,7 +212,7 @@ void ff_cavs_load_intra_pred_chroma(AVSContext *h) {
static void intra_pred_vert(uint8_t *d,uint8_t *top,uint8_t *left,int stride) { static void intra_pred_vert(uint8_t *d,uint8_t *top,uint8_t *left,int stride) {
int y; int y;
uint64_t a = LD64(&top[1]); uint64_t a = AV_RN64(&top[1]);
for(y=0;y<8;y++) { for(y=0;y<8;y++) {
*((uint64_t *)(d+y*stride)) = a; *((uint64_t *)(d+y*stride)) = a;
} }
......
This diff is collapsed.
...@@ -675,7 +675,7 @@ static inline void copy_block2(uint8_t *dst, uint8_t *src, int dstStride, int sr ...@@ -675,7 +675,7 @@ static inline void copy_block2(uint8_t *dst, uint8_t *src, int dstStride, int sr
int i; int i;
for(i=0; i<h; i++) for(i=0; i<h; i++)
{ {
ST16(dst , LD16(src )); AV_WN16(dst , AV_RN16(src ));
dst+=dstStride; dst+=dstStride;
src+=srcStride; src+=srcStride;
} }
...@@ -686,7 +686,7 @@ static inline void copy_block4(uint8_t *dst, uint8_t *src, int dstStride, int sr ...@@ -686,7 +686,7 @@ static inline void copy_block4(uint8_t *dst, uint8_t *src, int dstStride, int sr
int i; int i;
for(i=0; i<h; i++) for(i=0; i<h; i++)
{ {
ST32(dst , LD32(src )); AV_WN32(dst , AV_RN32(src ));
dst+=dstStride; dst+=dstStride;
src+=srcStride; src+=srcStride;
} }
...@@ -697,8 +697,8 @@ static inline void copy_block8(uint8_t *dst, uint8_t *src, int dstStride, int sr ...@@ -697,8 +697,8 @@ static inline void copy_block8(uint8_t *dst, uint8_t *src, int dstStride, int sr
int i; int i;
for(i=0; i<h; i++) for(i=0; i<h; i++)
{ {
ST32(dst , LD32(src )); AV_WN32(dst , AV_RN32(src ));
ST32(dst+4 , LD32(src+4 )); AV_WN32(dst+4 , AV_RN32(src+4 ));
dst+=dstStride; dst+=dstStride;
src+=srcStride; src+=srcStride;
} }
...@@ -709,8 +709,8 @@ static inline void copy_block9(uint8_t *dst, uint8_t *src, int dstStride, int sr ...@@ -709,8 +709,8 @@ static inline void copy_block9(uint8_t *dst, uint8_t *src, int dstStride, int sr
int i; int i;
for(i=0; i<h; i++) for(i=0; i<h; i++)
{ {
ST32(dst , LD32(src )); AV_WN32(dst , AV_RN32(src ));
ST32(dst+4 , LD32(src+4 )); AV_WN32(dst+4 , AV_RN32(src+4 ));
dst[8]= src[8]; dst[8]= src[8];
dst+=dstStride; dst+=dstStride;
src+=srcStride; src+=srcStride;
...@@ -722,10 +722,10 @@ static inline void copy_block16(uint8_t *dst, uint8_t *src, int dstStride, int s ...@@ -722,10 +722,10 @@ static inline void copy_block16(uint8_t *dst, uint8_t *src, int dstStride, int s
int i; int i;
for(i=0; i<h; i++) for(i=0; i<h; i++)
{ {
ST32(dst , LD32(src )); AV_WN32(dst , AV_RN32(src ));
ST32(dst+4 , LD32(src+4 )); AV_WN32(dst+4 , AV_RN32(src+4 ));
ST32(dst+8 , LD32(src+8 )); AV_WN32(dst+8 , AV_RN32(src+8 ));
ST32(dst+12, LD32(src+12)); AV_WN32(dst+12, AV_RN32(src+12));
dst+=dstStride; dst+=dstStride;
src+=srcStride; src+=srcStride;
} }
...@@ -736,10 +736,10 @@ static inline void copy_block17(uint8_t *dst, uint8_t *src, int dstStride, int s ...@@ -736,10 +736,10 @@ static inline void copy_block17(uint8_t *dst, uint8_t *src, int dstStride, int s
int i; int i;
for(i=0; i<h; i++) for(i=0; i<h; i++)
{ {
ST32(dst , LD32(src )); AV_WN32(dst , AV_RN32(src ));
ST32(dst+4 , LD32(src+4 )); AV_WN32(dst+4 , AV_RN32(src+4 ));
ST32(dst+8 , LD32(src+8 )); AV_WN32(dst+8 , AV_RN32(src+8 ));
ST32(dst+12, LD32(src+12)); AV_WN32(dst+12, AV_RN32(src+12));
dst[16]= src[16]; dst[16]= src[16];
dst+=dstStride; dst+=dstStride;
src+=srcStride; src+=srcStride;
......
...@@ -81,7 +81,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, ...@@ -81,7 +81,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
unsigned int x; unsigned int x;
for (x=0; x<w*bytes_per_pixel; x+=bytes_per_pixel) for (x=0; x<w*bytes_per_pixel; x+=bytes_per_pixel)
ST16(ptr+x, AV_RL16(buf+x)); AV_WN16(ptr+x, AV_RL16(buf+x));
#else #else
memcpy(ptr, buf, w*bytes_per_pixel); memcpy(ptr, buf, w*bytes_per_pixel);
#endif #endif
......
This diff is collapsed.
...@@ -28,23 +28,23 @@ struct unaligned_64 { uint64_t l; } __attribute__((packed)); ...@@ -28,23 +28,23 @@ struct unaligned_64 { uint64_t l; } __attribute__((packed));
struct unaligned_32 { uint32_t l; } __attribute__((packed)); struct unaligned_32 { uint32_t l; } __attribute__((packed));
struct unaligned_16 { uint16_t l; } __attribute__((packed)); struct unaligned_16 { uint16_t l; } __attribute__((packed));
#define LD16(a) (((const struct unaligned_16 *) (a))->l) #define AV_RN16(a) (((const struct unaligned_16 *) (a))->l)
#define LD32(a) (((const struct unaligned_32 *) (a))->l) #define AV_RN32(a) (((const struct unaligned_32 *) (a))->l)
#define LD64(a) (((const struct unaligned_64 *) (a))->l) #define AV_RN64(a) (((const struct unaligned_64 *) (a))->l)
#define ST16(a, b) (((struct unaligned_16 *) (a))->l) = (b) #define AV_WN16(a, b) (((struct unaligned_16 *) (a))->l) = (b)
#define ST32(a, b) (((struct unaligned_32 *) (a))->l) = (b) #define AV_WN32(a, b) (((struct unaligned_32 *) (a))->l) = (b)
#define ST64(a, b) (((struct unaligned_64 *) (a))->l) = (b) #define AV_WN64(a, b) (((struct unaligned_64 *) (a))->l) = (b)
#else /* __GNUC__ */ #else /* __GNUC__ */
#define LD16(a) (*((uint16_t*)(a))) #define AV_RN16(a) (*((uint16_t*)(a)))
#define LD32(a) (*((uint32_t*)(a))) #define AV_RN32(a) (*((uint32_t*)(a)))
#define LD64(a) (*((uint64_t*)(a))) #define AV_RN64(a) (*((uint64_t*)(a)))
#define ST16(a, b) *((uint16_t*)(a)) = (b) #define AV_WN16(a, b) *((uint16_t*)(a)) = (b)
#define ST32(a, b) *((uint32_t*)(a)) = (b) #define AV_WN32(a, b) *((uint32_t*)(a)) = (b)
#define ST64(a, b) *((uint64_t*)(a)) = (b) #define AV_WN64(a, b) *((uint64_t*)(a)) = (b)
#endif /* !__GNUC__ */ #endif /* !__GNUC__ */
...@@ -57,17 +57,17 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed)); ...@@ -57,17 +57,17 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
#ifdef HAVE_FAST_UNALIGNED #ifdef HAVE_FAST_UNALIGNED
# ifdef WORDS_BIGENDIAN # ifdef WORDS_BIGENDIAN
# define AV_RB16(x) LD16(x) # define AV_RB16(x) AV_RN16(x)
# define AV_WB16(p, d) ST16(p, d) # define AV_WB16(p, d) AV_WN16(p, d)
# define AV_RL16(x) bswap_16(LD16(x)) # define AV_RL16(x) bswap_16(AV_RN16(x))
# define AV_WL16(p, d) ST16(p, bswap_16(d)) # define AV_WL16(p, d) AV_WN16(p, bswap_16(d))
# else /* WORDS_BIGENDIAN */ # else /* WORDS_BIGENDIAN */
# define AV_RB16(x) bswap_16(LD16(x)) # define AV_RB16(x) bswap_16(AV_RN16(x))
# define AV_WB16(p, d) ST16(p, bswap_16(d)) # define AV_WB16(p, d) AV_WN16(p, bswap_16(d))
# define AV_RL16(x) LD16(x) # define AV_RL16(x) AV_RN16(x)
# define AV_WL16(p, d) ST16(p, d) # define AV_WL16(p, d) AV_WN16(p, d)
# endif # endif
#else /* HAVE_FAST_UNALIGNED */ #else /* HAVE_FAST_UNALIGNED */
#define AV_RB16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) #define AV_RB16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1])
...@@ -100,17 +100,17 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed)); ...@@ -100,17 +100,17 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
#ifdef HAVE_FAST_UNALIGNED #ifdef HAVE_FAST_UNALIGNED
# ifdef WORDS_BIGENDIAN # ifdef WORDS_BIGENDIAN
# define AV_RB32(x) LD32(x) # define AV_RB32(x) AV_RN32(x)
# define AV_WB32(p, d) ST32(p, d) # define AV_WB32(p, d) AV_WN32(p, d)
# define AV_RL32(x) bswap_32(LD32(x)) # define AV_RL32(x) bswap_32(AV_RN32(x))
# define AV_WL32(p, d) ST32(p, bswap_32(d)) # define AV_WL32(p, d) AV_WN32(p, bswap_32(d))
# else /* WORDS_BIGENDIAN */ # else /* WORDS_BIGENDIAN */
# define AV_RB32(x) bswap_32(LD32(x)) # define AV_RB32(x) bswap_32(AV_RN32(x))
# define AV_WB32(p, d) ST32(p, bswap_32(d)) # define AV_WB32(p, d) AV_WN32(p, bswap_32(d))
# define AV_RL32(x) LD32(x) # define AV_RL32(x) AV_RN32(x)
# define AV_WL32(p, d) ST32(p, d) # define AV_WL32(p, d) AV_WN32(p, d)
# endif # endif
#else /* HAVE_FAST_UNALIGNED */ #else /* HAVE_FAST_UNALIGNED */
#define AV_RB32(x) ((((uint8_t*)(x))[0] << 24) | \ #define AV_RB32(x) ((((uint8_t*)(x))[0] << 24) | \
...@@ -136,17 +136,17 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed)); ...@@ -136,17 +136,17 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
#ifdef HAVE_FAST_UNALIGNED #ifdef HAVE_FAST_UNALIGNED
# ifdef WORDS_BIGENDIAN # ifdef WORDS_BIGENDIAN
# define AV_RB64(x) LD64(x) # define AV_RB64(x) AV_RN64(x)
# define AV_WB64(p, d) ST64(p, d) # define AV_WB64(p, d) AV_WN64(p, d)
# define AV_RL64(x) bswap_64(LD64(x)) # define AV_RL64(x) bswap_64(AV_RN64(x))
# define AV_WL64(p, d) ST64(p, bswap_64(d)) # define AV_WL64(p, d) AV_WN64(p, bswap_64(d))
# else /* WORDS_BIGENDIAN */ # else /* WORDS_BIGENDIAN */
# define AV_RB64(x) bswap_64(LD64(x)) # define AV_RB64(x) bswap_64(AV_RN64(x))
# define AV_WB64(p, d) ST64(p, bswap_64(d)) # define AV_WB64(p, d) AV_WN64(p, bswap_64(d))
# define AV_RL64(x) LD64(x) # define AV_RL64(x) AV_RN64(x)
# define AV_WL64(p, d) ST64(p, d) # define AV_WL64(p, d) AV_WN64(p, d)
# endif # endif
#else /* HAVE_FAST_UNALIGNED */ #else /* HAVE_FAST_UNALIGNED */
#define AV_RB64(x) (((uint64_t)((uint8_t*)(x))[0] << 56) | \ #define AV_RB64(x) (((uint64_t)((uint8_t*)(x))[0] << 56) | \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment