From Avisynth wiki
Revision as of 21:49, 22 August 2021 by Reel.Deal (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Author MeteorRain
Version r11
Category Denoisers
License GPLv2
Discussion Doom9 Forum



FFT3DFilter is a 3D Frequency Domain filter - strong denoiser and moderate sharpener. It was originally written by Alexander G. Balakhnin aka Fizick, and later modified by martin53 for AviSynth 2.6 and later modified by Ferenc Pintér aka pinterf for further improvement, high bit depth, and more. Kudos to them for creating and improving this fantastic tool.

In this project, legacy format like YUY2 has been removed, legacy parameter like multiplane has been removed, and SIMD code has been completely re-written for all core parts of the code. Due to API change, the project has been renamed from FFT3DFilter to neo_FFT3D to avoid confusion. SSE is required to run optimized routine. AVX and AVX512 routine is also available.


Runtime dependencies

The following are required, neo_fft3d will not run or load without them.

  • FFTW 3.3.5 ( or
*** 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

neo_fft3d (clip, float "sigma", float "beta", 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 "y", int "u", int "v", int "l", int "t", int "r", int "b", int "opt", int "ncpu", bool "mt")

clip   =
Input clip

float  sigma = 2.0
Given noise value for all (or highest) frequencies. Only values greater that 0.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.

int  bw = 48
int  bh = 48
Block width and height.

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)

int  ow = bw/3
int  oh = bh/3
Overlap width and height.

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

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  scutoff = 0.3
Sharpening cutoff frequency, relative to max.

float  svr = 1.0
Sharpening (and dehalo) vertical ratio (to horizontal) (default=1.0 - same as horizontal, 0 - no vertical sharpening)

float  smin = 4.0
float  smin = 20.0
Minimum and maximum limit (approximate noise margin) for sharpening stage.

bool  measure = true
Select the most optimal (fastest) FFT method by speed measure (with longer init stage) instead of simple estimation.

bool  interlaced = false
Separate fields processing.

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.

bool  pframe = false
Noise pattern frame number.

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.

bool  pshow = false
Show noise pattern block and its properties.

float  pcutoff = 0.1
Noise pattern cutoff frequency (relative to max).

float  pfactor = 0.0
Noise pattern denoise strength (0 to 1.0, default=0, this method disabled).

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  degrid = 1.0
Weighting window compensation degree for grid decreasing. Only values greater that 0.0

float  dehalo = 0.0
Halo removal strength. Only values greater that 0.0

float  hr = 2.0
Halo approximate radius. Only values greater that 0.0

float  ht = 50.0
Halo approximate threshold. Only values greater that 0.0

int  y = 3
int  u = 3
int  v = 3
Whether a plane is to be filtered.
  • 1 - Do not touch, leaving garbage data
  • 2 - Copy from origin
  • 3 - Process

int  l = 0
int  t = 0
int  r = 0
int  b = 0
Exclude part of image to be filtered.
Non-filtered part is copied from the source.

int  opt = 0
Sets which CPU optimizations to use.
  • <0 - Auto detect
  • 0 - Auto detect with AVX512 disabled
  • 1 - Use C
  • 2 - Use up to SSE
  • 3 - Use up to AVX
  • 4 - Use up to AVX512

int  ncpu = 2
Number of FFTW multi threads.

bool  mt = false
mt = false disables plane based multi-threading (default).


To sharpen only:

neo_fft3d(bt=-1, sharpen=0.7)

To denoise and slightly sharpen the interlaced clip:

neo_fft3d(sigma=2, sharpen=0.3, interlaced=true)

Some "best settings", slower processing:

neo_fft3d(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):

neo_fft3d(sigma=2, y=3, u=3, v=3) # same as neo_fft3d(sigma=2)

To denoise luma and chroma with different settings:

neo_fft3d(sigma=1.5, y=3, u=2, v=2)
neo_fft3d(sigma=3.0, y=2, u=3, v=3)

To decrease the existing horizontal halo only:

neo_fft3d(bt=-1, dehalo=1.0, hr=2.0, ht=50, svr=0, y=3, u=2, v=2)


See GitHub releases page.

External Links

  • GitHub - Source code repository

Back to External Filters

Personal tools