HQDering mod
From Avisynth wiki
		
		
		
| Abstract | |
|---|---|
| Author | mawen1250 | 
| Version | v1.8 | 
| Download | HQDeringmod_v1.8.avsi | 
| Category | Deringing & Mosquito Noise | 
| License | |
| Discussion | NMM-HD Thread - [Chinese] | 
| Contents | 
Description
Applies deringing by using a smart smoother near edges (where ringing occurs) only.
Requirements
- [x86]: AviSynth+ or AviSynth 2.6
- [x64]: AviSynth+
- Progressive input only
- Supported color formats: Y8, YV12, YV16, YV24
Required Plugins
Latest version of the following plugins are recommended unless stated otherwise.
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  input =   
- clip  smoothed =   
 - Optional preprocessed smoothed clip.
 
 
- clip  smoothed =   
- clip  ringmask =   
 - Optional preprocessed ring mask.
 
 
- clip  ringmask =   
Input/Output
- int  Y = 3 
 
- int  U = 2 
 
- int  V = 2 
 - Choose what planes to process; works just like MaskTools2.
 
 
- int  Y = 3 
- 2 : copy from input clip
- 3 : process
 
 
 
 
- bool  lsb_in = false 
 - input clip is 16-bit stacked or not.
 
 
- bool  lsb_in = false 
- bool  lsb = false 
 - smoothed clip is 16-bit stacked or not, processing precision is 16-bit or not.
 
 
- bool  lsb = false 
- bool  lsb_out = lsb 
 - Output clip is 16-bit stacked or not. The default is dictated by lsb.
 
 
- bool  lsb_out = lsb 
- bool  tv_range = true 
 - Input clip is TV-range (16-235) or PC-range (0-255).
 
 
- bool  tv_range = true 
- int  dither = 6 
 - Dither mode for 16-bit to 8-bit conversion.
 
 
- int  dither = 6 
- bool  show = false 
 - Whether to output mask clip instead of filtered clip.
 
 
- bool  show = false 
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  mthr = 60 
- int  minp = 1 
 - Inpanding of prewitt edge mask, higher value means more aggressive processing.
 
 
- int  minp = 1 
- int  mrad = 1 
 - Expanding of edge mask, higher value means more aggressive processing.
 
 
- int  mrad = 1 
- int  msmooth = 1 
 - Inflate of edge mask, smooth boundaries of mask.
 
 
- int  msmooth = 1 
- bool  incedge = false 
 - Whether to include edge in ring mask, by default ring mask only include area near edges.
 
 
- bool  incedge = false 
Deringing 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.
 
- Deringing kernel:
 
- int  nrmode =   
- int  nrmodec = nrmode 
 - Deringing kernel for chroma. The default for nrmodec is the value of nrmode.
 
 
- int  nrmodec = nrmode 
- float  sigma = 128.0 
 - dfttest: sigma for medium frequencies.
 
 
- float  sigma = 128.0 
- float  sigma2 = sigma/16.0 
 - dfttest: sigma for low&high frequencies. The default value is sigma/16.0, so by default sigma2=8.
 
 
- float  sigma2 = sigma/16.0 
- 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  sbsize =   
- 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.
 
 
- int  sosize =   
Post-Processing
- int  sharp = 1 
 - Whether to use contra-sharpening to resharpen the deringed clip; 1-3 represents radius, 0 means no sharpening.
 
 
- int  sharp = 1 
- int  drrep =   
 - 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.
 
 
 
- int  drrep =   
- 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  thr = 12.0 
- 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]
 
 
 
- float  elast = 2.0 
- 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.
 
 
- float  darkthr =   
    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
HQDeringmod with default values:
AviSource("Blah.avi") HQDeringmod()
External Links
- NMM-HD Forum - HQDering mod discussion [Chinese].
Back to External Filters ←
