From: Anuradha S. <asu...@us...> - 2005-02-16 17:20:07
|
Update of /cvsroot/dirac/compress/extras/dirac_dshow/src/dsutil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18144/extras/dirac_dshow/src/dsutil Added Files: DSUtil.cpp DSUtil.h MediaTypes.cpp MediaTypes.h NullRenderers.cpp NullRenderers.h a_yuv2rgb.asm a_yuvtable.asm convert_a.asm dsutil.vcproj stdafx.cpp stdafx.h text.cpp text.h vd.cpp vd.h Log Message: Patches and DirectShow filter related files --- NEW FILE: MediaTypes.cpp --- /* * Copyright (C) 2003-2004 Gabest * http://www.gabest.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Make; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #include "stdafx.h" #include <initguid.h> #include "..\..\include\moreuuids.h" #include "MediaTypes.h" #include "DSUtil.h" #define VIH_NORMAL (sizeof(VIDEOINFOHEADER)) #define VIH_BITFIELDS (sizeof(VIDEOINFOHEADER)+3*sizeof(RGBQUAD)) #define VIH2_NORMAL (sizeof(VIDEOINFOHEADER2)) #define VIH2_BITFIELDS (sizeof(VIDEOINFOHEADER2)+3*sizeof(RGBQUAD)) #define BIH_SIZE (sizeof(BITMAPINFOHEADER)) VIH vihs[] = { // YUY2 { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 16, mmioFOURCC('Y','U','Y','2'), 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH_NORMAL, // size &MEDIASUBTYPE_YUY2 // subtype }, // YV12 { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 12, mmioFOURCC('Y','V','1','2'), 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH_NORMAL, // size &MEDIASUBTYPE_YV12 // subtype }, // I420 { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 12, mmioFOURCC('I','4','2','0'), 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH_NORMAL, // size &MEDIASUBTYPE_I420 // subtype }, // IYUV { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 12, mmioFOURCC('I','Y','U','V'), 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH_NORMAL, // size &MEDIASUBTYPE_IYUV // subtype }, // 8888 normal { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 32, BI_RGB, 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH_NORMAL, // size &MEDIASUBTYPE_RGB32 // subtype }, // 8888 bitf { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 32, BI_BITFIELDS, 0, 0, 0, 0, 0} // bmiHeader }, {0xFF0000, 0x00FF00, 0x0000FF}, // mask[3] VIH_BITFIELDS, // size &MEDIASUBTYPE_RGB32 // subtype }, // A888 normal { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 32, BI_RGB, 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH_NORMAL, // size &MEDIASUBTYPE_ARGB32 // subtype }, // A888 bitf (I'm not sure if this exist...) { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 32, BI_BITFIELDS, 0, 0, 0, 0, 0} // bmiHeader }, {0xFF0000, 0x00FF00, 0x0000FF}, // mask[3] VIH_BITFIELDS, // size &MEDIASUBTYPE_ARGB32 // subtype }, // 888 normal { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 24, BI_RGB, 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH_NORMAL, // size &MEDIASUBTYPE_RGB24 // subtype }, // 888 bitf { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 24, BI_BITFIELDS, 0, 0, 0, 0, 0} // bmiHeader }, {0xFF0000, 0x00FF00, 0x0000FF}, // mask[3] VIH_BITFIELDS, // size &MEDIASUBTYPE_RGB24 // subtype }, // 565 normal { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 16, BI_RGB, 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH_NORMAL, // size &MEDIASUBTYPE_RGB565 // subtype }, // 565 bitf { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 16, BI_BITFIELDS, 0, 0, 0, 0, 0} // bmiHeader }, {0xF800, 0x07E0, 0x001F}, // mask[3] VIH_BITFIELDS, // size &MEDIASUBTYPE_RGB565 // subtype }, // 555 normal { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 16, BI_RGB, 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH_NORMAL, // size &MEDIASUBTYPE_RGB555 // subtype }, // 555 bitf { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 16, BI_BITFIELDS, 0, 0, 0, 0, 0} // bmiHeader }, {0x7C00, 0x03E0, 0x001F}, // mask[3] VIH_BITFIELDS, // size &MEDIASUBTYPE_RGB555 // subtype }, }; VIH2 vih2s[] = { // YUY2 { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 16, mmioFOURCC('Y','U','Y','2'), 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH2_NORMAL, // size &MEDIASUBTYPE_YUY2 // subtype }, // YV12 { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 12, mmioFOURCC('Y','V','1','2'), 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH2_NORMAL, // size &MEDIASUBTYPE_YV12 // subtype }, // I420 { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 12, mmioFOURCC('I','4','2','0'), 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH2_NORMAL, // size &MEDIASUBTYPE_I420 // subtype }, // IYUV { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 12, mmioFOURCC('I','Y','U','V'), 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH2_NORMAL, // size &MEDIASUBTYPE_IYUV // subtype }, // 8888 normal { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 32, BI_RGB, 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH2_NORMAL, // size &MEDIASUBTYPE_RGB32 // subtype }, // 8888 bitf { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 32, BI_BITFIELDS, 0, 0, 0, 0, 0} // bmiHeader }, {0xFF0000, 0x00FF00, 0x0000FF}, // mask[3] VIH2_BITFIELDS, // size &MEDIASUBTYPE_RGB32 // subtype }, // A888 normal { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 32, BI_RGB, 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH2_NORMAL, // size &MEDIASUBTYPE_ARGB32 // subtype }, // A888 bitf (I'm not sure if this exist...) { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 32, BI_BITFIELDS, 0, 0, 0, 0, 0} // bmiHeader }, {0xFF0000, 0x00FF00, 0x0000FF}, // mask[3] VIH2_BITFIELDS, // size &MEDIASUBTYPE_ARGB32 // subtype }, // 888 normal { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 24, BI_RGB, 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH2_NORMAL, // size &MEDIASUBTYPE_RGB24 // subtype }, // 888 bitf { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 24, BI_BITFIELDS, 0, 0, 0, 0, 0} // bmiHeader }, {0xFF0000, 0x00FF00, 0x0000FF}, // mask[3] VIH2_BITFIELDS, // size &MEDIASUBTYPE_RGB24 // subtype }, // 565 normal { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 16, BI_RGB, 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH2_NORMAL, // size &MEDIASUBTYPE_RGB565 // subtype }, // 565 bitf { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 16, BI_BITFIELDS, 0, 0, 0, 0, 0} // bmiHeader }, {0xF800, 0x07E0, 0x001F}, // mask[3] VIH2_BITFIELDS, // size &MEDIASUBTYPE_RGB565 // subtype }, // 555 normal { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 16, BI_RGB, 0, 0, 0, 0, 0} // bmiHeader }, {0, 0, 0}, // mask[3] VIH2_NORMAL, // size &MEDIASUBTYPE_RGB555 // subtype }, // 555 bitf { { {0, 0, 0, 0}, {0, 0, 0, 0}, 0, 0, 0, 0, 0, 0, 0, 0, 0, {BIH_SIZE, 0, 0, 1, 16, BI_BITFIELDS, 0, 0, 0, 0, 0} // bmiHeader }, {0x7C00, 0x03E0, 0x001F}, // mask[3] VIH2_BITFIELDS, // size &MEDIASUBTYPE_RGB555 // subtype }, }; int VIHSIZE = countof(vihs); CString VIH2String(int i) { CString ret = CString(GuidNames[*vihs[i].subtype]); if(!ret.Left(13).CompareNoCase(_T("MEDIASUBTYPE_"))) ret = ret.Mid(13); if(vihs[i].vih.bmiHeader.biCompression == 3) ret += _T(" BITF"); if(*vihs[i].subtype == MEDIASUBTYPE_I420) ret = _T("I420"); // FIXME return(ret); } CString Subtype2String(const GUID& subtype) { CString ret = CString(GuidNames[subtype]); if(!ret.Left(13).CompareNoCase(_T("MEDIASUBTYPE_"))) ret = ret.Mid(13); if(subtype == MEDIASUBTYPE_I420) ret = _T("I420"); // FIXME return(ret); } void CorrectMediaType(AM_MEDIA_TYPE* pmt) { if(!pmt) return; CMediaType mt(*pmt); if(mt.formattype == FORMAT_VideoInfo) { VIDEOINFOHEADER* vih = (VIDEOINFOHEADER*)mt.pbFormat; for(int i = 0; i < VIHSIZE; i++) { if(mt.subtype == *vihs[i].subtype && vih->bmiHeader.biCompression == vihs[i].vih.bmiHeader.biCompression) { mt.AllocFormatBuffer(vihs[i].size); memcpy(mt.pbFormat, &vihs[i], vihs[i].size); memcpy(mt.pbFormat, pmt->pbFormat, sizeof(VIDEOINFOHEADER)); break; } } } else if(mt.formattype == FORMAT_VideoInfo2) { VIDEOINFOHEADER2* vih2 = (VIDEOINFOHEADER2*)mt.pbFormat; for(int i = 0; i < VIHSIZE; i++) { if(mt.subtype == *vih2s[i].subtype && vih2->bmiHeader.biCompression == vih2s[i].vih.bmiHeader.biCompression) { mt.AllocFormatBuffer(vih2s[i].size); memcpy(mt.pbFormat, &vih2s[i], vih2s[i].size); memcpy(mt.pbFormat, pmt->pbFormat, sizeof(VIDEOINFOHEADER2)); break; } } } CopyMediaType(pmt, &mt); } --- NEW FILE: NullRenderers.h --- /* * Copyright (C) 2003-2004 Gabest * http://www.gabest.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Make; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #pragma once #include <atlcoll.h> class CNullRenderer : public CBaseRenderer { protected: HRESULT DoRenderSample(IMediaSample* pSample) {return S_OK;} public: CNullRenderer(REFCLSID clsid, TCHAR* pName) : CBaseRenderer(clsid, pName, NULL, NULL) {} }; [uuid("579883A0-4E2D-481F-9436-467AAFAB7DE8")] class CNullVideoRenderer : public CNullRenderer { protected: HRESULT CheckMediaType(const CMediaType* pmt); public: CNullVideoRenderer() : CNullRenderer(__uuidof(this), NAME("Null Video Renderer")) {} }; [uuid("DD9ED57D-6ABF-42E8-89A2-11D04798DC58")] class CNullUVideoRenderer : public CNullRenderer { protected: HRESULT CheckMediaType(const CMediaType* pmt); public: CNullUVideoRenderer() : CNullRenderer(__uuidof(this), NAME("Null Video Renderer (Uncompressed)")) {} }; [uuid("0C38BDFD-8C17-4E00-A344-F89397D3E22A")] class CNullAudioRenderer : public CNullRenderer { protected: HRESULT CheckMediaType(const CMediaType* pmt); public: CNullAudioRenderer() : CNullRenderer(__uuidof(this), NAME("Null Audio Renderer")) {} }; [uuid("64A45125-7343-4772-9DA4-179FAC9D462C")] class CNullUAudioRenderer : public CNullRenderer { protected: HRESULT CheckMediaType(const CMediaType* pmt); public: CNullUAudioRenderer() : CNullRenderer(__uuidof(this), NAME("Null Audio Renderer (Uncompressed)")) {} }; [uuid("655D7613-C26C-4A25-BBBD-3C9C516122CC")] class CNullTextRenderer : public CBaseFilter, public CCritSec { class CTextInputPin : public CBaseInputPin { public: CTextInputPin(CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr) : CBaseInputPin(NAME("CTextInputPin"), pFilter, pLock, phr, L"In") {} HRESULT CheckMediaType(const CMediaType* pmt); }; CAutoPtr<CTextInputPin> m_pInput; public: CNullTextRenderer(LPUNKNOWN pUnk, HRESULT* phr); int GetPinCount() {return (int)!!m_pInput;} CBasePin* GetPin(int n) {return n == 0 ? (CBasePin*)m_pInput : NULL;} }; --- NEW FILE: NullRenderers.cpp --- /* * Copyright (C) 2003-2004 Gabest * http://www.gabest.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Make; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #include "StdAfx.h" #include "NullRenderers.h" #include "..\..\include\moreuuids.h" #include "..\..\include\matroska\matroska.h" // // CNullVideoRenderer // HRESULT CNullVideoRenderer::CheckMediaType(const CMediaType* pmt) { return pmt->majortype == MEDIATYPE_Video || pmt->subtype == MEDIASUBTYPE_MPEG2_VIDEO ? S_OK : E_FAIL; } // // CNullUVideoRenderer // HRESULT CNullUVideoRenderer::CheckMediaType(const CMediaType* pmt) { return pmt->majortype == MEDIATYPE_Video && (pmt->subtype == MEDIASUBTYPE_YV12 || pmt->subtype == MEDIASUBTYPE_I420 || pmt->subtype == MEDIASUBTYPE_YUYV || pmt->subtype == MEDIASUBTYPE_IYUV || pmt->subtype == MEDIASUBTYPE_YVU9 || pmt->subtype == MEDIASUBTYPE_Y411 || pmt->subtype == MEDIASUBTYPE_Y41P || pmt->subtype == MEDIASUBTYPE_YUY2 || pmt->subtype == MEDIASUBTYPE_YVYU || pmt->subtype == MEDIASUBTYPE_UYVY || pmt->subtype == MEDIASUBTYPE_Y211 || pmt->subtype == MEDIASUBTYPE_RGB1 || pmt->subtype == MEDIASUBTYPE_RGB4 || pmt->subtype == MEDIASUBTYPE_RGB8 || pmt->subtype == MEDIASUBTYPE_RGB565 || pmt->subtype == MEDIASUBTYPE_RGB555 || pmt->subtype == MEDIASUBTYPE_RGB24 || pmt->subtype == MEDIASUBTYPE_RGB32 || pmt->subtype == MEDIASUBTYPE_ARGB1555 || pmt->subtype == MEDIASUBTYPE_ARGB4444 || pmt->subtype == MEDIASUBTYPE_ARGB32 || pmt->subtype == MEDIASUBTYPE_A2R10G10B10 || pmt->subtype == MEDIASUBTYPE_A2B10G10R10) ? S_OK : E_FAIL; } // // CNullAudioRenderer // HRESULT CNullAudioRenderer::CheckMediaType(const CMediaType* pmt) { return pmt->majortype == MEDIATYPE_Audio || pmt->majortype == MEDIATYPE_Midi || pmt->subtype == MEDIASUBTYPE_MPEG2_AUDIO || pmt->subtype == MEDIASUBTYPE_DOLBY_AC3 || pmt->subtype == MEDIASUBTYPE_DVD_LPCM_AUDIO || pmt->subtype == MEDIASUBTYPE_DTS || pmt->subtype == MEDIASUBTYPE_SDDS || pmt->subtype == MEDIASUBTYPE_MPEG1AudioPayload || pmt->subtype == MEDIASUBTYPE_MPEG1Audio || pmt->subtype == MEDIASUBTYPE_MPEG1Audio ? S_OK : E_FAIL; } // // CNullUAudioRenderer // HRESULT CNullUAudioRenderer::CheckMediaType(const CMediaType* pmt) { return pmt->majortype == MEDIATYPE_Audio && (pmt->subtype == MEDIASUBTYPE_PCM || pmt->subtype == MEDIASUBTYPE_IEEE_FLOAT || pmt->subtype == MEDIASUBTYPE_DRM_Audio || pmt->subtype == MEDIASUBTYPE_DOLBY_AC3_SPDIF || pmt->subtype == MEDIASUBTYPE_RAW_SPORT || pmt->subtype == MEDIASUBTYPE_SPDIF_TAG_241h) ? S_OK : E_FAIL; } // // CNullTextRenderer // HRESULT CNullTextRenderer::CTextInputPin::CheckMediaType(const CMediaType* pmt) { return pmt->majortype == MEDIATYPE_Text || pmt->majortype == MEDIATYPE_ScriptCommand || pmt->majortype == MEDIATYPE_Subtitle || pmt->subtype == MEDIASUBTYPE_DVD_SUBPICTURE || pmt->subtype == MEDIASUBTYPE_CVD_SUBPICTURE || pmt->subtype == MEDIASUBTYPE_SVCD_SUBPICTURE ? S_OK : E_FAIL; } CNullTextRenderer::CNullTextRenderer(LPUNKNOWN pUnk, HRESULT* phr) : CBaseFilter(NAME("CNullTextRenderer"), pUnk, this, __uuidof(this), phr) { m_pInput.Attach(new CTextInputPin(this, this, phr)); } --- NEW FILE: vd.cpp --- // VirtualDub - Video processing and capture application // Copyright (C) 1998-2001 Avery Lee // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // Notes: // - BitBltFromI420ToRGB is from VirtualDub [...1176 lines suppressed...] if(g_cpuid.m_flags & CCpuID::flag_t::mmx) { YUY2toRGB = dbpp == 32 ? mmx_YUY2toRGB32 : dbpp == 24 ? mmx_YUY2toRGB24 : // dbpp == 16 ? mmx_YUY2toRGB16 : // TODO NULL; } else { // TODO } if(!YUY2toRGB) return(false); YUY2toRGB(src, dst, src + h*srcpitch, srcpitch, w, false); return(true); } --- NEW FILE: dsutil.vcproj --- <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="7.10" Name="dsutil" ProjectGUID="{FC70988B-1AE5-4381-866D-4F405E28AC42}" Keyword="Win32Proj"> <Platforms> <Platform Name="Win32"/> </Platforms> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="Debug" IntermediateDirectory="Debug" ConfigurationType="4" UseOfMFC="2" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="C:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\C++\DirectShow\BaseClasses" PreprocessorDefinitions="WIN32;_DEBUG;_LIB" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLibrarianTool" AdditionalDependencies="vfw32.lib Version.lib" OutputFile="../../lib/$(ConfigurationName)/$(ProjectName)D.lib" IgnoreAllDefaultLibraries="FALSE"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Release|Win32" OutputDirectory="Release" IntermediateDirectory="Release" ConfigurationType="4" UseOfMFC="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="TRUE" AdditionalIncludeDirectories=""C:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\C++\DirectShow\BaseClasses"" PreprocessorDefinitions="WIN32;NDEBUG;_LIB" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLibrarianTool" AdditionalDependencies="vfw32.lib Version.lib" OutputFile="../../lib/$(ConfigurationName)/$(ProjectName)R.lib"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Debug Unicode|Win32" OutputDirectory="Debug Unicode" IntermediateDirectory="Debug Unicode" ConfigurationType="4" UseOfMFC="2" CharacterSet="1"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="C:\Program Files\Microsoft DirectX 9.0 SDK (October 2004)\Samples\C++\DirectShow\BaseClasses" PreprocessorDefinitions="WIN32;_DEBUG;_LIB" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLibrarianTool" AdditionalDependencies="vfw32.lib Version.lib" OutputFile="../../lib/$(ConfigurationName)/$(ProjectName)DU.lib"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Release Unicode|Win32" OutputDirectory="Release Unicode" IntermediateDirectory="Release Unicode" ConfigurationType="4" UseOfMFC="1" CharacterSet="1"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="TRUE" AdditionalIncludeDirectories=""C:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\C++\DirectShow\BaseClasses"" PreprocessorDefinitions="WIN32;NDEBUG;_LIB" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLibrarianTool" AdditionalDependencies="vfw32.lib Version.lib" OutputFile="../../lib/$(ConfigurationName)/$(ProjectName)RU.lib"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Static-Debug|Win32" OutputDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" UseOfMFC="2" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="C:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\C++\DirectShow\BaseClasses" PreprocessorDefinitions="WIN32;_DEBUG;_LIB" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLibrarianTool" AdditionalDependencies="vfw32.lib Version.lib" OutputFile="../../lib/$(ConfigurationName)/$(ProjectName)D.lib" IgnoreAllDefaultLibraries="FALSE"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Static-Release|Win32" OutputDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" UseOfMFC="1" CharacterSet="2"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="TRUE" AdditionalIncludeDirectories=""C:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\C++\DirectShow\BaseClasses"" PreprocessorDefinitions="WIN32;NDEBUG;_LIB" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLibrarianTool" AdditionalDependencies="vfw32.lib Version.lib" OutputFile="../../lib/$(ConfigurationName)/$(ProjectName)R.lib"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Static-Release Unicode|Win32" OutputDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" UseOfMFC="1" CharacterSet="1"> <Tool Name="VCCLCompilerTool" Optimization="2" InlineFunctionExpansion="1" OmitFramePointers="TRUE" AdditionalIncludeDirectories=""C:\Program Files\Microsoft DirectX 9.0 SDK (Summer 2004)\Samples\C++\DirectShow\BaseClasses"" PreprocessorDefinitions="WIN32;NDEBUG;_LIB" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="3"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLibrarianTool" AdditionalDependencies="vfw32.lib Version.lib" OutputFile="../../lib/$(ConfigurationName)/$(ProjectName)RU.lib"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> <Configuration Name="Static-Debug Unicode|Win32" OutputDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" UseOfMFC="2" CharacterSet="1"> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="C:\Program Files\Microsoft DirectX 9.0 SDK (October 2004)\Samples\C++\DirectShow\BaseClasses" PreprocessorDefinitions="WIN32;_DEBUG;_LIB" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="3" WarningLevel="3" Detect64BitPortabilityProblems="FALSE" DebugInformationFormat="4"/> <Tool Name="VCCustomBuildTool"/> <Tool Name="VCLibrarianTool" AdditionalDependencies="vfw32.lib Version.lib" OutputFile="../../lib/$(ConfigurationName)/$(ProjectName)DU.lib"/> <Tool Name="VCMIDLTool"/> <Tool Name="VCPostBuildEventTool"/> <Tool Name="VCPreBuildEventTool"/> <Tool Name="VCPreLinkEventTool"/> <Tool Name="VCResourceCompilerTool"/> <Tool Name="VCWebServiceProxyGeneratorTool"/> <Tool Name="VCXMLDataGeneratorTool"/> <Tool Name="VCManagedWrapperGeneratorTool"/> <Tool Name="VCAuxiliaryManagedWrapperGeneratorTool"/> </Configuration> </Configurations> <References> </References> <Files> <Filter Name="Source Files" Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> <File RelativePath=".\a_yuv2rgb.asm"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Debug Unicode|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Release Unicode|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Static-Debug|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Static-Release|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Static-Release Unicode|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Static-Debug Unicode|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> </File> <File RelativePath=".\a_yuvtable.asm"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Debug Unicode|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Release Unicode|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Static-Debug|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Static-Release|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Static-Release Unicode|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Static-Debug Unicode|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath) " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> </File> <File RelativePath=".\convert_a.asm"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath)" " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath)" " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Debug Unicode|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath)" " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Release Unicode|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath)" " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Static-Debug|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath)" " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Static-Release|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath)" " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Static-Release Unicode|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath)" " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> <FileConfiguration Name="Static-Debug Unicode|Win32"> <Tool Name="VCCustomBuildTool" CommandLine="ml /c /coff /Cx /nologo /Fo"$(OutDir)\$(InputName).obj" "$(InputPath)" " Outputs="$(OutDir)\$(InputName).obj"/> </FileConfiguration> </File> <File RelativePath="DSUtil.cpp"> </File> <File RelativePath="MediaTypes.cpp"> </File> <File RelativePath=".\NullRenderers.cpp"> </File> <File RelativePath="stdafx.cpp"> <FileConfiguration Name="Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="Debug Unicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="Release Unicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="Static-Debug|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="Static-Release|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="Static-Release Unicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> <FileConfiguration Name="Static-Debug Unicode|Win32"> <Tool Name="VCCLCompilerTool" UsePrecompiledHeader="1"/> </FileConfiguration> </File> <File RelativePath=".\text.cpp"> </File> <File RelativePath=".\vd.cpp"> </File> </Filter> <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc"> <File RelativePath="DSUtil.h"> </File> <File RelativePath="MediaTypes.h"> </File> <File RelativePath=".\NullRenderers.h"> </File> <File RelativePath="stdafx.h"> </File> <File RelativePath=".\text.h"> </File> <File RelativePath=".\vd.h"> </File> </Filter> <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> </Filter> </Files> <Globals> <Global Name="DevPartner_IsInstrumented" Value="0"/> </Globals> </VisualStudioProject> --- NEW FILE: a_yuv2rgb.asm --- ; VirtualDub - Video processing and capture application ; Copyright (C) 1998-2001 Avery Lee ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. .686 .mmx [...1871 lines suppressed...] pand mm7,MMX_rbmask ;[01 67] mm6: <B3><B2><B1><B0> por mm0,mm7 ;[01 67] mm0: P7P5P3P1 punpcklwd mm6,mm0 ;[01 6 ] mm4: P3P2P1P0 punpckhwd mm1,mm0 ;[ 1 6 ] mm5: P7P6P5P4 movntq [ebx+ebp*4-16],mm6 movntq [ebx+ebp*4- 8],mm1 jnz col_loop_ISSE16 pop ebp pop edi pop esi pop ebx ret end --- NEW FILE: DSUtil.h --- /* * Copyright (C) 2003-2004 Gabest * http://www.gabest.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This Program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GNU Make; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * http://www.gnu.org/copyleft/gpl.html * */ #pragma once #ifdef UNICODE #ifdef DEBUG #pragma comment(lib, "dsutilDU") #else #pragma comment(lib, "dsutilRU") #endif #else #ifdef DEBUG #pragma comment(lib, "dsutilD") #else #pragma comment(lib, "dsutilR") #endif #endif #include <afx.h> #include <afxwin.h> #include <afxtempl.h> #include "NullRenderers.h" //#include "MediaTypes.h" #include "vd.h" #include "text.h" extern void DumpStreamConfig(TCHAR* fn, IAMStreamConfig* pAMVSCCap); extern int CountPins(IBaseFilter* pBF, int& nIn, int& nOut, int& nInC, int& nOutC); extern bool IsSplitter(IBaseFilter* pBF, bool fCountConnectedOnly = false); extern bool IsMultiplexer(IBaseFilter* pBF, bool fCountConnectedOnly = false); extern bool IsStreamStart(IBaseFilter* pBF); extern bool IsStreamEnd(IBaseFilter* pBF); extern bool IsVideoRenderer(IBaseFilter* pBF); extern bool IsAudioWaveRenderer(IBaseFilter* pBF); extern IBaseFilter* GetUpStreamFilter(IBaseFilter* pBF, IPin* pInputPin = NULL); extern IPin* GetUpStreamPin(IBaseFilter* pBF, IPin* pInputPin = NULL); extern IPin* GetFirstPin(IBaseFilter* pBF, PIN_DIRECTION dir = PINDIR_INPUT); extern IPin* GetFirstDisconnectedPin(IBaseFilter* pBF, PIN_DIRECTION dir); extern int RenderFilterPins(IBaseFilter* pBF, IGraphBuilder* pGB, bool fAll = false); extern void NukeDownstream(IBaseFilter* pBF, IFilterGraph* pFG); extern void NukeDownstream(IPin* pPin, IFilterGraph* pFG); extern HRESULT AddFilterToGraph(IFilterGraph* pFG, IBaseFilter* pBF, WCHAR* pName); extern IBaseFilter* FindFilter(LPCWSTR clsid, IFilterGraph* pFG); extern IBaseFilter* FindFilter(const CLSID& clsid, IFilterGraph* pFG); extern CStringW GetFilterName(IBaseFilter* pBF); extern CStringW GetPinName(IPin* pPin); extern IFilterGraph* GetGraphFromFilter(IBaseFilter* pBF); extern IBaseFilter* GetFilterFromPin(IPin* pPin); extern IPin* AppendFilter(IPin* pPin, CString DisplayName, IGraphBuilder* pGB); extern IPin* InsertFilter(IPin* pPin, CString DisplayName, IGraphBuilder* pGB); extern void ShowPPage(CString DisplayName, HWND hParentWnd); extern void ShowPPage(IUnknown* pUnknown, HWND hParentWnd); extern CLSID GetCLSID(IBaseFilter* pBF); extern CLSID GetCLSID(IPin* pPin); extern bool IsCLSIDRegistered(LPCTSTR clsid); extern bool IsCLSIDRegistered(const CLSID& clsid); extern void StringToBin(CString s, CByteArray& data); extern CString BinToString(BYTE* ptr, int len); typedef enum {CDROM_NotFound, CDROM_Audio, CDROM_VideoCD, CDROM_DVDVideo, CDROM_Unknown} cdrom_t; extern cdrom_t GetCDROMType(TCHAR drive, CList<CString>& files); extern CString GetDriveLabel(TCHAR drive); extern bool GetKeyFrames(CString fn, CUIntArray& kfs); extern DVD_HMSF_TIMECODE RT2HMSF(REFERENCE_TIME rt, double fps = 0); extern REFERENCE_TIME HMSF2RT(DVD_HMSF_TIMECODE hmsf, double fps = 0); extern HRESULT AddToRot(IUnknown* pUnkGraph, DWORD* pdwRegister); extern void RemoveFromRot(DWORD& dwRegister); extern void memsetd(void* dst, unsigned int c, int nbytes); extern bool ExtractBIH(const AM_MEDIA_TYPE* pmt, BITMAPINFOHEADER* bih); extern bool ExtractBIH(IMediaSample* pMS, BITMAPINFOHEADER* bih); extern bool ExtractDim(const AM_MEDIA_TYPE* pmt, int& w, int& h, int& arx, int& ary); extern unsigned __int64 GetFileVersion(LPCTSTR fn); extern bool CreateFilter(CStringW DisplayName, IBaseFilter** ppBF, CStringW& FriendlyName); extern IBaseFilter* AppendFilter(IPin* pPin, IMoniker* pMoniker, IGraphBuilder* pGB); extern CStringW GetFriendlyName(CStringW DisplayName); extern HRESULT LoadExternalObject(LPCTSTR path, REFCLSID clsid, REFIID iid, void** ppv); extern HRESULT LoadExternalFilter(LPCTSTR path, REFCLSID clsid, IBaseFilter** ppBF); extern HRESULT LoadExternalPropertyPage(IPersist* pP, REFCLSID clsid, IPropertyPage** ppPP); extern void UnloadExternalObjects(); extern CString MakeFullPath(LPCTSTR path); extern CString GetMediaTypeName(const GUID& guid); extern GUID GUIDFromCString(CString str); extern CString CStringFromGUID(const GUID& guid); extern CStringW UTF8To16(LPCSTR utf8); extern CStringA UTF16To8(LPCWSTR utf16); extern CString ISO6391ToLanguage(LPCSTR code); extern CString ISO6392ToLanguage(LPCSTR code); extern CString ISO6391To6392(LPCSTR code); extern int MakeAACInitData(BYTE* pData, int profile, int freq, int channels); extern BOOL CFileGetStatus(LPCTSTR lpszFileName, CFileStatus& status); extern bool DeleteRegKey(LPCTSTR pszKey, LPCTSTR pszSubkey); extern bool SetRegKeyValue(LPCTSTR pszKey, LPCTSTR pszSubkey, LPCTSTR pszValueName, LPCTSTR pszValue); extern bool SetRegKeyValue(LPCTSTR pszKey, LPCTSTR pszSubkey, LPCTSTR pszValue); extern void RegisterSourceFilter(const CLSID& clsid, const GUID& subtype2, LPCTSTR chkbytes, LPCTSTR ext = NULL, ...); extern void RegisterSourceFilter(const CLSID& clsid, const GUID& subtype2, const CList<CString>& chkbytes, LPCTSTR ext = NULL, ...); extern void UnRegisterSourceFilter(const GUID& subtype); class CPinInfo : public PIN_INFO { public: CPinInfo() {pFilter = NULL;} ~CPinInfo() {if(pFilter) pFilter->Release();} }; class CFilterInfo : public FILTER_INFO { public: CFilterInfo() {pGraph = NULL;} ~CFilterInfo() {if(pGraph) pGraph->Release();} }; #define BeginEnumFilters(pFilterGraph, pEnumFilters, pBaseFilter) \ {CComPtr<IEnumFilters> pEnumFilters; \ if(pFilterGraph && SUCCEEDED(pFilterGraph->EnumFilters(&pEnumFilters))) \ { \ for(CComPtr<IBaseFilter> pBaseFilter; S_OK == pEnumFilters->Next(1, &pBaseFilter, 0); pBaseFilter = NULL) \ { \ #define EndEnumFilters }}} #define BeginEnumPins(pBaseFilter, pEnumPins, pPin) \ {CComPtr<IEnumPins> pEnumPins; \ if(pBaseFilter && SUCCEEDED(pBaseFilter->EnumPins(&pEnumPins))) \ { \ for(CComPtr<IPin> pPin; S_OK == pEnumPins->Next(1, &pPin, 0); pPin = NULL) \ { \ #define EndEnumPins }}} #define BeginEnumMediaTypes(pPin, pEnumMediaTypes, pMediaType) \ {CComPtr<IEnumMediaTypes> pEnumMediaTypes; \ if(pPin && SUCCEEDED(pPin->EnumMediaTypes(&pEnumMediaTypes))) \ { \ AM_MEDIA_TYPE* pMediaType = NULL; \ for(; S_OK == pEnumMediaTypes->Next(1, &pMediaType, NULL); DeleteMediaType(pMediaType), pMediaType = NULL) \ { \ #define EndEnumMediaTypes(pMediaType) } if(pMediaType) DeleteMediaType(pMediaType); }} #define BeginEnumSysDev(clsid, pMoniker) \ {CComPtr<ICreateDevEnum> pDevEnum4$##clsid; \ pDevEnum4$##clsid.CoCreateInstance(CLSID_SystemDeviceEnum); \ CComPtr<IEnumMoniker> pClassEnum4$##clsid; \ if(SUCCEEDED(pDevEnum4$##clsid->CreateClassEnumerator(clsid, &pClassEnum4$##clsid, 0)) \ && pClassEnum4$##clsid) \ { \ for(CComPtr<IMoniker> pMoniker; pClassEnum4$##clsid->Next(1, &pMoniker, 0) == S_OK; pMoniker = NULL) \ { \ #define EndEnumSysDev }}} #define QI(i) (riid == __uuidof(i)) ? GetInterface((i*)this, ppv) : #define QI2(i) (riid == IID_##i) ? GetInterface((i*)this, ppv) : template <typename T> __inline void INITDDSTRUCT(T& dd) { ZeroMemory(&dd, sizeof(dd)); dd.dwSize = sizeof(dd); } #define countof(array) (sizeof(array)/sizeof(array[0])) template <class T> static CUnknown* WINAPI CreateInstance(LPUNKNOWN lpunk, HRESULT* phr) { *phr = S_OK; CUnknown* punk = new T(lpunk, phr); if(punk == NULL) *phr = E_OUTOFMEMORY; return punk; } --- NEW FILE: text.cpp --- #include "stdafx.h" #include <afxtempl.h> /* CString Explode(CString str, CList<CString>& sl, TCHAR sep, int limit) { sl.RemoveAll(); if(limit == 1) {sl.AddTail(str); return _T("");} if(!str.IsEmpty() && str[str.GetLength()-1] != sep) str += sep; for(int i = 0, j = 0; (j = str.Find(sep, i)) >= 0; i = j+1) { CString tmp = str.Mid(i, j-i); tmp.TrimLeft(sep); tmp.TrimRight(sep); tmp.TrimLeft(); tmp.TrimRight(); sl.AddTail(tmp); if(limit > 0 && sl.GetCount() == limit-1) { if(j+1 < str.GetLength()) { CString tmp = str.Mid(j+1); tmp.TrimLeft(sep); tmp.TrimRight(sep); tmp.TrimLeft(); tmp.TrimRight(); sl.AddTail(tmp); } break; } } if(sl.IsEmpty()) { str.TrimLeft(sep); str.TrimRight(sep); str.TrimLeft(); str.TrimRight(); sl.AddTail(str); } return sl.GetHead(); } CString ExplodeMin(CString str, CList<CString>& sl, TCHAR sep, int limit) { Explode(str, sl, sep, limit); POSITION pos = sl.GetHeadPosition(); while(pos) { POSITION tmp = pos; if(sl.GetNext(pos).IsEmpty()) sl.RemoveAt(tmp); } if(sl.IsEmpty()) sl.AddTail(CString()); // eh return sl.GetHead(); } CString Implode(CList<CString>& sl, TCHAR sep) { CString ret; POSITION pos = sl.GetHeadPosition(); while(pos) { ret += sl.GetNext(pos); if(pos) ret += sep; } return(ret); } */ DWORD CharSetToCodePage(DWORD dwCharSet) { if(dwCharSet == CP_UTF8) return CP_UTF8; if(dwCharSet == CP_UTF7) return CP_UTF7; CHARSETINFO cs={0}; ::TranslateCharsetInfo((DWORD *)dwCharSet, &cs, TCI_SRCCHARSET); return cs.ciACP; } CStringA ConvertMBCS(CStringA str, DWORD SrcCharSet, DWORD DstCharSet) { WCHAR* utf16 = new WCHAR[str.GetLength()+1]; memset(utf16, 0, (str.GetLength()+1)*sizeof(WCHAR)); CHAR* mbcs = new CHAR[str.GetLength()*6+1]; memset(mbcs, 0, str.GetLength()*6+1); int len = MultiByteToWideChar( CharSetToCodePage(SrcCharSet), 0, str.GetBuffer(str.GetLength()), str.GetLength(), utf16, (str.GetLength()+1)*sizeof(WCHAR)); len = WideCharToMultiByte( CharSetToCodePage(DstCharSet), 0, utf16, len, mbcs, str.GetLength()*6, NULL, NULL); str = mbcs; delete [] utf16; delete [] mbcs; return str; } CStringA UrlEncode(CStringA str, bool fRaw) { CStringA urlstr; for(int i = 0; i < str.GetLength(); i++) { CHAR c = str[i]; if(fRaw && c == '+') urlstr += "%2B"; else if(c > 0x20 && c < 0x7f) urlstr += c; else if(c == 0x20) urlstr += fRaw ? ' ' : '+'; else {CStringA tmp; tmp.Format("%%%02x", (BYTE)c); urlstr += tmp;} } return urlstr; } CStringA UrlDecode(CStringA str, bool fRaw) { str.Replace("&", "&"); CHAR* s = str.GetBuffer(str.GetLength()); CHAR* e = s + str.GetLength(); CHAR* s1 = s; CHAR* s2 = s; while(s1 < e) { CHAR s11 = (s1 < e-1) ? (__isascii(s1[1]) && isupper(s1[1]) ? tolower(s1[1]) : s1[1]) : 0; CHAR s12 = (s1 < e-2) ? (__isascii(s1[2]) && isupper(s1[2]) ? tolower(s1[2]) : s1[2]) : 0; if(*s1 == '%' && s1 < e-2 && (s1[1] >= '0' && s1[1] <= '9' || s11 >= 'a' && s11 <= 'f') && (s1[2] >= '0' && s1[2] <= '9' || s12 >= 'a' && s12 <= 'f')) { s1[1] = s11; s1[2] = s12; *s2 = 0; if(s1[1] >= '0' && s1[1] <= '9') *s2 |= s1[1]-'0'; else if(s1[1] >= 'a' && s1[1] <= 'f') *s2 |= s1[1]-'a'+10; *s2 <<= 4; if(s1[2] >= '0' && s1[2] <= '9') *s2 |= s1[2]-'0'; else if(s1[2] >= 'a' && s1[2] <= 'f') *s2 |= s1[2]-'a'+10; s1 += 2; } else { *s2 = *s1 == '+' && !fRaw ? ' ' : *s1; } s1++; s2++; } str.ReleaseBuffer(s2 - s); return str; } CString ExtractTag(CString tag, CMapStringToString& attribs, bool& fClosing) { tag.Trim(); attribs.RemoveAll(); fClosing = !tag.IsEmpty() ? tag[0] == '/' : false; tag.TrimLeft('/'); int i = tag.Find(' '); if(i < 0) i = tag.GetLength(); CString type = tag.Left(i).MakeLower(); tag = tag.Mid(i).Trim(); while((i = tag.Find('=')) > 0) { CString attrib = tag.Left(i).Trim().MakeLower(); tag = tag.Mid(i+1); for(i = 0; i < tag.GetLength() && _istspace(tag[i]); i++); tag = i < tag.GetLength() ? tag.Mid(i) : _T(""); if(!tag.IsEmpty() && tag[0] == '\"') {tag = tag.Mid(1); i = tag.Find('\"');} else i = tag.Find(' '); if(i < 0) i = tag.GetLength(); CString param = tag.Left(i).Trim(); if(!param.IsEmpty()) attribs[attrib] = param; tag = i+1 < tag.GetLength() ? tag.Mid(i+1) : _T(""); } return(type); } CList<CString>& MakeLower(CList<CString>& sl) { POSITION pos = sl.GetHeadPosition(); while(pos) sl.GetNext(pos).MakeLower(); return sl; } CList<CString>& MakeUpper(CList<CString>& sl) { POSITION pos = sl.GetHeadPosition(); while(pos) sl.GetNext(pos).MakeUpper(); return sl; } CList<CString>& RemoveStrings(CList<CString>& sl, int minlen, int maxlen) { POSITION pos = sl.GetHeadPosition(); while(pos) { POSITION tmp = pos; CString& str = sl.GetNext(pos); int len = str.GetLength(); if(len < minlen || len > maxlen) sl.RemoveAt(tmp); } return sl; } --- NEW FILE: vd.h --- // VirtualDub - Video processing and capture application // Copyright (C) 1998-2001 Avery Lee // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // // Notes: // - BitBltFromI420ToRGB is from VirtualDub // - BitBltFromYUY2ToRGB is from AviSynth 2.52 // - The core assembly function of CCpuID is from DVD2AVI // (- vd.cpp/h should be renamed to something more sensible already :) #pragma once class CCpuID {public: CCpuID(); enum flag_t {mmx=1, ssemmx=2, ssefpu=4, sse2=8, _3dnow=16} m_flags;}; extern CCpuID g_cpuid; extern void memcpy_accel(void* dst, const void* src, size_t len); extern bool BitBltFromI420ToI420(int w, int h, BYTE* dsty, BYTE* dstu, BYTE* dstv, int dstpitch, BYTE* srcy, BYTE* srcu, BYTE* srcv, int srcpitch); extern bool BitBltFromI420ToYUY2(int w, int h, BYTE* dst, int dstpitch, BYTE* srcy, BYTE* srcu, BYTE* srcv, int srcpitch); extern bool BitBltFromI420ToRGB(int w, int h, BYTE* dst, int dstpitch, int dbpp, BYTE* srcy, BYTE* srcu, BYTE* srcv, int srcpitch); extern bool BitBltFromYUY2ToYUY2(int w, int h, BYTE* dst, int dstpitch, BYTE* src, int srcpitch); extern bool BitBltFromYUY2ToRGB(int w, int h, BYTE* dst, int dstpitch, int dbpp, BYTE* src, int srcpitch); extern bool BitBltFromRGBToRGB(int w, int h, BYTE* dst, int dstpitch, int dbpp, BYTE* src, int srcpitch, int sbpp); extern void DeinterlaceBlend(BYTE* dst, BYTE* src, DWORD rowbytes, DWORD h, DWORD pitch); extern void AvgLines8(BYTE* dst, DWORD h, DWORD pitch); extern void AvgLines555(BYTE* dst, DWORD h, DWORD pitch); extern void AvgLines565(BYTE* dst, DWORD h, DWORD pitch); --- NEW FILE: convert_a.asm --- ; Avisynth v2.5. Copyright 2002 Ben Rudiak-Gould et al. ; http://www.avisynth.org ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit ; http://www.gnu.org/copyleft/gpl.html . ; ; Linking Avisynth statically or dynamically with other modules is making a ; combined work based on Avisynth. Thus, the terms and conditions of the GNU ; General Public License cover the whole combination. ; ; As a special exception, the copyright holders of Avisynth give you ; permission to link Avisynth with independent modules that communicate with ; Avisynth solely through the interfaces defined in avisynth.h, regardless of the license ; terms of these independent modules, and to copy and distribute the ; resulting combined work under terms of your choice, provided that ; every copy of the combined work is accompanied by a complete copy of ; the source code of Avisynth (the version of Avisynth used to produce the ; combined work), being distributed under the terms of the GNU General ; Public License plus this exception. An independent module is a module ; which is not derived from or based on Avisynth, such as 3rd-party filters, ; import and export plugins, or graphical user interfaces. .586 .mmx .model flat ; alignment has to be 'page' so that I can use 'align 32' below _TEXT64 segment page public use32 'CODE' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; align 8 yuv2rgb_constants: x0000_0000_0010_0010 dq 00000000000100010h x0080_0080_0080_0080 dq 00080008000800080h x00FF_00FF_00FF_00FF dq 000FF00FF00FF00FFh x00002000_00002000 dq 00000200000002000h xFF000000_FF000000 dq 0FF000000FF000000h cy dq 000004A8500004A85h crv dq 03313000033130000h cgu_cgv dq 0E5FCF377E5FCF377h cbu dq 00000408D0000408Dh yuv2rgb_constants_rec709: dq 00000000000100010h dq 00080008000800080h dq 000FF00FF00FF00FFh dq 00000200000002000h dq 0FF000000FF000000h dq 000004A8500004A85h dq 03960000039600000h dq 0EEF5F930EEF5F930h dq 00000439B0000439Bh ofs_x0000_0000_0010_0010 = 0 ofs_x0080_0080_0080_0080 = 8 ofs_x00FF_00FF_00FF_00FF = 16 ofs_x00002000_00002000 = 24 ofs_xFF000000_FF000000 = 32 ofs_cy = 40 ofs_crv = 48 ofs_cgu_cgv = 56 ofs_cbu = 64 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GET_Y MACRO mma,uyvy IF &uyvy psrlw mma,8 ELSE pand mma,[edx+ofs_x00FF_00FF_00FF_00FF] ENDIF ENDM GET_UV MACRO mma,uyvy GET_Y mma,1-uyvy ENDM YUV2RGB_INNER_LOOP MACRO uyvy,rgb32,no_next_pixel ;; This YUV422->RGB conversion code uses only four MMX registers per ;; source dword, so I convert two dwords in parallel. Lines corresponding ;; to the "second pipe" are indented an extra space. There's almost no ;; overlap, except at the end and in the three lines marked ***. ;; revised 4july,2002 to properly set alpha in rgb32 to default "on" & other small memory optimizations movd mm0,[esi] movd mm5,[esi+4] movq mm1,mm0 GET_Y mm0,&uyvy ; mm0 = __________Y1__Y0 movq mm4,mm5 GET_UV mm1,&uyvy ; mm1 = __________V0__U0 GET_Y mm4,&uyvy movq mm2,mm5 ; *** avoid reload from [esi+4] GET_UV mm5,&uyvy psubw mm0,[edx+ofs_x0000_0000_0010_0010] movd mm6,[esi+8-4*(no_next_pixel)] GET_UV mm2,&uyvy ; mm2 = __________V2__U2 psubw mm4,[edx+ofs_x0000_0000_0010_0010] paddw mm2,mm1 GET_UV mm6,&uyvy psubw mm1,[edx+ofs_x0080_0080_0080_0080] paddw mm6,mm5 psllq mm2,32 psubw mm5,[edx+ofs_x0080_0080_0080_0080] punpcklwd mm0,mm2 ; mm0 = ______Y1______Y0 psllq mm6,32 pmaddwd mm0,[edx+ofs_cy] punpcklwd mm4,mm6 paddw mm1,mm1 pmaddwd mm4,[edx+ofs_cy] paddw mm5,mm5 paddw mm1,mm2 ; mm1 = __V1__U1__V0__U0 * 2 paddd mm0,[edx+ofs_x00002000_00002000] paddw mm5,mm6 movq mm2,mm1 paddd mm4,[edx+ofs_x00002000_00002000] movq mm3,mm1 movq mm6,mm5 pmaddwd mm1,[edx+ofs_crv] movq mm7,mm5 paddd mm1,mm0 pmaddwd mm5,[edx+ofs_crv] psrad mm1,14 ; mm1 = RRRRRRRRrrrrrrrr paddd mm5,mm4 pmaddwd mm2,[edx+ofs_cgu_cgv] psrad mm5,14 paddd mm2,mm0 pmaddwd mm6,[edx+ofs_cgu_cgv] psrad mm2,14 ; mm2 = GGGGGGGGgggggggg paddd mm6,mm4 pmaddwd mm3,[edx+ofs_cbu] psrad mm6,14 paddd mm3,mm0 pmaddwd mm7,[edx+ofs_cbu] add esi,8 add edi,12+4*rgb32 IFE &no_next_pixel cmp esi,ecx ENDIF psrad mm3,14 ; mm3 = BBBBBBBBbbbbbbbb paddd mm7,mm4 pxor mm0,mm0 psrad mm7,14 packssdw mm3,mm2 ; mm3 = GGGGggggBBBBbbbb packssdw mm7,mm6 packssdw mm1,mm0 ; mm1 = ________RRRRrrrr packssdw mm5,mm0 ; *** avoid pxor mm4,mm4 movq mm2,mm3 movq mm6,mm7 punpcklwd mm2,mm1 ; mm2 = RRRRBBBBrrrrbbbb punpcklwd mm6,mm5 punpckhwd mm3,mm1 ; mm3 = ____GGGG____gggg punpckhwd mm7,mm5 movq mm0,mm2 movq mm4,mm6 punpcklwd mm0,mm3 ; mm0 = ____rrrrggggbbbb punpcklwd mm4,mm7 IFE &rgb32 psllq mm0,16 psllq mm4,16 ENDIF punpckhwd mm2,mm3 ; mm2 = ... [truncated message content] |