FFT3DFilter
Abstract | |
---|---|
Author | Fizick, martin53, pinterf |
Version | v2.6 |
Download | FFT3dFilter-v2.6.7z |
Category | Denoisers |
License | GPLv2 |
Discussion | Doom9 Forum (original) |
Contents |
Description
FFT3DFilter uses Fast Fourier Transform method for image processing in frequency domain. It is based on some advanced mathematical algorithms of optimal filtration. It works not locally, but makes some de-localized (block) processing. In 3D mode, it results in effect similar to partial motion compensation. This filter can reduce noise without visible quality loss and artifacts, even with quite strong settings. It can greatly improve compression and reduce encoded file size.
Also it has option of limited sharpening without both noise amplifying and over-sharpening (haloing).
Requirements
- [x86]: AviSynth+ or AviSynth 2.6.0
- [x64]: AviSynth+
- Supported color formats: Y8, YV12, YV16, YV24, YV411
- AviSynth+: All planar formats (8/10/12/14/16/32bit, Y/YUV/RGB with or without alpha) are supported.
Runtime dependencies
The following are required, FFT3DFilter will not run or load without them.
- FFTW 3.3.5 (
fftw-3.3.5-dll32.zip
orfftw-3.3.5-dll64.zip
)
- *** 32-bit libfftw3f-3.dll needs to be in the search path (C:\Windows\SysWOW64 64-bit OS or C:\windows\system32 32-bit OS)
- *** 64-bit libfftw3f-3.dll needs to be in the search path (C:\windows\system32 64-bit OS)
Syntax and Parameters
FFT3DFilter (clip, float "sigma", float "beta", int "plane", int "bw", int "bh", int "bt", int "ow", int "oh", float "kratio", float "sharpen", float "scutoff", float "svr", float "smin", float "smax", bool "measure", bool "interlaced", int "wintype", int "pframe", int "px", int "py", bool "pshow", float "pcutoff", float "pfactor", float "sigma2", float "sigma3", float "sigma4", float "degrid", float "dehalo", float "hr", float "ht", int "ncpu")
- clip =
- Input clip
- clip =
- float sigma = 2.0
- Given noise value for all (or highest) frequencies. Only values greater that 0.0
- float sigma = 2.0
- float beta = 1.0
- Noise margin (float>=1.0, default=1.0 for no noise left): control noise amount left in the restoration for Wiener filter, so max filter noise attenuation =
(beta-1)/beta
.
- Noise margin (float>=1.0, default=1.0 for no noise left): control noise amount left in the restoration for Wiener filter, so max filter noise attenuation =
- float beta = 1.0
- int plane = 0
- Processed color plane:
- 0 : luma(Y)
- 1 : chroma U
- 2 : chroma V
- 3 : chroma planes U and V
- 4 : both luma and chroma
- Processed color plane:
- int plane = 0
- int bw = 48
- int bh = 48
- Block width and height.
- int bw = 48
- int bt = 3
- Block temporal size, number of frames.
- 0 : all previous frames (switch Kalman filter mode)
- 1 : only current frame (spatial 2D Wiener filter)
- 2 : previous and current frame (3D Wiener filter)
- 3 : previous, current and next frame (3D Wiener filter)
- 4 : two previous, current and next frame (3D Wiener filter)
- 5 : two previous, current and two next frames (3D Wiener filter)
- -1 : sharpen only (2D)
- Block temporal size, number of frames.
- int bt = 3
- int ow = bw/3
- int oh = bh/3
- Overlap width and height.
- int ow = bw/3
- float kratio = 2.0
- Ratio of threshold to sigma to reset Kalman filter. Variation threshold =
sigma*kratio
, good value is about from 1.5 to 3.0
- Ratio of threshold to sigma to reset Kalman filter. Variation threshold =
- float kratio = 2.0
- float sharpen = 0.0
- Sharpening strength (default=0 - do not sharpen). Good values are about 0.3 to 1.0 (negative values results in reverse effect)
- float sharpen = 0.0
- float scutoff = 0.3
- Sharpening cutoff frequency, relative to max.
- float scutoff = 0.3
- float svr = 1.0
- Sharpening (and dehalo) vertical ratio (to horizontal) (default=1.0 - same as horizontal, 0 - no vertical sharpening)
- float svr = 1.0
- float smin = 4.0
- float smin = 20.0
- Minimum and maximum limit (approximate noise margin) for sharpening stage.
- float smin = 4.0
- bool measure = true
- Select the most optimal (fastest) FFT method by speed measure (with longer init stage) instead of simple estimation.
- bool measure = true
- bool interlaced = false
- Separate fields processing.
- bool interlaced = false
- int wintype = 0
- weighting windows type:
- 0 : same analysis and synthesis half-cosine window, used in all versions before 1.4.
- 1 : intermediate between 0 and 2
- 2 : flat analysis window, rised cosine (Hanning) synthesis window.
- weighting windows type:
- int wintype = 0
- bool pframe = false
- Noise pattern frame number.
- bool pframe = false
- int px = 0
- int py = 0
- Noise pattern block horizontal X position and vertical Y position. If
px=py=0
, then the pattern block is defined automatically with minimal power spectral density.
- Noise pattern block horizontal X position and vertical Y position. If
- int px = 0
- bool pshow = false
- Show noise pattern block and its properties.
- bool pshow = false
- float pcutoff = 0.1
- Noise pattern cutoff frequency (relative to max).
- float pcutoff = 0.1
- float pfactor = 0.0
- Noise pattern denoise strength (0 to 1.0, default=0, this method disabled).
- float pfactor = 0.0
- float singma2 = sigma
- float singma3 = sigma
- float singma4 = sigma
- Given noise value at second, third, and lowest scale level frequencies. Only values greater that 0.0
- float singma2 = sigma
- float degrid = 1.0
- Weighting window compensation degree for grid decreasing. Only values greater that 0.0
- float degrid = 1.0
- float dehalo = 0.0
- Halo removal strength. Only values greater that 0.0
- float dehalo = 0.0
- float hr = 2.0
- Halo approximate radius. Only values greater that 0.0
- float hr = 2.0
- float ht = 50.0
- Halo approximate threshold. Only values greater that 0.0
- float ht = 50.0
- int ncpu = 1
- Max number of CPU threads to use for FFT calculation.
- int ncpu = 1
Examples
To sharpen only:
AviSource("blah.avi") FFT3DFilter(bt=-1, sharpen=0.7)
To denoise and slightly sharpen the interlaced clip:
FFT3DFilter(sigma=2, sharpen=0.3, interlaced=true)
Some "best settings", slower processing:
FFT3DFilter(sigma=1.5, bt=5, bw=32, bh=32, ow=16, oh=16, sharpen=0.4)
To denoise all color planes (both luma and chroma):
FFT3DFilter(sigma=2, plane=4)
To denoise luma and chroma with different settings:
FFT3DFilter(sigma=1.5, plane=0) FFT3DFilter(sigma=3, plane=3)
To decrease the existing horizontal halo only:
FFT3DFilter(bt=-1, plane=0, dehalo=1.0, hr=2.0, ht=50, svr=0)
Changelog
FFT3DFilter v2.6 (20190131) - Fix: Proper rounding when internal 32 bit float data are converted back to integer pixel values
FFT3DFilter v2.5 (20180702) - 32bit Float YUV: Chroma center to 0.0 instead of 0.5, to match new Avisynth+ r2728-
FFT3DFilter v2.4 (20170608) - some inline asm (not all) ported to simd intrisics, helps speedup x64 mode, but some of them faster also on x86. - intrinsics bt=0 - intrinsics bt=2, degrid=0, pfactor=0 - intrinsics bt=3 sharpen=0/1 dehalo=0/1 - intrinsics bt=3 - Adaptive MT settings for Avisynth+: MT_SERIALIZED for bt==0 (temporal), MT_MULTI_INSTANCE for others - Copy Alpha plane if exists - reentrancy checks against bad multithreading usage Note: for properly operating in MT_SERIALIZED mode in Avisynth MT, please use Avs+ r2504 or better.
FFT3DFilter v2.3 (20170221) - apply current avs+ headers - 10-16 bits and 32 bit float colorspace support in AVS+ - Planar RGB support - look for libfftw3f-3.dll first, then fftw3.dll - inline asm ignored on x64 builds - pre-check: if plane to process for greyscale is U and/or V return original clip - auto register MT mode for avs+: MT_SERIALIZED
FFT3DFilter v2.2 (20170216) - modifications by martin53
FFT3DFilter v2.1.1 (20070220) - last release by Fizick, see included documentation for previous changes
Archived Downloads
Version | Download | Mirror |
---|---|---|
v2.1.1 | fft3dfilter211.zip | fft3dfilter211.zip |
External Links
- GitHub - Source code repository
Back to External Filters ←