    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. 

Input/Output

        int  Y = 3
        int  U = 2
        int  V = 2

            Choose what planes to process; works just like MaskTools2. 

                    2 : copy from input clip
                    3 : 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. 

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. 

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. 

        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. 

Post-Processing

        int  sharp = 1

            Whether to use contra-sharpening to resharpen the deringed clip; 1-3 represents radius, 0 means no sharpening. 

        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. 

        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. 

