mirror of https://github.com/PCSX2/pcsx2.git
IPU: include default alpha in SSE code for maybe a small speed gain.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3107 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
d8b0ac03e5
commit
a98072a3ca
|
@ -1166,22 +1166,16 @@ void __fastcall ipu_csc(macroblock_8 *mb8, macroblock_rgb32 *rgb32, int sgn)
|
||||||
{
|
{
|
||||||
if ((p[0] < s_thresh[0]) && (p[1] < s_thresh[0]) && (p[2] < s_thresh[0]))
|
if ((p[0] < s_thresh[0]) && (p[1] < s_thresh[0]) && (p[2] < s_thresh[0]))
|
||||||
*(u32*)p = 0;
|
*(u32*)p = 0;
|
||||||
else
|
else if ((p[0] < s_thresh[1]) && (p[1] < s_thresh[1]) && (p[2] < s_thresh[1]))
|
||||||
p[3] = ((p[0] < s_thresh[1]) && (p[1] < s_thresh[1]) && (p[2] < s_thresh[1])) ? 0x40 : 0x80;
|
p[3] = 0x40;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (s_thresh[1] > 0)
|
else if (s_thresh[1] > 0)
|
||||||
{
|
{
|
||||||
for (i = 0; i < 64*4; i++, p += 4)
|
for (i = 0; i < 64*4; i++, p += 4)
|
||||||
{
|
{
|
||||||
p[3] = ((p[0] < s_thresh[1]) && (p[1] < s_thresh[1]) && (p[2] < s_thresh[1])) ? 0x40 : 0x80;
|
if ((p[0] < s_thresh[1]) && (p[1] < s_thresh[1]) && (p[2] < s_thresh[1]))
|
||||||
}
|
p[3] = 0x40;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (i = 0; i < 64; i++, p += 16)
|
|
||||||
{
|
|
||||||
p[3] = p[7] = p[11] = p[15] = 0x80;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,6 +155,12 @@ ihatemsvc:
|
||||||
paddsw xmm2, xmm6
|
paddsw xmm2, xmm6
|
||||||
paddsw xmm5, xmm7
|
paddsw xmm5, xmm7
|
||||||
|
|
||||||
|
// 0x80; a constant is probably so much better
|
||||||
|
pcmpeqb xmm7, xmm7
|
||||||
|
psllw xmm7, 15
|
||||||
|
psrlw xmm7, 8
|
||||||
|
packuswb xmm7, xmm7
|
||||||
|
|
||||||
// round
|
// round
|
||||||
movaps xmm6, xmmword ptr [edx+ROUND_1BIT]
|
movaps xmm6, xmmword ptr [edx+ROUND_1BIT]
|
||||||
paddw xmm0, xmm6
|
paddw xmm0, xmm6
|
||||||
|
@ -289,6 +295,12 @@ ihatemsvc:
|
||||||
"paddsw xmm2, xmm6\n"
|
"paddsw xmm2, xmm6\n"
|
||||||
"paddsw xmm5, xmm7\n"
|
"paddsw xmm5, xmm7\n"
|
||||||
|
|
||||||
|
// 0x80; a constant is probably so much better
|
||||||
|
"pcmpeqb xmm7, xmm7\n"
|
||||||
|
"psllw xmm7, 15\n"
|
||||||
|
"psrlw xmm7, 8\n"
|
||||||
|
"packuswb xmm7, xmm7\n"
|
||||||
|
|
||||||
// round
|
// round
|
||||||
"movaps xmm6, xmmword ptr [%[sse2_tables]+%c[ROUND_1BIT]]\n"
|
"movaps xmm6, xmmword ptr [%[sse2_tables]+%c[ROUND_1BIT]]\n"
|
||||||
"paddw xmm0, xmm6\n"
|
"paddw xmm0, xmm6\n"
|
||||||
|
|
Loading…
Reference in New Issue