static void intra_pred_vert(uint8_t *d,uint8_t *top,uint8_t *left,int stride) {
int y;
- uint64_t a = LD64(&top[1]);
+ uint64_t a = AV_RN64(&top[1]);
for(y=0;y<8;y++) {
*((uint64_t *)(d+y*stride)) = a;
}
{\
int i;\
for(i=0; i<h; i++){\
- OP(*((uint64_t*)block), LD64(pixels));\
+ OP(*((uint64_t*)block), AV_RN64(pixels));\
pixels+=line_size;\
block +=line_size;\
}\
{\
int i;\
for(i=0; i<h; i++){\
- const uint64_t a= LD64(pixels );\
- const uint64_t b= LD64(pixels+1);\
+ const uint64_t a= AV_RN64(pixels );\
+ const uint64_t b= AV_RN64(pixels+1);\
OP(*((uint64_t*)block), (a&b) + (((a^b)&0xFEFEFEFEFEFEFEFEULL)>>1));\
pixels+=line_size;\
block +=line_size;\
{\
int i;\
for(i=0; i<h; i++){\
- const uint64_t a= LD64(pixels );\
- const uint64_t b= LD64(pixels+1);\
+ const uint64_t a= AV_RN64(pixels );\
+ const uint64_t b= AV_RN64(pixels+1);\
OP(*((uint64_t*)block), (a|b) - (((a^b)&0xFEFEFEFEFEFEFEFEULL)>>1));\
pixels+=line_size;\
block +=line_size;\
{\
int i;\
for(i=0; i<h; i++){\
- const uint64_t a= LD64(pixels );\
- const uint64_t b= LD64(pixels+line_size);\
+ const uint64_t a= AV_RN64(pixels );\
+ const uint64_t b= AV_RN64(pixels+line_size);\
OP(*((uint64_t*)block), (a&b) + (((a^b)&0xFEFEFEFEFEFEFEFEULL)>>1));\
pixels+=line_size;\
block +=line_size;\
{\
int i;\
for(i=0; i<h; i++){\
- const uint64_t a= LD64(pixels );\
- const uint64_t b= LD64(pixels+line_size);\
+ const uint64_t a= AV_RN64(pixels );\
+ const uint64_t b= AV_RN64(pixels+line_size);\
OP(*((uint64_t*)block), (a|b) - (((a^b)&0xFEFEFEFEFEFEFEFEULL)>>1));\
pixels+=line_size;\
block +=line_size;\
static void OPNAME ## _pixels_xy2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
{\
int i;\
- const uint64_t a= LD64(pixels );\
- const uint64_t b= LD64(pixels+1);\
+ const uint64_t a= AV_RN64(pixels );\
+ const uint64_t b= AV_RN64(pixels+1);\
uint64_t l0= (a&0x0303030303030303ULL)\
+ (b&0x0303030303030303ULL)\
+ 0x0202020202020202ULL;\
\
pixels+=line_size;\
for(i=0; i<h; i+=2){\
- uint64_t a= LD64(pixels );\
- uint64_t b= LD64(pixels+1);\
+ uint64_t a= AV_RN64(pixels );\
+ uint64_t b= AV_RN64(pixels+1);\
l1= (a&0x0303030303030303ULL)\
+ (b&0x0303030303030303ULL);\
h1= ((a&0xFCFCFCFCFCFCFCFCULL)>>2)\
OP(*((uint64_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0F0F0F0F0FULL));\
pixels+=line_size;\
block +=line_size;\
- a= LD64(pixels );\
- b= LD64(pixels+1);\
+ a= AV_RN64(pixels );\
+ b= AV_RN64(pixels+1);\
l0= (a&0x0303030303030303ULL)\
+ (b&0x0303030303030303ULL)\
+ 0x0202020202020202ULL;\
static void OPNAME ## _no_rnd_pixels_xy2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
{\
int i;\
- const uint64_t a= LD64(pixels );\
- const uint64_t b= LD64(pixels+1);\
+ const uint64_t a= AV_RN64(pixels );\
+ const uint64_t b= AV_RN64(pixels+1);\
uint64_t l0= (a&0x0303030303030303ULL)\
+ (b&0x0303030303030303ULL)\
+ 0x0101010101010101ULL;\
\
pixels+=line_size;\
for(i=0; i<h; i+=2){\
- uint64_t a= LD64(pixels );\
- uint64_t b= LD64(pixels+1);\
+ uint64_t a= AV_RN64(pixels );\
+ uint64_t b= AV_RN64(pixels+1);\
l1= (a&0x0303030303030303ULL)\
+ (b&0x0303030303030303ULL);\
h1= ((a&0xFCFCFCFCFCFCFCFCULL)>>2)\
OP(*((uint64_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0F0F0F0F0FULL));\
pixels+=line_size;\
block +=line_size;\
- a= LD64(pixels );\
- b= LD64(pixels+1);\
+ a= AV_RN64(pixels );\
+ b= AV_RN64(pixels+1);\
l0= (a&0x0303030303030303ULL)\
+ (b&0x0303030303030303ULL)\
+ 0x0101010101010101ULL;\
static void OPNAME ## _pixels2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
int i;\
for(i=0; i<h; i++){\
- OP(*((uint16_t*)(block )), LD16(pixels ));\
+ OP(*((uint16_t*)(block )), AV_RN16(pixels ));\
pixels+=line_size;\
block +=line_size;\
}\
static void OPNAME ## _pixels4_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
int i;\
for(i=0; i<h; i++){\
- OP(*((uint32_t*)(block )), LD32(pixels ));\
+ OP(*((uint32_t*)(block )), AV_RN32(pixels ));\
pixels+=line_size;\
block +=line_size;\
}\
static void OPNAME ## _pixels8_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
int i;\
for(i=0; i<h; i++){\
- OP(*((uint32_t*)(block )), LD32(pixels ));\
- OP(*((uint32_t*)(block+4)), LD32(pixels+4));\
+ OP(*((uint32_t*)(block )), AV_RN32(pixels ));\
+ OP(*((uint32_t*)(block+4)), AV_RN32(pixels+4));\
pixels+=line_size;\
block +=line_size;\
}\
int i;\
for(i=0; i<h; i++){\
uint32_t a,b;\
- a= LD32(&src1[i*src_stride1 ]);\
- b= LD32(&src2[i*src_stride2 ]);\
+ a= AV_RN32(&src1[i*src_stride1 ]);\
+ b= AV_RN32(&src2[i*src_stride2 ]);\
OP(*((uint32_t*)&dst[i*dst_stride ]), no_rnd_avg32(a, b));\
- a= LD32(&src1[i*src_stride1+4]);\
- b= LD32(&src2[i*src_stride2+4]);\
+ a= AV_RN32(&src1[i*src_stride1+4]);\
+ b= AV_RN32(&src2[i*src_stride2+4]);\
OP(*((uint32_t*)&dst[i*dst_stride+4]), no_rnd_avg32(a, b));\
}\
}\
int i;\
for(i=0; i<h; i++){\
uint32_t a,b;\
- a= LD32(&src1[i*src_stride1 ]);\
- b= LD32(&src2[i*src_stride2 ]);\
+ a= AV_RN32(&src1[i*src_stride1 ]);\
+ b= AV_RN32(&src2[i*src_stride2 ]);\
OP(*((uint32_t*)&dst[i*dst_stride ]), rnd_avg32(a, b));\
- a= LD32(&src1[i*src_stride1+4]);\
- b= LD32(&src2[i*src_stride2+4]);\
+ a= AV_RN32(&src1[i*src_stride1+4]);\
+ b= AV_RN32(&src2[i*src_stride2+4]);\
OP(*((uint32_t*)&dst[i*dst_stride+4]), rnd_avg32(a, b));\
}\
}\
int i;\
for(i=0; i<h; i++){\
uint32_t a,b;\
- a= LD32(&src1[i*src_stride1 ]);\
- b= LD32(&src2[i*src_stride2 ]);\
+ a= AV_RN32(&src1[i*src_stride1 ]);\
+ b= AV_RN32(&src2[i*src_stride2 ]);\
OP(*((uint32_t*)&dst[i*dst_stride ]), rnd_avg32(a, b));\
}\
}\
int i;\
for(i=0; i<h; i++){\
uint32_t a,b;\
- a= LD16(&src1[i*src_stride1 ]);\
- b= LD16(&src2[i*src_stride2 ]);\
+ a= AV_RN16(&src1[i*src_stride1 ]);\
+ b= AV_RN16(&src2[i*src_stride2 ]);\
OP(*((uint16_t*)&dst[i*dst_stride ]), rnd_avg32(a, b));\
}\
}\
int i;\
for(i=0; i<h; i++){\
uint32_t a, b, c, d, l0, l1, h0, h1;\
- a= LD32(&src1[i*src_stride1]);\
- b= LD32(&src2[i*src_stride2]);\
- c= LD32(&src3[i*src_stride3]);\
- d= LD32(&src4[i*src_stride4]);\
+ a= AV_RN32(&src1[i*src_stride1]);\
+ b= AV_RN32(&src2[i*src_stride2]);\
+ c= AV_RN32(&src3[i*src_stride3]);\
+ d= AV_RN32(&src4[i*src_stride4]);\
l0= (a&0x03030303UL)\
+ (b&0x03030303UL)\
+ 0x02020202UL;\
h1= ((c&0xFCFCFCFCUL)>>2)\
+ ((d&0xFCFCFCFCUL)>>2);\
OP(*((uint32_t*)&dst[i*dst_stride]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- a= LD32(&src1[i*src_stride1+4]);\
- b= LD32(&src2[i*src_stride2+4]);\
- c= LD32(&src3[i*src_stride3+4]);\
- d= LD32(&src4[i*src_stride4+4]);\
+ a= AV_RN32(&src1[i*src_stride1+4]);\
+ b= AV_RN32(&src2[i*src_stride2+4]);\
+ c= AV_RN32(&src3[i*src_stride3+4]);\
+ d= AV_RN32(&src4[i*src_stride4+4]);\
l0= (a&0x03030303UL)\
+ (b&0x03030303UL)\
+ 0x02020202UL;\
int i;\
for(i=0; i<h; i++){\
uint32_t a, b, c, d, l0, l1, h0, h1;\
- a= LD32(&src1[i*src_stride1]);\
- b= LD32(&src2[i*src_stride2]);\
- c= LD32(&src3[i*src_stride3]);\
- d= LD32(&src4[i*src_stride4]);\
+ a= AV_RN32(&src1[i*src_stride1]);\
+ b= AV_RN32(&src2[i*src_stride2]);\
+ c= AV_RN32(&src3[i*src_stride3]);\
+ d= AV_RN32(&src4[i*src_stride4]);\
l0= (a&0x03030303UL)\
+ (b&0x03030303UL)\
+ 0x01010101UL;\
h1= ((c&0xFCFCFCFCUL)>>2)\
+ ((d&0xFCFCFCFCUL)>>2);\
OP(*((uint32_t*)&dst[i*dst_stride]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
- a= LD32(&src1[i*src_stride1+4]);\
- b= LD32(&src2[i*src_stride2+4]);\
- c= LD32(&src3[i*src_stride3+4]);\
- d= LD32(&src4[i*src_stride4+4]);\
+ a= AV_RN32(&src1[i*src_stride1+4]);\
+ b= AV_RN32(&src2[i*src_stride2+4]);\
+ c= AV_RN32(&src3[i*src_stride3+4]);\
+ d= AV_RN32(&src4[i*src_stride4+4]);\
l0= (a&0x03030303UL)\
+ (b&0x03030303UL)\
+ 0x01010101UL;\
static inline void OPNAME ## _pixels4_xy2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
{\
int i;\
- const uint32_t a= LD32(pixels );\
- const uint32_t b= LD32(pixels+1);\
+ const uint32_t a= AV_RN32(pixels );\
+ const uint32_t b= AV_RN32(pixels+1);\
uint32_t l0= (a&0x03030303UL)\
+ (b&0x03030303UL)\
+ 0x02020202UL;\
\
pixels+=line_size;\
for(i=0; i<h; i+=2){\
- uint32_t a= LD32(pixels );\
- uint32_t b= LD32(pixels+1);\
+ uint32_t a= AV_RN32(pixels );\
+ uint32_t b= AV_RN32(pixels+1);\
l1= (a&0x03030303UL)\
+ (b&0x03030303UL);\
h1= ((a&0xFCFCFCFCUL)>>2)\
OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
pixels+=line_size;\
block +=line_size;\
- a= LD32(pixels );\
- b= LD32(pixels+1);\
+ a= AV_RN32(pixels );\
+ b= AV_RN32(pixels+1);\
l0= (a&0x03030303UL)\
+ (b&0x03030303UL)\
+ 0x02020202UL;\
int j;\
for(j=0; j<2; j++){\
int i;\
- const uint32_t a= LD32(pixels );\
- const uint32_t b= LD32(pixels+1);\
+ const uint32_t a= AV_RN32(pixels );\
+ const uint32_t b= AV_RN32(pixels+1);\
uint32_t l0= (a&0x03030303UL)\
+ (b&0x03030303UL)\
+ 0x02020202UL;\
\
pixels+=line_size;\
for(i=0; i<h; i+=2){\
- uint32_t a= LD32(pixels );\
- uint32_t b= LD32(pixels+1);\
+ uint32_t a= AV_RN32(pixels );\
+ uint32_t b= AV_RN32(pixels+1);\
l1= (a&0x03030303UL)\
+ (b&0x03030303UL);\
h1= ((a&0xFCFCFCFCUL)>>2)\
OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
pixels+=line_size;\
block +=line_size;\
- a= LD32(pixels );\
- b= LD32(pixels+1);\
+ a= AV_RN32(pixels );\
+ b= AV_RN32(pixels+1);\
l0= (a&0x03030303UL)\
+ (b&0x03030303UL)\
+ 0x02020202UL;\
int j;\
for(j=0; j<2; j++){\
int i;\
- const uint32_t a= LD32(pixels );\
- const uint32_t b= LD32(pixels+1);\
+ const uint32_t a= AV_RN32(pixels );\
+ const uint32_t b= AV_RN32(pixels+1);\
uint32_t l0= (a&0x03030303UL)\
+ (b&0x03030303UL)\
+ 0x01010101UL;\
\
pixels+=line_size;\
for(i=0; i<h; i+=2){\
- uint32_t a= LD32(pixels );\
- uint32_t b= LD32(pixels+1);\
+ uint32_t a= AV_RN32(pixels );\
+ uint32_t b= AV_RN32(pixels+1);\
l1= (a&0x03030303UL)\
+ (b&0x03030303UL);\
h1= ((a&0xFCFCFCFCUL)>>2)\
OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
pixels+=line_size;\
block +=line_size;\
- a= LD32(pixels );\
- b= LD32(pixels+1);\
+ a= AV_RN32(pixels );\
+ b= AV_RN32(pixels+1);\
l0= (a&0x03030303UL)\
+ (b&0x03030303UL)\
+ 0x01010101UL;\
int i;
for(i=0; i<h; i++)
{
- ST16(dst , LD16(src ));
+ AV_WN16(dst , AV_RN16(src ));
dst+=dstStride;
src+=srcStride;
}
int i;
for(i=0; i<h; i++)
{
- ST32(dst , LD32(src ));
+ AV_WN32(dst , AV_RN32(src ));
dst+=dstStride;
src+=srcStride;
}
int i;
for(i=0; i<h; i++)
{
- ST32(dst , LD32(src ));
- ST32(dst+4 , LD32(src+4 ));
+ AV_WN32(dst , AV_RN32(src ));
+ AV_WN32(dst+4 , AV_RN32(src+4 ));
dst+=dstStride;
src+=srcStride;
}
int i;
for(i=0; i<h; i++)
{
- ST32(dst , LD32(src ));
- ST32(dst+4 , LD32(src+4 ));
+ AV_WN32(dst , AV_RN32(src ));
+ AV_WN32(dst+4 , AV_RN32(src+4 ));
dst[8]= src[8];
dst+=dstStride;
src+=srcStride;
int i;
for(i=0; i<h; i++)
{
- ST32(dst , LD32(src ));
- ST32(dst+4 , LD32(src+4 ));
- ST32(dst+8 , LD32(src+8 ));
- ST32(dst+12, LD32(src+12));
+ AV_WN32(dst , AV_RN32(src ));
+ AV_WN32(dst+4 , AV_RN32(src+4 ));
+ AV_WN32(dst+8 , AV_RN32(src+8 ));
+ AV_WN32(dst+12, AV_RN32(src+12));
dst+=dstStride;
src+=srcStride;
}
int i;
for(i=0; i<h; i++)
{
- ST32(dst , LD32(src ));
- ST32(dst+4 , LD32(src+4 ));
- ST32(dst+8 , LD32(src+8 ));
- ST32(dst+12, LD32(src+12));
+ AV_WN32(dst , AV_RN32(src ));
+ AV_WN32(dst+4 , AV_RN32(src+4 ));
+ AV_WN32(dst+8 , AV_RN32(src+8 ));
+ AV_WN32(dst+12, AV_RN32(src+12));
dst[16]= src[16];
dst+=dstStride;
src+=srcStride;
#ifdef WORDS_BIGENDIAN
unsigned int x;
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
memcpy(ptr, buf, w*bytes_per_pixel);
#endif
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define LD(adr) *(uint32_t*)(adr)
-
#define PIXOP2(OPNAME, OP) \
/*static inline void OPNAME ## _no_rnd_pixels8_l2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2, int h) \
{\
do {\
- OP(LP(dst ),no_rnd_avg32(LD32(src1 ),LD32(src2 )) ); \
- OP(LP(dst+4),no_rnd_avg32(LD32(src1+4),LD32(src2+4)) ); \
+ OP(LP(dst ),no_rnd_avg32(AV_RN32(src1 ),AV_RN32(src2 )) ); \
+ OP(LP(dst+4),no_rnd_avg32(AV_RN32(src1+4),AV_RN32(src2+4)) ); \
src1+=src_stride1; \
src2+=src_stride2; \
dst+=dst_stride; \
static inline void OPNAME ## _pixels8_l2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2, int h) \
{\
do {\
- OP(LP(dst ),rnd_avg32(LD32(src1 ),LD32(src2 )) ); \
- OP(LP(dst+4),rnd_avg32(LD32(src1+4),LD32(src2+4)) ); \
+ OP(LP(dst ),rnd_avg32(AV_RN32(src1 ),AV_RN32(src2 )) ); \
+ OP(LP(dst+4),rnd_avg32(AV_RN32(src1+4),AV_RN32(src2+4)) ); \
src1+=src_stride1; \
src2+=src_stride2; \
dst+=dst_stride; \
static inline void OPNAME ## _pixels4_l2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2, int h) \
{\
do {\
- OP(LP(dst ),rnd_avg32(LD32(src1 ),LD32(src2 )) ); \
+ OP(LP(dst ),rnd_avg32(AV_RN32(src1 ),AV_RN32(src2 )) ); \
src1+=src_stride1; \
src2+=src_stride2; \
dst+=dst_stride; \
static inline void OPNAME ## _no_rnd_pixels16_l2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2, int h) \
{\
do {\
- OP(LP(dst ),no_rnd_avg32(LD32(src1 ),LD32(src2 )) ); \
- OP(LP(dst+4),no_rnd_avg32(LD32(src1+4),LD32(src2+4)) ); \
- OP(LP(dst+8),no_rnd_avg32(LD32(src1+8),LD32(src2+8)) ); \
- OP(LP(dst+12),no_rnd_avg32(LD32(src1+12),LD32(src2+12)) ); \
+ OP(LP(dst ),no_rnd_avg32(AV_RN32(src1 ),AV_RN32(src2 )) ); \
+ OP(LP(dst+4),no_rnd_avg32(AV_RN32(src1+4),AV_RN32(src2+4)) ); \
+ OP(LP(dst+8),no_rnd_avg32(AV_RN32(src1+8),AV_RN32(src2+8)) ); \
+ OP(LP(dst+12),no_rnd_avg32(AV_RN32(src1+12),AV_RN32(src2+12)) ); \
src1+=src_stride1; \
src2+=src_stride2; \
dst+=dst_stride; \
static inline void OPNAME ## _pixels16_l2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2, int h) \
{\
do {\
- OP(LP(dst ),rnd_avg32(LD32(src1 ),LD32(src2 )) ); \
- OP(LP(dst+4),rnd_avg32(LD32(src1+4),LD32(src2+4)) ); \
- OP(LP(dst+8),rnd_avg32(LD32(src1+8),LD32(src2+8)) ); \
- OP(LP(dst+12),rnd_avg32(LD32(src1+12),LD32(src2+12)) ); \
+ OP(LP(dst ),rnd_avg32(AV_RN32(src1 ),AV_RN32(src2 )) ); \
+ OP(LP(dst+4),rnd_avg32(AV_RN32(src1+4),AV_RN32(src2+4)) ); \
+ OP(LP(dst+8),rnd_avg32(AV_RN32(src1+8),AV_RN32(src2+8)) ); \
+ OP(LP(dst+12),rnd_avg32(AV_RN32(src1+12),AV_RN32(src2+12)) ); \
src1+=src_stride1; \
src2+=src_stride2; \
dst+=dst_stride; \
static inline void OPNAME ## _pixels4_l2_aligned2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2, int h) \
{\
do {\
- OP(LP(dst ),rnd_avg32(LD32(src1 ),LP(src2 )) ); \
+ OP(LP(dst ),rnd_avg32(AV_RN32(src1 ),LP(src2 )) ); \
src1+=src_stride1; \
src2+=src_stride2; \
dst+=dst_stride; \
static inline void OPNAME ## _no_rnd_pixels16_l2_aligned2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2, int h) \
{\
do {\
- OP(LP(dst ),no_rnd_avg32(LD32(src1 ),LP(src2 )) ); \
- OP(LP(dst+4),no_rnd_avg32(LD32(src1+4),LP(src2+4)) ); \
- OP(LP(dst+8),no_rnd_avg32(LD32(src1+8),LP(src2+8)) ); \
- OP(LP(dst+12),no_rnd_avg32(LD32(src1+12),LP(src2+12)) ); \
+ OP(LP(dst ),no_rnd_avg32(AV_RN32(src1 ),LP(src2 )) ); \
+ OP(LP(dst+4),no_rnd_avg32(AV_RN32(src1+4),LP(src2+4)) ); \
+ OP(LP(dst+8),no_rnd_avg32(AV_RN32(src1+8),LP(src2+8)) ); \
+ OP(LP(dst+12),no_rnd_avg32(AV_RN32(src1+12),LP(src2+12)) ); \
src1+=src_stride1; \
src2+=src_stride2; \
dst+=dst_stride; \
static inline void OPNAME ## _pixels16_l2_aligned2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2, int h) \
{\
do {\
- OP(LP(dst ),rnd_avg32(LD32(src1 ),LP(src2 )) ); \
- OP(LP(dst+4),rnd_avg32(LD32(src1+4),LP(src2+4)) ); \
- OP(LP(dst+8),rnd_avg32(LD32(src1+8),LP(src2+8)) ); \
- OP(LP(dst+12),rnd_avg32(LD32(src1+12),LP(src2+12)) ); \
+ OP(LP(dst ),rnd_avg32(AV_RN32(src1 ),LP(src2 )) ); \
+ OP(LP(dst+4),rnd_avg32(AV_RN32(src1+4),LP(src2+4)) ); \
+ OP(LP(dst+8),rnd_avg32(AV_RN32(src1+8),LP(src2+8)) ); \
+ OP(LP(dst+12),rnd_avg32(AV_RN32(src1+12),LP(src2+12)) ); \
src1+=src_stride1; \
src2+=src_stride2; \
dst+=dst_stride; \
static inline void OPNAME ## _no_rnd_pixels8_l2_aligned2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2, int h) \
{\
do { /* onlye src2 aligned */\
- OP(LP(dst ),no_rnd_avg32(LD32(src1 ),LP(src2 )) ); \
- OP(LP(dst+4),no_rnd_avg32(LD32(src1+4),LP(src2+4)) ); \
+ OP(LP(dst ),no_rnd_avg32(AV_RN32(src1 ),LP(src2 )) ); \
+ OP(LP(dst+4),no_rnd_avg32(AV_RN32(src1+4),LP(src2+4)) ); \
src1+=src_stride1; \
src2+=src_stride2; \
dst+=dst_stride; \
static inline void OPNAME ## _pixels8_l2_aligned2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2, int h) \
{\
do {\
- OP(LP(dst ),rnd_avg32(LD32(src1 ),LP(src2 )) ); \
- OP(LP(dst+4),rnd_avg32(LD32(src1+4),LP(src2+4)) ); \
+ OP(LP(dst ),rnd_avg32(AV_RN32(src1 ),LP(src2 )) ); \
+ OP(LP(dst+4),rnd_avg32(AV_RN32(src1+4),LP(src2+4)) ); \
src1+=src_stride1; \
src2+=src_stride2; \
dst+=dst_stride; \
static inline void OPNAME ## _pixels8_l4_aligned0(uint8_t *dst, const uint8_t *src1, uint8_t *src2, uint8_t *src3, uint8_t *src4,int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
do { \
uint32_t a0,a1,a2,a3; /* src1 only not aligned */\
- UNPACK(a0,a1,LD32(src1),LP(src2)); \
+ UNPACK(a0,a1,AV_RN32(src1),LP(src2)); \
UNPACK(a2,a3,LP(src3),LP(src4)); \
OP(LP(dst),rnd_PACK(a0,a1,a2,a3)); \
- UNPACK(a0,a1,LD32(src1+4),LP(src2+4)); \
+ UNPACK(a0,a1,AV_RN32(src1+4),LP(src2+4)); \
UNPACK(a2,a3,LP(src3+4),LP(src4+4)); \
OP(LP(dst+4),rnd_PACK(a0,a1,a2,a3)); \
src1+=src_stride1;\
static inline void OPNAME ## _no_rnd_pixels8_l4_aligned0(uint8_t *dst, const uint8_t *src1, uint8_t *src2, uint8_t *src3, uint8_t *src4,int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
do { \
uint32_t a0,a1,a2,a3; \
- UNPACK(a0,a1,LD32(src1),LP(src2)); \
+ UNPACK(a0,a1,AV_RN32(src1),LP(src2)); \
UNPACK(a2,a3,LP(src3),LP(src4)); \
OP(LP(dst),no_rnd_PACK(a0,a1,a2,a3)); \
- UNPACK(a0,a1,LD32(src1+4),LP(src2+4)); \
+ UNPACK(a0,a1,AV_RN32(src1+4),LP(src2+4)); \
UNPACK(a2,a3,LP(src3+4),LP(src4+4)); \
OP(LP(dst+4),no_rnd_PACK(a0,a1,a2,a3)); \
src1+=src_stride1;\
static inline void OPNAME ## _pixels16_l4_aligned0(uint8_t *dst, const uint8_t *src1, uint8_t *src2, uint8_t *src3, uint8_t *src4,int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
do { /* src1 is unaligned */\
uint32_t a0,a1,a2,a3; \
- UNPACK(a0,a1,LD32(src1),LP(src2)); \
+ UNPACK(a0,a1,AV_RN32(src1),LP(src2)); \
UNPACK(a2,a3,LP(src3),LP(src4)); \
OP(LP(dst),rnd_PACK(a0,a1,a2,a3)); \
- UNPACK(a0,a1,LD32(src1+4),LP(src2+4)); \
+ UNPACK(a0,a1,AV_RN32(src1+4),LP(src2+4)); \
UNPACK(a2,a3,LP(src3+4),LP(src4+4)); \
OP(LP(dst+8),rnd_PACK(a0,a1,a2,a3)); \
- UNPACK(a0,a1,LD32(src1+8),LP(src2+8)); \
+ UNPACK(a0,a1,AV_RN32(src1+8),LP(src2+8)); \
UNPACK(a2,a3,LP(src3+8),LP(src4+8)); \
OP(LP(dst+8),rnd_PACK(a0,a1,a2,a3)); \
- UNPACK(a0,a1,LD32(src1+12),LP(src2+12)); \
+ UNPACK(a0,a1,AV_RN32(src1+12),LP(src2+12)); \
UNPACK(a2,a3,LP(src3+12),LP(src4+12)); \
OP(LP(dst+12),rnd_PACK(a0,a1,a2,a3)); \
src1+=src_stride1;\
static inline void OPNAME ## _no_rnd_pixels16_l4_aligned0(uint8_t *dst, const uint8_t *src1, uint8_t *src2, uint8_t *src3, uint8_t *src4,int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
do { \
uint32_t a0,a1,a2,a3; \
- UNPACK(a0,a1,LD32(src1),LP(src2)); \
+ UNPACK(a0,a1,AV_RN32(src1),LP(src2)); \
UNPACK(a2,a3,LP(src3),LP(src4)); \
OP(LP(dst),no_rnd_PACK(a0,a1,a2,a3)); \
- UNPACK(a0,a1,LD32(src1+4),LP(src2+4)); \
+ UNPACK(a0,a1,AV_RN32(src1+4),LP(src2+4)); \
UNPACK(a2,a3,LP(src3+4),LP(src4+4)); \
OP(LP(dst+4),no_rnd_PACK(a0,a1,a2,a3)); \
- UNPACK(a0,a1,LD32(src1+8),LP(src2+8)); \
+ UNPACK(a0,a1,AV_RN32(src1+8),LP(src2+8)); \
UNPACK(a2,a3,LP(src3+8),LP(src4+8)); \
OP(LP(dst+8),no_rnd_PACK(a0,a1,a2,a3)); \
- UNPACK(a0,a1,LD32(src1+12),LP(src2+12)); \
+ UNPACK(a0,a1,AV_RN32(src1+12),LP(src2+12)); \
UNPACK(a2,a3,LP(src3+12),LP(src4+12)); \
OP(LP(dst+12),no_rnd_PACK(a0,a1,a2,a3)); \
src1+=src_stride1;\
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__ */
#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])
#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) | \
#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) | \