Skip to content

Commit

Permalink
Overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
HolyWu committed Jul 4, 2020
1 parent 8d85dd8 commit b228588
Show file tree
Hide file tree
Showing 40 changed files with 42,052 additions and 23,714 deletions.
1,334 changes: 624 additions & 710 deletions DFTTest/DFTTest.cpp

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions DFTTest/DFTTest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#pragma once

#include <memory>
#include <thread>
#include <type_traits>
#include <unordered_map>

#include <VapourSynth.h>
#include <VSHelper.h>

#include <fftw3.h>

using unique_float = std::unique_ptr<float[], decltype(&vs_aligned_free)>;
using unique_fftwf_complex = std::unique_ptr<fftwf_complex[], decltype(&vs_aligned_free)>;
using unique_VSFrameRef = std::unique_ptr<VSFrameRef, decltype(VSAPI::freeFrame)>;

struct DFTTestData final {
VSNodeRef * node;
const VSVideoInfo * vi;
int sbsize, sosize, tbsize, tosize, swin, twin;
double sbeta, tbeta;
float f0beta;
bool zmean, process[3];
float srcScale, dstScale;
int barea, bvolume, ccnt, ccnt2, type, sbd1, inc, peak;
bool uf0b;
const VSFormat * padFormat;
int padWidth[3], padHeight[3], eheight[3];
unique_float hw{ nullptr, nullptr }, sigmas{ nullptr, nullptr }, sigmas2{ nullptr, nullptr }, pmins{ nullptr, nullptr }, pmaxs{ nullptr, nullptr };
unique_fftwf_complex dftgc{ nullptr, nullptr };
std::unique_ptr<fftwf_plan_s, decltype(&fftwf_destroy_plan)> ft{ nullptr, nullptr }, fti{ nullptr, nullptr };
std::unordered_map<std::thread::id, unique_VSFrameRef> ebuff;
std::unordered_map<std::thread::id, unique_float> dftr;
std::unordered_map<std::thread::id, unique_fftwf_complex> dftc, dftc2;
void (*copyPad)(const VSFrameRef * src, VSFrameRef * dst[3], const DFTTestData * const VS_RESTRICT d, const VSAPI * vsapi) noexcept;
void (*filterCoeffs)(float * dftc, const float * sigmas, const int ccnt, const float * pmin, const float * pmax, const float * sigmas2) noexcept;
void (*func_0)(VSFrameRef * src[3], VSFrameRef * dst, const DFTTestData * const VS_RESTRICT d, const VSAPI * vsapi) noexcept;
void (*func_1)(VSFrameRef * src[15][3], VSFrameRef * dst, const int pos, const DFTTestData * const VS_RESTRICT d, const VSAPI * vsapi) noexcept;
};
32 changes: 0 additions & 32 deletions DFTTest/DFTTest.hpp

This file was deleted.

15 changes: 9 additions & 6 deletions DFTTest/DFTTest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<UseNativeEnvironment>true</UseNativeEnvironment>
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{23B9F54B-763D-491C-A201-657918CD1377}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
Expand All @@ -32,16 +31,17 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<IncludePath>C:\Program Files\VapourSynth\sdk\include\vapoursynth;C:\fftw-3.3.8-dll64;$(IncludePath)</IncludePath>
<LibraryPath>C:\fftw-3.3.8-dll64;$(LibraryPath)</LibraryPath>
<IncludePath>C:\Program Files\VapourSynth\sdk\include\vapoursynth;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>VS_TARGET_CPU_X86;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>DFTTEST_X86;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FloatingPointExceptions>false</FloatingPointExceptions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand All @@ -55,11 +55,14 @@
<ClCompile Include="DFTTest_AVX2.cpp">
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
</ClCompile>
<ClCompile Include="DFTTest_AVX512.cpp">
<EnableEnhancedInstructionSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AdvancedVectorExtensions512</EnableEnhancedInstructionSet>
</ClCompile>
<ClCompile Include="DFTTest_SSE2.cpp" />
<ClCompile Include="vectorclass\instrset_detect.cpp" />
<ClCompile Include="VCL2\instrset_detect.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="DFTTest.hpp" />
<ClInclude Include="DFTTest.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
7 changes: 5 additions & 2 deletions DFTTest/DFTTest.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@
<ClCompile Include="DFTTest_AVX2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="vectorclass\instrset_detect.cpp">
<ClCompile Include="DFTTest_AVX512.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="VCL2\instrset_detect.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="DFTTest.hpp">
<ClInclude Include="DFTTest.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
Expand Down
Loading

0 comments on commit b228588

Please sign in to comment.