diff options
author | Aleksoid <aleksoid@users.sourceforge.net> | 2008-07-29 04:37:18 +0400 |
---|---|---|
committer | Aleksoid <aleksoid@users.sourceforge.net> | 2008-07-29 04:37:18 +0400 |
commit | a62c101e468c4a14b4d18b610c44e8fa678939cf (patch) | |
tree | b2a1ac6be22ad42b4884948a7039c8e7323cf7fe /src/subtitles/Rasterizer.cpp | |
parent | 98aaae828ca747514ac16d89a3bca95b7516e2a4 (diff) |
FIX : x64 version linkin error(error in Subtitle engine)
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@701 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/subtitles/Rasterizer.cpp')
-rw-r--r-- | src/subtitles/Rasterizer.cpp | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/src/subtitles/Rasterizer.cpp b/src/subtitles/Rasterizer.cpp index 73ba04c11..3942b08a0 100644 --- a/src/subtitles/Rasterizer.cpp +++ b/src/subtitles/Rasterizer.cpp @@ -896,6 +896,8 @@ static __forceinline void pixmix2_sse2(DWORD* dst, DWORD color, DWORD shapealpha *dst = (DWORD)_mm_cvtsi128_si32(r);
}
+#ifndef WIN64
+
#include <mmintrin.h>
// Calculate a - b clamping to 0 instead of underflowing
@@ -908,6 +910,7 @@ static __forceinline DWORD safe_subtract(DWORD a, DWORD b) _mm_empty();
return r;
}
+#endif
// For CPUID usage in Rasterizer::Draw
#include "../dsutil/vd.h"
@@ -1013,10 +1016,18 @@ CRect Rasterizer::Draw(SubPicDesc& spd, CRect& clipRect, byte* pAlphaMask, int x // subtraction must be saturating since the widened region
// pixel value can be smaller than the fill value.
// This happens when blur edges is used.
+#ifdef WIN64
+ pixmix_sse2(&dst[wt], color, (src[wt*2+1] - src[wt*2])<<6);
+#else
pixmix_sse2(&dst[wt], color, safe_subtract(src[wt*2+1], src[wt*2]));
+#endif
else
for(int wt=0; wt<w; ++wt)
+#ifdef WIN64
+ pixmix(&dst[wt], color, (src[wt*2+1] - src[wt*2])<<6);
+#else
pixmix(&dst[wt], color, safe_subtract(src[wt*2+1], src[wt*2]));
+#endif
}
}
// not (switchpts[1] == 0xffffffff)
@@ -1050,13 +1061,22 @@ CRect Rasterizer::Draw(SubPicDesc& spd, CRect& clipRect, byte* pAlphaMask, int x for(int wt=0; wt<w; ++wt)
{
if(wt+xo >= sw[1]) {while(wt+xo >= sw[1]) sw += 2; color = sw[-2];}
+#ifdef WIN64
+ pixmix_sse2(&dst[wt], color, (src[wt*2+1] - src[wt*2])<<6);
+#else
pixmix_sse2(&dst[wt], color, safe_subtract(src[wt*2+1], src[wt*2]));
+#endif
+
}
else
for(int wt=0; wt<w; ++wt)
{
if(wt+xo >= sw[1]) {while(wt+xo >= sw[1]) sw += 2; color = sw[-2];}
+#ifdef WIN64
+ pixmix(&dst[wt], color, (src[wt*2+1] - src[wt*2])<<6);
+#else
pixmix(&dst[wt], color, safe_subtract(src[wt*2+1], src[wt*2]));
+#endif
}
}
}
@@ -1084,10 +1104,18 @@ CRect Rasterizer::Draw(SubPicDesc& spd, CRect& clipRect, byte* pAlphaMask, int x {
if(fSSE2)
for(int wt=0; wt<w; ++wt)
+#ifdef WIN64
+ pixmix_sse2(&dst[wt], color, (src[wt*2+1] - src[wt*2]) * am[wt]);
+#else
pixmix2_sse2(&dst[wt], color, safe_subtract(src[wt*2+1], src[wt*2]), am[wt]);
+#endif
else
for(int wt=0; wt<w; ++wt)
+#ifdef WIN64
+ pixmix(&dst[wt], color, (src[wt*2+1] - src[wt*2]) * am[wt]);
+#else
pixmix2(&dst[wt], color, safe_subtract(src[wt*2+1], src[wt*2]), am[wt]);
+#endif
}
}
else
@@ -1123,8 +1151,12 @@ CRect Rasterizer::Draw(SubPicDesc& spd, CRect& clipRect, byte* pAlphaMask, int x if(wt+xo >= sw[1]) {
while(wt+xo >= sw[1])
sw += 2; color = sw[-2];
- }
+ }
+#ifdef WIN64
+ pixmix_sse2(&dst[wt], color, (src[wt*2+1] - src[wt*2]) * am[wt]);
+#else
pixmix2_sse2(&dst[wt], color, safe_subtract(src[wt*2+1], src[wt*2]), am[wt]);
+#endif
}
else
for(int wt=0; wt<w; ++wt)
@@ -1132,8 +1164,12 @@ CRect Rasterizer::Draw(SubPicDesc& spd, CRect& clipRect, byte* pAlphaMask, int x if(wt+xo >= sw[1]) {
while(wt+xo >= sw[1])
sw += 2; color = sw[-2];
- }
+ }
+#ifdef WIN64
+ pixmix(&dst[wt], color, (src[wt*2+1] - src[wt*2]) * am[wt]);
+#else
pixmix2(&dst[wt], color, safe_subtract(src[wt*2+1], src[wt*2]), am[wt]);
+#endif
}
}
}
@@ -1148,7 +1184,9 @@ CRect Rasterizer::Draw(SubPicDesc& spd, CRect& clipRect, byte* pAlphaMask, int x // Remember to EMMS!
// Rendering fails in funny ways if we don't do this.
+#ifndef WIN64
_mm_empty();
+#endif
return bbox;
}
|