Skip to content

Commit

Permalink
edit readme and cosmetics.
Browse files Browse the repository at this point in the history
  • Loading branch information
chikuzen committed Aug 28, 2016
1 parent 5729170 commit 6d0395a
Show file tree
Hide file tree
Showing 7 changed files with 224 additions and 52 deletions.
78 changes: 73 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,76 @@
# MPEG2DecPlus
これはDGDecode.dllをAvisynth+用に改造するプロジェクトです。

やりたいこと:
- 改築を重ねた温泉旅館のようなコードをきれいにする。
- VFAPI用コード、YUY2用コード等、現在では必要ないコードの排除。
- アセンブラの排除による64bitへの対応、及びSSE2/AVX2でのintrinsicによる最適化。
###やりたいこと:
- 改築を重ねた温泉旅館のようなコードをきれいにする。
- VFAPI用コード、YUY2用コード等、現在では必要ないコードの排除。
- アセンブラの排除による64bitへの対応、及びSSE2/AVX2でのintrinsicによる最適化。等

###必要なもの:
- Windows Vista SP2 以降の Windows OS
- SSE3が使えるCPU(Intel Pentium4(prescott) または AMD Athlon64x2 以降)
- Avisynth+ r2172以降
- Microsoft VisualC++ Redistributable Package 2015.

###使い方:
```
MPEG2Source(string "d2v", int "cpu", int "idct", bool "iPP", int "moderate_h", int "moderate_v",
bool "showQ", bool "fastMC", string "cpu2", int "info", int "upConv", bool "i420", bool "iCC")
```
d2v: dv2ファイルのパス

cpu: 現在使用不可。設定しても何も起こらない。iPP, moderate_h, moderate_v, fastMC, cpu2も同様。

idct: 1,2,3,4,6,7 はすべてSSE2MMX(AP922互換)、5はIEEE 1180 reference(単精度小数点)。

showQ: マクロブロックの量子化器を表示する。

info: デバッグ情報を出力する。
0: 表示しない。(デフォルト)
1: 動画フレームにオーバーレイで表示。
2: OutputDebugString()で出力。(内容はDebugView.exeで確認)
3: hintsをフレーム左上隅の64バイトに埋め込む。

upConv: フレームを出力するフォーマット。
0: YUV420なソースはYV12で出力、YUV422なソースはYV16で出力。
1: YV16で出力。
2: YV24で出力。

i420: trueであればYUV420をi420として出力する。現在ではどちらでもほぼ変わりはない。

iCC: upConvにおけるYUV420の取扱いの設定。
未設定: フレームフラグに従ってinterlaced/progressiveを切り替える。
true: 全フレームをinterlacedとして処理する。
false: 全フレームをprogressiveとして処理する。

```
Deblock(clip c, int "quant", int "aOffset", int "bOffset")
```
H.264式でブロックフィルタ。manao氏のフィルタを取り込んだもの。

clip: Y8, YV12, YV16, YV411, YV24をサポート。

quant: 0~51(デフォルト25)
デブロックの強さ。

aOffset: 0 ~ 51-quant(デフォルト0)
ブロック検出の閾値。高いほどブロックと判定されやすくなる。

bOffset: 0 ~ 51-quant(デフォルト0)
デブロックの強さ及び検出率の補正値。
高いほどデブロックが強くかかり、ブロックと判定されやすくなる。

```
LumaYUV(clip c, int "lumoff", int "lumgain")
```
入力クリップの輝度をlumoffとlumgainの値によって変更する。出力Y = (入力y * lumgain) + lumoff

clip: Y8, YV12, YV16, YV411, YV24をサポート。

lumoff: -255 ~ 255 (デフォルト0)

lumgain: 0.0 ~ 2.0 (デフォルト1.0)




14 changes: 7 additions & 7 deletions build/msvcX/DGDecode/DGDecode.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="DGDecode">
<Filter Include="MPEG2DecPlus">
<UniqueIdentifier>{b92ffe8f-65a1-47d7-b2eb-8eafdef68fd7}</UniqueIdentifier>
</Filter>
</ItemGroup>
Expand All @@ -40,16 +40,16 @@
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\dgdecode\AVISynthAPI.cpp">
<Filter>DGDecode</Filter>
<Filter>MPEG2DecPlus</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\dgdecode\deblock.cpp">
<Filter>DGDecode</Filter>
<Filter>MPEG2DecPlus</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\dgdecode\color_convert.cpp">
<Filter>DGDecode</Filter>
<Filter>MPEG2DecPlus</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\dgdecode\LumaYUV.cpp">
<Filter>DGDecode</Filter>
<Filter>MPEG2DecPlus</Filter>
</ClCompile>
<ClCompile Include="..\..\..\src\dgdecode\mc.cpp">
<Filter>Source Files</Filter>
Expand All @@ -72,10 +72,10 @@
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\dgdecode\AvisynthAPI.h">
<Filter>DGDecode</Filter>
<Filter>MPEG2DecPlus</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\dgdecode\color_convert.h">
<Filter>DGDecode</Filter>
<Filter>MPEG2DecPlus</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\dgdecode\mc.h">
<Filter>Header Files</Filter>
Expand Down
90 changes: 90 additions & 0 deletions build/msvcX/DGIndex/DGIndex.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7BED3DC2-9B7C-446A-997F-9AD4560B1709}</ProjectGuid>
Expand All @@ -22,32 +30,55 @@
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)..\..\bin\msvc$(VisualStudioVersion)\$(Configuration)\</OutDir>
<IntDir>$(Configuration)\msvc$(VisualStudioVersion)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)..\..\bin\msvc$(VisualStudioVersion)\$(Configuration)\</OutDir>
<IntDir>$(Configuration)\msvc$(VisualStudioVersion)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
Expand All @@ -64,6 +95,22 @@
<StackReserveSize>4096000</StackReserveSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\src\dgindex</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>shlwapi.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<StackReserveSize>4096000</StackReserveSize>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
Expand All @@ -85,6 +132,27 @@
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\src\dgindex</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>shlwapi.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<StackReserveSize>4096000</StackReserveSize>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\src\dgindex\d2vparse.cpp" />
<ClCompile Include="..\..\..\src\dgindex\getbit.cpp" />
Expand Down Expand Up @@ -133,31 +201,53 @@
<None Include="..\..\..\src\dgindex\movie.ico" />
<CustomBuild Include="..\..\..\src\dgindex\idctmmx.asm">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ml /c /coff /Cx /nologo /Fo $(IntDir)%(Filename).obj %(FullPath)
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ml /c /coff /Cx /nologo /Fo $(IntDir)%(Filename).obj %(FullPath)
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename).obj;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename).obj;%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ml /c /coff /Cx /nologo /Fo $(IntDir)%(Filename).obj %(FullPath)
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ml /c /coff /Cx /nologo /Fo $(IntDir)%(Filename).obj %(FullPath)
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename).obj;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename).obj;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\..\..\src\dgindex\simple_idct_mmx.asm">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nasm -f win32 -DPREFIX -DWIN32 -o $(IntDir)%(Filename).obj %(FullPath)
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">nasm -f win32 -DPREFIX -DWIN32 -o $(IntDir)%(Filename).obj %(FullPath)
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename).obj;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename).obj;%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nasm -f win32 -DPREFIX -DWIN32 -o $(IntDir)%(Filename).obj %(FullPath)
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">nasm -f win32 -DPREFIX -DWIN32 -o $(IntDir)%(Filename).obj %(FullPath)
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename).obj;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename).obj;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\..\..\src\dgindex\skl_dct_sse.asm">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%40copy /Y ..\..\..\src\dgdecode\skl_nasm.h .\ &gt;NUL
nasm -f win32 -DPREFIX -DWIN32 -o $(IntDir)%(Filename).obj %(FullPath)
%40del /Q .\*.h
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%40copy /Y ..\..\..\src\dgdecode\skl_nasm.h .\ &gt;NUL
nasm -f win32 -DPREFIX -DWIN32 -o $(IntDir)%(Filename).obj %(FullPath)
%40del /Q .\*.h
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)%(Filename).obj;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)%(Filename).obj;%(Outputs)</Outputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%40copy /Y ..\..\..\src\dgdecode\skl_nasm.h .\ &gt;NUL
nasm -f win32 -DPREFIX -DWIN32 -o $(IntDir)%(Filename).obj %(FullPath)
%40del /Q .\*.h
</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%40copy /Y ..\..\..\src\dgdecode\skl_nasm.h .\ &gt;NUL
nasm -f win32 -DPREFIX -DWIN32 -o $(IntDir)%(Filename).obj %(FullPath)
%40del /Q .\*.h
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)%(Filename).obj;%(Outputs)</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)%(Filename).obj;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
12 changes: 11 additions & 1 deletion build/msvcX/DGMPGDec.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,32 @@ VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DGIndex", "DGIndex\DGIndex.vcxproj", "{7BED3DC2-9B7C-446A-997F-9AD4560B1709}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DGDecode", "DGDecode\DGDecode.vcxproj", "{13BF3FBA-7CD9-4374-83D5-E001E722E3DE}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MPEG2DecPlus", "DGDecode\DGDecode.vcxproj", "{13BF3FBA-7CD9-4374-83D5-E001E722E3DE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7BED3DC2-9B7C-446A-997F-9AD4560B1709}.Debug|Win32.ActiveCfg = Debug|Win32
{7BED3DC2-9B7C-446A-997F-9AD4560B1709}.Debug|Win32.Build.0 = Debug|Win32
{7BED3DC2-9B7C-446A-997F-9AD4560B1709}.Debug|x64.ActiveCfg = Debug|x64
{7BED3DC2-9B7C-446A-997F-9AD4560B1709}.Debug|x64.Build.0 = Debug|x64
{7BED3DC2-9B7C-446A-997F-9AD4560B1709}.Release|Win32.ActiveCfg = Release|Win32
{7BED3DC2-9B7C-446A-997F-9AD4560B1709}.Release|Win32.Build.0 = Release|Win32
{7BED3DC2-9B7C-446A-997F-9AD4560B1709}.Release|x64.ActiveCfg = Release|x64
{7BED3DC2-9B7C-446A-997F-9AD4560B1709}.Release|x64.Build.0 = Release|x64
{13BF3FBA-7CD9-4374-83D5-E001E722E3DE}.Debug|Win32.ActiveCfg = Debug|Win32
{13BF3FBA-7CD9-4374-83D5-E001E722E3DE}.Debug|Win32.Build.0 = Debug|Win32
{13BF3FBA-7CD9-4374-83D5-E001E722E3DE}.Debug|x64.ActiveCfg = Debug|x64
{13BF3FBA-7CD9-4374-83D5-E001E722E3DE}.Debug|x64.Build.0 = Debug|x64
{13BF3FBA-7CD9-4374-83D5-E001E722E3DE}.Release|Win32.ActiveCfg = Release|Win32
{13BF3FBA-7CD9-4374-83D5-E001E722E3DE}.Release|Win32.Build.0 = Release|Win32
{13BF3FBA-7CD9-4374-83D5-E001E722E3DE}.Release|x64.ActiveCfg = Release|x64
{13BF3FBA-7CD9-4374-83D5-E001E722E3DE}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading

0 comments on commit 6d0395a

Please sign in to comment.