Mercurial > mplayer.hg
annotate libvo/fastmemcpy.h @ 12233:d371810e3bb3
translation prepared by Boski Cinek <boski_cinek(at)o2.pl>
author | paszczi |
---|---|
date | Sun, 18 Apr 2004 20:29:59 +0000 |
parents | 23ba417cf64b |
children | ac3fd2ff2561 |
rev | line source |
---|---|
477 | 1 #ifndef __MPLAYER_MEMCPY |
644
88eb1a3f7bfb
Changed code, should be faster on Athlon/K6 but slower on PIII with SSE, more portable.
atmosfear
parents:
581
diff
changeset
|
2 #define __MPLAYER_MEMCPY 1 |
88eb1a3f7bfb
Changed code, should be faster on Athlon/K6 but slower on PIII with SSE, more portable.
atmosfear
parents:
581
diff
changeset
|
3 |
1131 | 4 #include "../config.h" |
800 | 5 |
1131 | 6 #ifdef USE_FASTMEMCPY |
7 #if defined(HAVE_MMX) || defined(HAVE_MMX2) || defined(HAVE_3DNOW) \ | |
8 /* || defined(HAVE_SSE) || defined(HAVE_SSE2) */ | |
644
88eb1a3f7bfb
Changed code, should be faster on Athlon/K6 but slower on PIII with SSE, more portable.
atmosfear
parents:
581
diff
changeset
|
9 #include <stddef.h> |
477 | 10 |
698
f0fbf1a9bf31
Moving fast_memcpy to separate file (Size optimization)
nickols_k
parents:
685
diff
changeset
|
11 extern void * fast_memcpy(void * to, const void * from, size_t len); |
4681 | 12 extern void * mem2agpcpy(void * to, const void * from, size_t len); |
376 | 13 #define memcpy(a,b,c) fast_memcpy(a,b,c) |
513 | 14 |
4681 | 15 #else /* HAVE_MMX/MMX2/3DNOW/SSE/SSE2 */ |
16 #define mem2agpcpy(a,b,c) memcpy(a,b,c) | |
478 | 17 #endif |
4681 | 18 |
19 #else /* USE_FASTMEMCPY */ | |
20 #define mem2agpcpy(a,b,c) memcpy(a,b,c) | |
21 #endif | |
4708 | 22 |
23 static inline void * mem2agpcpy_pic(void * dst, void * src, int bytesPerLine, int height, int dstStride, int srcStride) | |
24 { | |
25 int i; | |
26 void *retval=dst; | |
27 | |
28 if(dstStride == srcStride) mem2agpcpy(dst, src, srcStride*height); | |
29 else | |
30 { | |
31 for(i=0; i<height; i++) | |
32 { | |
33 mem2agpcpy(dst, src, bytesPerLine); | |
34 src+= srcStride; | |
35 dst+= dstStride; | |
36 } | |
37 } | |
38 | |
39 return retval; | |
40 } | |
41 | |
5504
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
42 static inline void * memcpy_pic(void * dst, void * src, int bytesPerLine, int height, int dstStride, int srcStride) |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
43 { |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
44 int i; |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
45 void *retval=dst; |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
46 |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
47 if(dstStride == srcStride) memcpy(dst, src, srcStride*height); |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
48 else |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
49 { |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
50 for(i=0; i<height; i++) |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
51 { |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
52 memcpy(dst, src, bytesPerLine); |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
53 src+= srcStride; |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
54 dst+= dstStride; |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
55 } |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
56 } |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
57 |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
58 return retval; |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
59 } |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
60 |
4681 | 61 #endif |