Skip to content

Commit e24e5cc

Browse files
committed
Import C Code
1 parent c6d99b8 commit e24e5cc

31 files changed

Lines changed: 4815 additions & 0 deletions

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build
2+
*.o
3+
.vs
4+
.vscode
5+

CMakeLists.txt

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
cmake_minimum_required (VERSION 3.15)
2+
project (neo_vague_denoiser CXX)
3+
file(GLOB CODE "src/*.cpp")
4+
file(GLOB SSE_CODE_IMPL "src/*SSE.cpp")
5+
file(GLOB AVX_CODE_IMPL "src/*AVX.cpp")
6+
add_library(neo-vague-denoiser SHARED main.cpp src/version.rc ${CODE} ${CODE_IMPL})
7+
set_property(TARGET neo-vague-denoiser PROPERTY CXX_STANDARD 17)
8+
add_compile_definitions(VS_TARGET_CPU_X86)
9+
10+
find_package(Git REQUIRED)
11+
execute_process(COMMAND ${GIT_EXECUTABLE} describe --first-parent --tags --always OUTPUT_VARIABLE GIT_REPO_VERSION)
12+
string(REGEX REPLACE "(r[0-9]+).*" "\\1" VERSION ${GIT_REPO_VERSION})
13+
14+
configure_file (
15+
"${PROJECT_SOURCE_DIR}/src/version.hpp.in"
16+
"${PROJECT_SOURCE_DIR}/src/version.hpp"
17+
)
18+
configure_file (
19+
"${PROJECT_SOURCE_DIR}/src/version.rc.in"
20+
"${PROJECT_SOURCE_DIR}/src/version.rc"
21+
)
22+
23+
find_package(PkgConfig REQUIRED)
24+
25+
pkg_check_modules(AVISYNTH avisynth)
26+
if(AVISYNTH_FOUND)
27+
include_directories(${AVISYNTH_INCLUDE_DIRS})
28+
else()
29+
include_directories(include/avisynth)
30+
endif()
31+
32+
pkg_check_modules(VAPOURSYNTH vapoursynth)
33+
if(VAPOURSYNTH_FOUND)
34+
include_directories(${VAPOURSYNTH_INCLUDE_DIRS})
35+
else()
36+
include_directories(include/vapoursynth)
37+
endif()
38+
39+
include_directories(.)
40+
include_directories(include/dualsynth)
41+
42+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
43+
set_source_files_properties(${SSE_CODE_IMPL} PROPERTIES COMPILE_FLAGS "/arch:SSE")
44+
set_source_files_properties(${AVX_CODE_IMPL} PROPERTIES COMPILE_FLAGS "/arch:AVX")
45+
46+
if (CMAKE_GENERATOR_TOOLSET MATCHES "v[0-9]*_xp")
47+
target_compile_definitions(neo-vague-denoiser PRIVATE WINVER=0x502 _WIN32_WINNT=0x502)
48+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:threadSafeInit-")
49+
endif()
50+
51+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
52+
set_source_files_properties(${SSE_CODE_IMPL} PROPERTIES COMPILE_FLAGS "/arch:SSE")
53+
set_source_files_properties(${AVX_CODE_IMPL} PROPERTIES COMPILE_FLAGS "/arch:AVX")
54+
target_link_libraries(neo-vague-denoiser libmmds)
55+
56+
else()
57+
set_source_files_properties(${SSE_CODE_IMPL} PROPERTIES COMPILE_FLAGS "-msse")
58+
set_source_files_properties(${AVX_CODE_IMPL} PROPERTIES COMPILE_FLAGS "-mfma -mavx")
59+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
60+
target_link_libraries(neo-vague-denoiser tbb)
61+
endif()
62+
63+
endif()
64+
65+
add_custom_command(
66+
TARGET neo-vague-denoiser POST_BUILD
67+
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:neo-vague-denoiser> "../Release_${VERSION}/${_DIR}/$<TARGET_FILE_NAME:neo-vague-denoiser>"
68+
)

LICENSE

Lines changed: 339 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Neo Vague Denoiser (forked from VapourSynth-VagueDenoiser)
2+
3+
Neo Vague Denoiser Copyright(C) 2020 Xinyue Lu, and previous developers
4+
5+
Vague Denoiser is a wavelet based denoiser.
6+
7+
Basically, it transforms each frame from the video input into the wavelet domain, using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to the obtained coefficients. It does an inverse wavelet transform after. Due to wavelet properties, it should give a nice smoothed result, and reduced noise, without blurring picture features.
8+
9+
It was originally written by Lefungus, and later modified by Kurosu and Fizick for further improvement. VapourSynth-VagueDenoiser was ported to VapourSynth interface and refactored by HolyWu. Kudos to them for creating and improving this fantastic tool.
10+
11+
This project backports VapourSynth-VagueDenoiser to AviSynth+. Parameter names follow VapourSynth-VagueDenoiser.
12+
13+
## Usage
14+
15+
```python
16+
# AviSynth+
17+
LoadPlugin("neo-vague-denoiser.dll")
18+
neo_vd(clip, threshold=2.0, nsteps=6, y=3, u=3, v=3, ...)
19+
# VapourSynth
20+
core.neo_vd.VagueDenoiser(clip, threshold=2.0, nsteps=6, planes=[0,1,2], ...)
21+
```
22+
23+
Parameters:
24+
25+
[Check original VapourSynth-VagueDenoiser usage documents.](https://github.com/HomeOfVapourSynthEvolution/VapourSynth-VagueDenoiser/blob/master/README.md)
26+
27+
- *y*, *u*, *v* (AviSynth+ only)
28+
29+
Whether a plane is to be filtered.
30+
31+
1 - Do not touch, leaving garbage data
32+
2 - Copy from origin
33+
3 - Process
34+
35+
Default: 3.
36+
37+
## License
38+
39+
* GPLv2.

0 commit comments

Comments
 (0)