BM3D denoising filter for VapourSynth, implemented in AVX2
Project description
VapourSynth-BM3DCPU
This package contains the CPU implementation of the VapourSynth-BM3DCUDA filter.
Installation
Install the multi-target wheel that includes binaries for multiple architectures (AVX2 and Zen4)
pip install vapoursynth-bm3dcpu
To compile and install the package with optimizations tailored to your specific CPU:
-
Windows within the developer shell:
pip install vapoursynth-bm3dcpu --no-binary vapoursynth-bm3dcpu
-
Linux:
pip install vapoursynth-bm3dcpu --no-binary vapoursynth-bm3dcpu
Building from source
Requirements
- C++ Compiler: C++17 compatible.
- Windows: Clang or MSVC (Visual Studio 2019+).
- Linux: GCC.
uv build --package vapoursynth-bm3dcpu
Detailed parameter information from the parent project follows.
VapourSynth-BM3DCUDA
Copyright© 2021 WolframRhodium
BM3D denoising filter for VapourSynth, implemented in CUDA.
Description
-
Please check VapourSynth-BM3D.
-
The
_rtcversion compiles GPU code at runtime, which might runs faster than standard version at the cost of a slight overhead. -
The
cpuversion is implemented in AVX and AVX2 intrinsics, serves as a reference implementation on CPU. However, bitwise identical outputs are not guaranteed across CPU and CUDA implementations.
Requirements
-
CPU with AVX support.
-
CUDA-enabled GPU(s) of compute capability 5.0 or higher (Maxwell+).
-
GPU driver 450 or newer.
The minimum requirement on compute capability is 3.5, which requires manual compilation (specifying nvcc flag -gencode arch=compute_35,code=sm_35).
The cpu version does not require any external libraries but requires AVX2 support on CPU in addition.
Parameters
{bm3dcuda, bm3dcuda_rtc, bm3dcpu}.BM3D(clip clip[, clip ref=None, float[] sigma=3.0, int[] block_step=8, int[] bm_range=9, int radius=0, int[] ps_num=2, int[] ps_range=4, bint chroma=False, int device_id=0, bool fast=True, int extractor_exp=0])
-
clip:
The input clip. Must be of 32 bit float format. Each plane is denoised separately if
chromais set toFalse. Data of unprocessed planes is undefined. Frame properties of the output clip are copied from it. -
ref:
The reference clip. Must be of the same format, width, height, number of frames as
clip.Used in block-matching and as the reference in empirical Wiener filtering, i.e.
bm3d.Final/bm3d.VFinal:basic = core.{bm3dcpu, bm3dcuda, bm3dcuda_rtc}.BM3D(src, radius=0) final = core.{bm3d...}.BM3D(src, ref=basic, radius=0) vbasic = core.{bm3d...}.BM3D(src, radius=radius_nonzero).bm3d.VAggregate(radius=radius_nonzero) vfinal = core.{bm3d...}.BM3D(src, ref=vbasic, radius=r).bm3d.VAggregate(radius=r) # alternatively, using the v2 interface basic_or_vbasic = core.{bm3dcpu, bm3dcuda, bm3dcuda_rtc}.BM3Dv2(src, radius=r) final_or_vfinal = core.{bm3d...}.BM3Dv2(src, ref=basic_or_vbasic, radius=r)
corresponds to the followings (ignoring color space handling and other differences in implementation), respectively
basic = core.bm3d.Basic(clip) final = core.bm3d.Final(basic, ref=basic) vbasic = core.bm3d.VBasic(src, radius=r).bm3d.VAggregate(radius=r, sample=1) vfinal = core.bm3d.VFinal(src, ref=vbasic, radius=r).bm3d.VAggregate(radius=r)
-
sigma: The strength of denoising for each plane.
The strength is similar (but not strictly equal) as
VapourSynth-BM3Ddue to differences in implementation. (coefficient normalization is not implemented, for example)Default
[3,3,3]. -
block_step, bm_range, radius, ps_num, ps_range:
Same as those in
VapourSynth-BM3D.If
chromais set toTrue, only the first value is in effect.Otherwise an array of values may be specified for each plane (except
radius).Note: It is generally not recommended to take a large value of
ps_numas current implementations do not take duplicate block-matching candidates into account during temporary searching, which may leads to regression in denoising quality. This issue is not present inVapourSynth-BM3D.Note2: Lowering the value of "block_step" will be useful in reducing blocking artifacts at the cost of slower processing.
-
chroma:
CBM3D algorithm.
clipmust be ofYUV444PSformat.Y channel is used in block-matching of chroma channels.
Default
False. -
device_id:
Set GPU to be used.
Default
0. -
fast:
Multi-threaded copy between CPU and GPU at the expense of 4x memory consumption.
Default
True. -
extractor_exp:
Used for deterministic (bitwise) output. This parameter is not present in the
cpuversion since the implementation always produces deterministic output.Pre-rounding is employed for associative floating-point summation.
The value should be a positive integer not less than 3, and may need to be higher depending on the source video and filter parameters.
Default
0. (non-determinism)
Notes
-
bm3d.VAggregateshould be called after temporal filtering, as inVapourSynth-BM3D. Alternatively, you may use theBM3Dv2()interface for both spatial and temporal denoising in one step. -
The
_rtcversion has three additional experimental parameters:-
bm_error_s: (string)
Specify cost for block similarity measurement.
Currently implemented costs:
SSD(Sum of Squared Differences),SAD(Sum of Absolute Differences),ZSSD(Zero-mean SSD),ZSAD(Zero-mean SAD),SSD/NORM.Default
SSD. -
transform_2d_s/transform_1d_s: (string)
Specify type of transform.
Currently implemented transforms:
DCT(Discrete Cosine Transform),Haar(Haar Transform),WHT(Walsh–Hadamard Transform),Bior1.5(transform based on a bi-orthogonal spline wavelet).Default
DCT.
These features are not implemented in the standard version due to performance and binary size concerns.
-
Statistics
GPU memory consumptions:
(ref ? 4 : 3) * (chroma ? 3 : 1) * (fast ? 4 : 1) * (2 * radius + 1) * size_of_a_single_frame
Compilation
- The CMake configuration of
BM3DCUDA_RTClinks to NVRTC static library by default, which requires CUDA 11.5 or later.
cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D CMAKE_CUDA_FLAGS="--threads 0 --use_fast_math -Wno-deprecated-gpu-targets" -D CMAKE_CUDA_ARCHITECTURES="50;61-real;75-real;86"
cmake --build build --config Release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vapoursynth_bm3dcpu-2.16.1.tar.gz.
File metadata
- Download URL: vapoursynth_bm3dcpu-2.16.1.tar.gz
- Upload date:
- Size: 625.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86a8ad85151237c7c1ee3e917ca35a714d4bf900316506ebdfe31122a111d18d
|
|
| MD5 |
73f92275028965dba6acc7f3d611b5b2
|
|
| BLAKE2b-256 |
87060764442238f1debe19d1bf4ae0c25e9e70962b4e9325a8327c1557b1c658
|
Provenance
The following attestation bundles were made for vapoursynth_bm3dcpu-2.16.1.tar.gz:
Publisher:
publish.yml on Jaded-Encoding-Thaumaturgy/vs-wheels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_bm3dcpu-2.16.1.tar.gz -
Subject digest:
86a8ad85151237c7c1ee3e917ca35a714d4bf900316506ebdfe31122a111d18d - Sigstore transparency entry: 1412662222
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vs-wheels@e98388d1043719b72894e39551c8732ec0ab4650 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e98388d1043719b72894e39551c8732ec0ab4650 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file vapoursynth_bm3dcpu-2.16.1-py3-none-win_amd64.whl.
File metadata
- Download URL: vapoursynth_bm3dcpu-2.16.1-py3-none-win_amd64.whl
- Upload date:
- Size: 117.1 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f9667e5c66216b05b7be545fff76d1cfcc81450838c7abb2ff04ebefe352d1b
|
|
| MD5 |
3cbce9818aa39a5378bbbfbd234a69f5
|
|
| BLAKE2b-256 |
7493757046f64e28acadc7472fabf392d0e9bfc7d5555eb5dbc78434ea9ef240
|
Provenance
The following attestation bundles were made for vapoursynth_bm3dcpu-2.16.1-py3-none-win_amd64.whl:
Publisher:
publish.yml on Jaded-Encoding-Thaumaturgy/vs-wheels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_bm3dcpu-2.16.1-py3-none-win_amd64.whl -
Subject digest:
5f9667e5c66216b05b7be545fff76d1cfcc81450838c7abb2ff04ebefe352d1b - Sigstore transparency entry: 1412662502
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vs-wheels@e98388d1043719b72894e39551c8732ec0ab4650 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e98388d1043719b72894e39551c8732ec0ab4650 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file vapoursynth_bm3dcpu-2.16.1-py3-none-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: vapoursynth_bm3dcpu-2.16.1-py3-none-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03ef767c1f320098f53a79d5a22d6edbd2cb9e08f0153dd9582d600e8d7595ce
|
|
| MD5 |
f6c30ff58908d1fcfb0c7a88a3e77cc8
|
|
| BLAKE2b-256 |
a1d0a27789969079b91ac865619a9bc0744b5284c3690d55827b0ac89a3d1ce0
|
Provenance
The following attestation bundles were made for vapoursynth_bm3dcpu-2.16.1-py3-none-musllinux_1_2_x86_64.whl:
Publisher:
publish.yml on Jaded-Encoding-Thaumaturgy/vs-wheels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_bm3dcpu-2.16.1-py3-none-musllinux_1_2_x86_64.whl -
Subject digest:
03ef767c1f320098f53a79d5a22d6edbd2cb9e08f0153dd9582d600e8d7595ce - Sigstore transparency entry: 1412662311
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vs-wheels@e98388d1043719b72894e39551c8732ec0ab4650 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e98388d1043719b72894e39551c8732ec0ab4650 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file vapoursynth_bm3dcpu-2.16.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: vapoursynth_bm3dcpu-2.16.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 70.2 kB
- Tags: Python 3, manylinux: glibc 2.24+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e7453c92b4f3b10c9812199722ce15f045302ef5833836ce8e0411fee005015
|
|
| MD5 |
29d06b82eee4bddccf85f882919fe2fe
|
|
| BLAKE2b-256 |
759229b6bb975aa53c40797e1add8044d9ca466d5b7aa31ec6e054c58d3c5adc
|
Provenance
The following attestation bundles were made for vapoursynth_bm3dcpu-2.16.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on Jaded-Encoding-Thaumaturgy/vs-wheels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vapoursynth_bm3dcpu-2.16.1-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
4e7453c92b4f3b10c9812199722ce15f045302ef5833836ce8e0411fee005015 - Sigstore transparency entry: 1412662393
- Sigstore integration time:
-
Permalink:
Jaded-Encoding-Thaumaturgy/vs-wheels@e98388d1043719b72894e39551c8732ec0ab4650 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/Jaded-Encoding-Thaumaturgy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e98388d1043719b72894e39551c8732ec0ab4650 -
Trigger Event:
workflow_dispatch
-
Statement type: