1 #ifndef __MPLAYER_MEMCPY
2 #define __MPLAYER_MEMCPY 1
7 #if defined(HAVE_MMX) || defined(HAVE_MMX2) || defined(HAVE_3DNOW) \
8 /* || defined(HAVE_SSE) || defined(HAVE_SSE2) */
11 extern void * fast_memcpy(void * to
, const void * from
, size_t len
);
12 extern void * mem2agpcpy(void * to
, const void * from
, size_t len
);
13 #define memcpy(a,b,c) fast_memcpy(a,b,c)
15 #else /* HAVE_MMX/MMX2/3DNOW/SSE/SSE2 */
16 #define mem2agpcpy(a,b,c) memcpy(a,b,c)
19 #else /* USE_FASTMEMCPY */
20 #define mem2agpcpy(a,b,c) memcpy(a,b,c)
23 static inline void * mem2agpcpy_pic(void * dst
, void * src
, int bytesPerLine
, int height
, int dstStride
, int srcStride
)
28 if(dstStride
== srcStride
)
31 src
+= (height
-1)*srcStride
;
32 dst
+= (height
-1)*dstStride
;
33 srcStride
= -srcStride
;
36 mem2agpcpy(dst
, src
, srcStride
*height
);
40 for(i
=0; i
<height
; i
++)
42 mem2agpcpy(dst
, src
, bytesPerLine
);
51 static inline void * memcpy_pic(void * dst
, void * src
, int bytesPerLine
, int height
, int dstStride
, int srcStride
)
56 if(dstStride
== srcStride
)
59 src
+= (height
-1)*srcStride
;
60 dst
+= (height
-1)*dstStride
;
61 srcStride
= -srcStride
;
64 memcpy(dst
, src
, srcStride
*height
);
68 for(i
=0; i
<height
; i
++)
70 memcpy(dst
, src
, bytesPerLine
);