* renaming (ST|LD)(16|32|64) -> AV_(R|W)N(16|32|64)
[ffmpeg.git] / libavcodec / dsputil.c
index ace487d..9341782 100644 (file)
@@ -608,7 +608,7 @@ static void OPNAME ## _pixels(uint8_t *block, const uint8_t *pixels, int line_si
 {\
     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;\
     }\
@@ -618,8 +618,8 @@ static void OPNAME ## _no_rnd_pixels_x2_c(uint8_t *block, const uint8_t *pixels,
 {\
     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;\
@@ -630,8 +630,8 @@ static void OPNAME ## _pixels_x2_c(uint8_t *block, const uint8_t *pixels, int li
 {\
     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;\
@@ -642,8 +642,8 @@ static void OPNAME ## _no_rnd_pixels_y2_c(uint8_t *block, const uint8_t *pixels,
 {\
     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;\
@@ -654,8 +654,8 @@ static void OPNAME ## _pixels_y2_c(uint8_t *block, const uint8_t *pixels, int li
 {\
     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;\
@@ -665,8 +665,8 @@ static void OPNAME ## _pixels_y2_c(uint8_t *block, const uint8_t *pixels, int li
 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;\
@@ -676,8 +676,8 @@ static void OPNAME ## _pixels_xy2_c(uint8_t *block, const uint8_t *pixels, int l
 \
         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)\
@@ -685,8 +685,8 @@ static void OPNAME ## _pixels_xy2_c(uint8_t *block, const uint8_t *pixels, int l
             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;\
@@ -701,8 +701,8 @@ static void OPNAME ## _pixels_xy2_c(uint8_t *block, const uint8_t *pixels, int l
 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;\
@@ -712,8 +712,8 @@ static void OPNAME ## _no_rnd_pixels_xy2_c(uint8_t *block, const uint8_t *pixels
 \
         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)\
@@ -721,8 +721,8 @@ static void OPNAME ## _no_rnd_pixels_xy2_c(uint8_t *block, const uint8_t *pixels
             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;\
@@ -749,7 +749,7 @@ CALL_2X_PIXELS(OPNAME ## _no_rnd_pixels16_xy2_c, OPNAME ## _no_rnd_pixels_xy2_c,
 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;\
     }\
@@ -757,7 +757,7 @@ static void OPNAME ## _pixels2_c(uint8_t *block, const uint8_t *pixels, int line
 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;\
     }\
@@ -765,8 +765,8 @@ static void OPNAME ## _pixels4_c(uint8_t *block, const uint8_t *pixels, int line
 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;\
     }\
@@ -780,11 +780,11 @@ static inline void OPNAME ## _no_rnd_pixels8_l2(uint8_t *dst, const uint8_t *src
     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));\
     }\
 }\
@@ -794,11 +794,11 @@ static inline void OPNAME ## _pixels8_l2(uint8_t *dst, const uint8_t *src1, cons
     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));\
     }\
 }\
@@ -808,8 +808,8 @@ static inline void OPNAME ## _pixels4_l2(uint8_t *dst, const uint8_t *src1, cons
     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));\
     }\
 }\
@@ -819,8 +819,8 @@ static inline void OPNAME ## _pixels2_l2(uint8_t *dst, const uint8_t *src1, cons
     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));\
     }\
 }\
@@ -858,10 +858,10 @@ static inline void OPNAME ## _pixels8_l4(uint8_t *dst, const uint8_t *src1, uint
     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;\
@@ -872,10 +872,10 @@ static inline void OPNAME ## _pixels8_l4(uint8_t *dst, const uint8_t *src1, uint
         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;\
@@ -910,10 +910,10 @@ static inline void OPNAME ## _no_rnd_pixels8_l4(uint8_t *dst, const uint8_t *src
     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;\
@@ -924,10 +924,10 @@ static inline void OPNAME ## _no_rnd_pixels8_l4(uint8_t *dst, const uint8_t *src
         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;\
@@ -987,8 +987,8 @@ static inline void OPNAME ## _pixels2_xy2_c(uint8_t *block, const uint8_t *pixel
 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;\
@@ -998,8 +998,8 @@ static inline void OPNAME ## _pixels4_xy2_c(uint8_t *block, const uint8_t *pixel
 \
         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)\
@@ -1007,8 +1007,8 @@ static inline void OPNAME ## _pixels4_xy2_c(uint8_t *block, const uint8_t *pixel
             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;\
@@ -1025,8 +1025,8 @@ static inline void OPNAME ## _pixels8_xy2_c(uint8_t *block, const uint8_t *pixel
     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;\
@@ -1036,8 +1036,8 @@ static inline void OPNAME ## _pixels8_xy2_c(uint8_t *block, const uint8_t *pixel
 \
         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)\
@@ -1045,8 +1045,8 @@ static inline void OPNAME ## _pixels8_xy2_c(uint8_t *block, const uint8_t *pixel
             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;\
@@ -1066,8 +1066,8 @@ static inline void OPNAME ## _no_rnd_pixels8_xy2_c(uint8_t *block, const uint8_t
     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;\
@@ -1077,8 +1077,8 @@ static inline void OPNAME ## _no_rnd_pixels8_xy2_c(uint8_t *block, const uint8_t
 \
         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)\
@@ -1086,8 +1086,8 @@ static inline void OPNAME ## _no_rnd_pixels8_xy2_c(uint8_t *block, const uint8_t
             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;\