diff --git a/pcsx2/IPU/IPU.cpp b/pcsx2/IPU/IPU.cpp index 07928fe8f1..3ac8db1d12 100644 --- a/pcsx2/IPU/IPU.cpp +++ b/pcsx2/IPU/IPU.cpp @@ -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])) *(u32*)p = 0; - else - p[3] = ((p[0] < s_thresh[1]) && (p[1] < s_thresh[1]) && (p[2] < s_thresh[1])) ? 0x40 : 0x80; + else if ((p[0] < s_thresh[1]) && (p[1] < s_thresh[1]) && (p[2] < s_thresh[1])) + p[3] = 0x40; } } else if (s_thresh[1] > 0) { 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; - } - } - else - { - for (i = 0; i < 64; i++, p += 16) - { - p[3] = p[7] = p[11] = p[15] = 0x80; + if ((p[0] < s_thresh[1]) && (p[1] < s_thresh[1]) && (p[2] < s_thresh[1])) + p[3] = 0x40; } } } diff --git a/pcsx2/IPU/yuv2rgb.cpp b/pcsx2/IPU/yuv2rgb.cpp index 383beb0318..108fa91975 100644 --- a/pcsx2/IPU/yuv2rgb.cpp +++ b/pcsx2/IPU/yuv2rgb.cpp @@ -155,6 +155,12 @@ ihatemsvc: paddsw xmm2, xmm6 paddsw xmm5, xmm7 + // 0x80; a constant is probably so much better + pcmpeqb xmm7, xmm7 + psllw xmm7, 15 + psrlw xmm7, 8 + packuswb xmm7, xmm7 + // round movaps xmm6, xmmword ptr [edx+ROUND_1BIT] paddw xmm0, xmm6 @@ -289,6 +295,12 @@ ihatemsvc: "paddsw xmm2, xmm6\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 "movaps xmm6, xmmword ptr [%[sse2_tables]+%c[ROUND_1BIT]]\n" "paddw xmm0, xmm6\n"