HQDering mod

From Avisynth wiki
Revision as of 01:46, 23 June 2014 by Reel.Deal (Talk | contribs)

Jump to: navigation, search
Abstract
Author mawen1250
Version v1.4
Download HQDeringmod
Category Deringing & Mosquito Noise
Requirements
License
Discussion

Contents

Description

Applies deringing by using a smart smoother near edges (where ringing occurs) only.


Required Filters

  • dfttest v1.9.4
  • dither v1.23.0
  • MaskTools2 2.0a48+
  • RemoveGrain + Repair v1.0pre
  • RemoveGrainHD v0.5


Syntax and Parameters

HQDeringmod (clip input, clip "smoothed", clip "ringmask", int "mrad", int "msmooth", bool "incedge", int "mthr", int "minp", int "nrmode", int "nrmodec", float "sigma", float "sigma2", int "sbsize", int "sosize", int "sharp", int "drrep", float "thr", float "elast", float "darkthr", int "Y", int "U", int "V", bool "lsb_in", bool "lsb", bool "lsb_out", bool "tv_range", int "dither", bool "show")


Input Clips

clip  input =
Input clip to be processed.
clip  smoothed =
Optional preprocessed smoothed clip.
clip  ringmask =
Optional preprocessed ring mask.

Parameters for Input/Output

int  Y = 3
int  U = 2
int  V = 2
Choose what planes to process.
bool  lsb_in = false
input clip is 16-bit stacked or not.
bool  lsb = false
smoothed clip is 16-bit stacked or not, processing precision is 16-bit or not.
bool  lsb_out = lsb
Output clip is 16-bit stacked or not. The default is dictated by lsb.
bool  tv_range = true
Input clip is TV-range (16-235) or PC-range (0-255).
int  dither = 6
Dither mode for 16-bit to 8-bit conversion.
bool  show = false
Whether to output mask clip instead of filtered clip.

Parameters for Ring Mask

int  mthr = 60
Threshold of prewitt edge mask, lower value means more aggressive processing but for strong ringing,
lower value will treat some ringing as edge, which protects this ringing from being processed.
int  minp = 1
Inpanding of prewitt edge mask, higher value means more aggressive processing.
int  mrad = 1
Expanding of edge mask, higher value means more aggressive processing.
int  msmooth = 1
Inflate of edge mask, smooth boundaries of mask.
bool  incedge = false
Whether to include edge in ring mask, by default ring mask only include area near edges.

Parameters for Dering Kernel

int  nrmode =
Deringing kernel:
  • 0: dfttest
  • 1: MinBlur(radius=1)
  • 2: MinBlur(radius=2)
  • 3: MinBlur(radius=3)
By default, 2 is set for HD(Width>=1280 or Height>=720) and 1 is set for non-HD.
int  nrmodec = nrmode
Deringing kernel for chroma. The default for nrmodec is the value of nrmode.
float  sigma = 128.0
dfttest: sigma for medium frequencies.
float  sigma2 = sigma/16.0
dfttest: sigma for low&high frequencies. The default value is sigma/16.0, so by default sigma2=8.
int  sbsize =
dfttest: length of the sides of the spatial window.
By default, 8 is set for HD(Width>=1280 or Height>=720) and 6 is set for non-HD.
int  sosize =
dfttest: spatial overlap amount.
By default, 6 is set for HD(Width>=1280 or Height>=720) and 4 is set for non-HD.

Parameters for Post-Processing

int  sharp2 = 1
Whether to use contra-sharpening to resharpen the deringed clip; 1-3 represents radius, 0 means no sharpening.
int  drrep2 =
Use repair for details retention, recommended values are 24/23 for lsb=False and 13/12/1 for lsb=True.
The default is set by this logic:
If nrmode is greater than 0 and lsb=True then set to 13.
If nrmode is greater than 0 and lsb=False then set to 24.
If nrmode is not greater than 0 and lsb=false then set to 0.
float  thr = 12.0
The same meaning with "thr" in Dither_limit_dif16, valid value range is [0, 128.0] lsb=True and [0, 255.0] for lsb=False.
Set to 0 to disable the limiting process.
float  elast = 2.0
The same meaning with "elast" in Dither_limit_dif16, valid value range is [1, inf ).
PDiff: pixel value diff between processed clip and input clip.
ODiff: pixel value diff between output clip and input clip.
PDiff, thr and elast is used to calculate ODiff:
ODiff = PDiff when [PDiff <= thr]
ODiff gradually smooths from thr to 0 when [thr <= PDiff <= thr * elast]
For elast>2.0, ODiff reaches maximum when [PDiff == thr * elast / 2]
ODiff = 0 when [PDiff >= thr * elast]
Larger "thr" will result in more pixels being taken from processed clip.
Larger "thr" will result in less pixels being taken from input clip.
Larger "elast" will result in more pixels being blended from processed&input clip, for smoother merging.
float  darkthr =
Threshold for darker area near edges, by default darkthr equals to thr/4.
Set it lower if you think de-ringing destroys too much lines, etc.
When "darkthr" is not equal to "thr", "thr" limits darkening while "darkthr" limits brightening.
    Example:

    "thr=0,   darkthr=0  " - no limiting
    "thr=255, darkthr=255" - no limiting
    "thr=8,   darkthr=2  " - limit darkening with   8             , brightening is limited to 2
    "thr=8,   darkthr=0  " - limit darkening with   8             , brightening is limited to 0(stays unchanged)
    "thr=255, darkthr=0  " - limit darkening with 255(no limiting), brightening is limited to 0(stays unchanged)



Examples

Default:

AviSource("Blah.avi")
HQDeringmod()


Changelog

 26/12/2003  v0.1:  [mf]
     - initial release


External Links

Personal tools