This commit is contained in:
gabest
2008-06-27 11:39:12 +00:00
parent df1af73344
commit d49e1c1c7a
3 changed files with 29 additions and 5 deletions

View File

@@ -78,7 +78,7 @@ GSSource : public CBaseFilter, private CCritSec, public IGSSource
vih.bmiHeader.biWidth = m_size.cx;
vih.bmiHeader.biHeight = m_size.cy;
#if _M_SSE >= 0x400
#if _M_SSE >= 0x200
// YUY2
@@ -237,15 +237,15 @@ public:
int h = m_size.cy;
int srcpitch = pitch;
#if _M_SSE >= 0x400
#if _M_SSE >= 0x200
if(mt.subtype == MEDIASUBTYPE_YUY2)
{
int dstpitch = ((VIDEOINFOHEADER*)mt.Format())->bmiHeader.biWidth * 2;
const GSVector4 ys(0.098f, 0.504f, 0.257f);
const GSVector4 us(0.439f / 2, -0.291f / 2, -0.148f / 2);
const GSVector4 vs(-0.071f / 2, -0.368f / 2, 0.439f / 2);
const GSVector4 ys(0.098f, 0.504f, 0.257f, 0.0f);
const GSVector4 us(0.439f / 2, -0.291f / 2, -0.148f / 2, 0.0f);
const GSVector4 vs(-0.071f / 2, -0.368f / 2, 0.439f / 2, 0.0f);
const GSVector4 offset(16, 128, 16, 128);
for(int j = 0; j < h; j++, dst += dstpitch, src += srcpitch)
@@ -259,11 +259,22 @@ public:
GSVector4 c1 = GSVector4(s[i + 1]);
GSVector4 c2 = c0 + c1;
#if 0//_M_SSE >= 0x400
GSVector4 lo = c0.dp<0x71>(ys) | c2.dp<0x72>(vs);
GSVector4 hi = c1.dp<0x74>(ys) | c2.dp<0x78>(us);
GSVector4 c = (lo | hi) + offset;
#else
GSVector4 lo = (c0 * ys).hadd(c2 * vs);
GSVector4 hi = (c1 * ys).hadd(c2 * us);
GSVector4 c = lo.hadd(hi) + offset;
#endif
*((DWORD*)&d[i]) = GSVector4i(c).rgba32();
}
}

View File

@@ -335,7 +335,12 @@ public:
template<int i> GSVector4i srl() const
{
#pragma warning(push)
#pragma warning(disable: 4556)
return GSVector4i(_mm_srli_si128(m, i));
#pragma warning(pop)
}
template<int i> GSVector4i srl(const GSVector4i& v)

View File

@@ -1066,6 +1066,14 @@
<File
RelativePath=".\GSCapture.cpp"
>
<FileConfiguration
Name="Release SSE2|Win32"
>
<Tool
Name="VCCLCompilerTool"
AssemblerOutput="4"
/>
</FileConfiguration>
<FileConfiguration
Name="Release SSE4|Win32"
>