Mercurial > mplayer.hg
annotate libvo/fastmemcpy.h @ 23600:dd8610d25dc5
Remove the now unused demux_mkv_change_subs function
author | reimar |
---|---|
date | Sun, 24 Jun 2007 08:12:08 +0000 |
parents | a124f3abc1ec |
children | 5c3c7efd9b75 |
rev | line source |
---|---|
23385 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or | |
5 * modify it under the terms of the GNU Lesser General Public | |
6 * License as published by the Free Software Foundation; either | |
7 * version 2.1 of the License, or (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 * Lesser General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU Lesser General Public | |
15 * License along with MPlayer; if not, write to the Free Software | |
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
17 */ | |
18 | |
477 | 19 #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
|
20 #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
|
21 |
13787
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
12663
diff
changeset
|
22 #include "config.h" |
22003
6fd6bf6269f3
fastmemcpy.h always has to include inttypes.h on systems that need it.
diego
parents:
22000
diff
changeset
|
23 #include <inttypes.h> |
800 | 24 |
1131 | 25 #ifdef USE_FASTMEMCPY |
26 #if defined(HAVE_MMX) || defined(HAVE_MMX2) || defined(HAVE_3DNOW) \ | |
27 /* || 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
|
28 #include <stddef.h> |
477 | 29 |
698
f0fbf1a9bf31
Moving fast_memcpy to separate file (Size optimization)
nickols_k
parents:
685
diff
changeset
|
30 extern void * fast_memcpy(void * to, const void * from, size_t len); |
4681 | 31 extern void * mem2agpcpy(void * to, const void * from, size_t len); |
513 | 32 |
4681 | 33 #else /* HAVE_MMX/MMX2/3DNOW/SSE/SSE2 */ |
34 #define mem2agpcpy(a,b,c) memcpy(a,b,c) | |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
23385
diff
changeset
|
35 #define fast_memcpy(a,b,c) memcpy(a,b,c) |
478 | 36 #endif |
4681 | 37 |
38 #else /* USE_FASTMEMCPY */ | |
39 #define mem2agpcpy(a,b,c) memcpy(a,b,c) | |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
23385
diff
changeset
|
40 #define fast_memcpy(a,b,c) memcpy(a,b,c) |
4681 | 41 #endif |
4708 | 42 |
17095 | 43 static inline void * mem2agpcpy_pic(void * dst, const void * src, int bytesPerLine, int height, int dstStride, int srcStride) |
4708 | 44 { |
45 int i; | |
46 void *retval=dst; | |
47 | |
15069
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
48 if(dstStride == srcStride) |
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
49 { |
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
50 if (srcStride < 0) { |
22000
f7c209352770
get rid of void pointer arithmetic, as spotted by ICC
gpoirier
parents:
17095
diff
changeset
|
51 src = (uint8_t*)src + (height-1)*srcStride; |
f7c209352770
get rid of void pointer arithmetic, as spotted by ICC
gpoirier
parents:
17095
diff
changeset
|
52 dst = (uint8_t*)dst + (height-1)*dstStride; |
15069
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
53 srcStride = -srcStride; |
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
54 } |
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
55 |
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
56 mem2agpcpy(dst, src, srcStride*height); |
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
57 } |
4708 | 58 else |
59 { | |
60 for(i=0; i<height; i++) | |
61 { | |
62 mem2agpcpy(dst, src, bytesPerLine); | |
22000
f7c209352770
get rid of void pointer arithmetic, as spotted by ICC
gpoirier
parents:
17095
diff
changeset
|
63 src = (uint8_t*)src + srcStride; |
f7c209352770
get rid of void pointer arithmetic, as spotted by ICC
gpoirier
parents:
17095
diff
changeset
|
64 dst = (uint8_t*)dst + dstStride; |
4708 | 65 } |
66 } | |
67 | |
68 return retval; | |
69 } | |
70 | |
17095 | 71 static inline void * memcpy_pic(void * dst, const void * src, int bytesPerLine, int height, int dstStride, int srcStride) |
5504
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
72 { |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
73 int i; |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
74 void *retval=dst; |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
75 |
15069
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
76 if(dstStride == srcStride) |
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
77 { |
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
78 if (srcStride < 0) { |
22000
f7c209352770
get rid of void pointer arithmetic, as spotted by ICC
gpoirier
parents:
17095
diff
changeset
|
79 src = (uint8_t*)src + (height-1)*srcStride; |
f7c209352770
get rid of void pointer arithmetic, as spotted by ICC
gpoirier
parents:
17095
diff
changeset
|
80 dst = (uint8_t*)dst + (height-1)*dstStride; |
15069
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
81 srcStride = -srcStride; |
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
82 } |
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
83 |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
23385
diff
changeset
|
84 fast_memcpy(dst, src, srcStride*height); |
15069
3f5daa60e049
support for negative strides (fixes -vf spp,flip crash)
henry
parents:
13787
diff
changeset
|
85 } |
5504
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
86 else |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
87 { |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
88 for(i=0; i<height; i++) |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
89 { |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
23385
diff
changeset
|
90 fast_memcpy(dst, src, bytesPerLine); |
22000
f7c209352770
get rid of void pointer arithmetic, as spotted by ICC
gpoirier
parents:
17095
diff
changeset
|
91 src = (uint8_t*)src + srcStride; |
f7c209352770
get rid of void pointer arithmetic, as spotted by ICC
gpoirier
parents:
17095
diff
changeset
|
92 dst = (uint8_t*)dst + dstStride; |
5504
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
93 } |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
94 } |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
95 |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
96 return retval; |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
97 } |
23ba417cf64b
memcpy_pic() added (copy image plane with src/dst stride)
arpi
parents:
4708
diff
changeset
|
98 |
4681 | 99 #endif |