VideoHelp Forum




+ Reply to Thread
Results 1 to 2 of 2
  1. Member
    Join Date
    Nov 2013
    Location
    Western Australia
    Search Comp PM
    Hi all. I have some questions regarding SMDegrain.

    I use avisynth + +AvsPmod + MeGUI for my video encodes but I don't actually have a lot of avisynth knowledge. I learned the basics years ago from my brothers and that's about it.

    For years I've used SMDegrain to denoise videos and not had any problems and was happy with the results. (until recently I think I was using v3.3.5d by Dogway) When I would use SMDegrain, I would type in the word and hit enter and then it would look like this:

    SMDegrain(tr=3, thSAD=400, RefineMotion=False, contrasharp=False, interlaced=False, plane=4, prefilter=0, chroma=True, lsb=False, lsb_in=False, lsb_out=False, Show=False)

    The only things I would change is make RefineMotion and contrasharp true.

    A few weeks ago, I decided to upgrade my SMDegrain to the latest version (4.7.0d) and I also switched to 64bit plugins rather than 32bit as I read doing both should make my encodes faster. As usual, I typed out the word SMdegrain and hit enter and got the same line of "code" as shown above but there was an error, it said lsb was no longer a function or something. I didn't understand what that parameter did so whatever, I just removed those parts and then it worked.

    But then I noticed that it wasn't actually denoising much at all and my encode times didn't seem any faster (they might've been slower) and I found this confusing. It seems since v4 and above of Dogway's SMDegrain, a lot of it seems to work differently than before. It's definitely not functioning the same way as my old version of SMDegrain.

    So I did a little bit of reading on the parameters and it seems for someone like me who doesn't understand all the parameters very well, it might be easier to just use prefilter 1, 2, 3 ect as I'm not super fussy about tinkering with settings, I just want film noise to mostly be reduced. I want to continue enabling RefineMotion and Contrasharp - this is where my questions start.

    1. As an example, If I just use SMDegrain(prefilter=2) will it automatically implement RefineMotion=true and contrasharp=true in the "background" or should I add them to my line of code if I want them enabled?

    2. I downloaded a custom 64bit version of MeGUI as I don't think there's an official 64bit build but is there anything else I need to do to take advantage of my new 64bit plugins?
    Last edited by WAusJackBauer; 4th Dec 2025 at 21:30.
    Quote Quote  
  2. 1. As an example, If I just use SMDegrain(prefilter=2) will it automatically implement RefineMotion=true and contrasharp=true in the "background" or should I add them to my line of code if I want them enabled?
    prefilter=2 only sets the prefilter, it doesn't set other options.
    Code:
        pref    = !GlobalR ? preclip ?                  pref                                                                                                                                                     : \
                                      (prefilter==-1) ? pref                                                                                                                                                     : \
                                      (prefilter== 0) ? !isInter ? pref.ex_sbr(1, Y=Lum,UV=Chr) : pref.ex_boxblur(0.3,0,"weighted",Lum,Chr)                                                                      : \
                                      (prefilter== 1) ?            pref.ex_MinBlur(1,Chr,isInter ? """ex_Median(mode="horizontal" ,Y=y,UV=uv)""" : "median",Y=Lum)                                               : \
                                      (prefilter== 2) ?            pref.ex_MinBlur(2,Chr,isInter ? """ex_Median(mode="horizontalS",Y=y,UV=uv)""" : "median",Y=Lum)                                               : \
                                      (prefilter== 3) ? !isInter ? pref.ex_Median(mode="IQMV" ,Y=Lum,UV=Chr) : pref.ex_Median(mode="IQM",Y=Lum,UV=Chr)                                                           : \
                                      (prefilter== 4) ?            pref.ex_Median(mode="IQMST",Y=Lum,UV=Chr, thres=255).ex_sbr(3,Y=Lum,UV=Chr)                                                                   : \
                                      (prefilter== 5) ? ex_merge(DFTTest(pref,sstring="0.0:4.0 0.2:9.0 1.0:15.0",tbsize=1,Y=Lum==3,U=chroma,V=chroma,dither=1,threads=1,sbsize=12,sosize=6,swin=2),pref,           \
                                                                   pref.ex_lut(Format("range_max range_max {Lthres} ymin - / x ymin - * -"),UV=1,clamp_float=true),         Y=Lum,UV=Chr,luma=chroma)            : \
                                      (prefilter== 6) ?            pref.ex_KNLMeansCL(a=2,s=2,d=1,h=7.0,wmode=1,chroma=chroma,gpuid=max(0,gpuid),LFR=600*(nw/1920.)).ex_sbr(Y=Lum,UV=Chr)                        : \
                                      (prefilter== 7) ?            pref.ex_DGDenoise(str=Luma?0.10:0,strc=chroma?0.05:0,LFR=nw/2.,UV=Chr).                           ex_sbr(Y=Lum,UV=Chr)                        : \
                                      (prefilter== 8) ?            pref.ex_BM3D(TS?max(10,thSAD/30.):10,1,TS&&thSAD>550?"noisy":"normal",UV=Chr,gpuid=gpuid,tv_range=!fsp)                                       : \
                                                        Assert(false, "SMDegrain: 'Prefilter' didn't find a matching preset: "+string(prefilter))                                                                : \
                                       pref
    source: https://github.com/Dogway/Avisynth-Scripts/blob/master/SMDegrain/SMDegrain.avsi
    If you want other options to be set, you need to configure those.

    2. I downloaded a custom 64bit version of MeGUI as I don't think there's an official 64bit build but is there anything else I need to do to take advantage of my new 64bit plugins?
    No, clue haven't used MeGUI for ages (at least 12 years).


    About different SMDegrain versions resulting in different results:
    That should be normal, looking at the changelog over at https://raw.githack.com/Dogway/Avisynth-Scripts/master/SMDegrain/SMDegrain.html
    Quite a few things changed since 3.3.5d, including a lot of changes in the defaults and gernal handling.
    v4.7.0d (03-01-2025)

    Fix Prefilter 1 and 2 for interlaced inputs.
    Fix Globals Output in multi mode (don't remember the corner case)
    Fix broken BFF interlace handling (Thanks JohnstonJ)

    v4.6.0d (30-03-2024)

    ex_DGDenoise(), updated to new v254 DGDenoise() arguments.
    ex_BM3D(), 'preset' is now case insensitive.
    ex_Luma_Rebuild(), fix logic for 'lo' and 'hi'. Still need to fix when HBD.
    Changed the parser for Globals Out in multi mode.
    Removed an unneded check for Globals Out in non-multi mode.

    v4.5.0d (12-07-2023)

    Match global variable names to those of QTGMC
    Fix check of vector vars when doing vector output

    v4.4.0d (16-05-2023)

    Change back default for 'limit'
    Add better example for DGHDRtoSDR() prefiltering.
    Documentation updates.

    v4.3.0d (01-04-2023)

    Construct vector variables in a for loop
    Fix 'mode', 'mfilter' and 'LFR' when isMult (tr > 6)
    Swizzle in unprocessed planes to MFilter clip when the option is used

    v4.2.0d (27-03-2023)

    Fix ex_DGDenoise() when processing chroma
    Limit prefilter=6 (KNLMeansCL) gpuid to 0 minimum
    Optimization. Reuse Mavg var conversion to YUV
    Optimization. Engulf CClip code block into !GlobalO logic
    Optimization. Add 'luma' arg, for chroma only MV, or luma denoise with chroma only MVs
    Logic cleanup for isInter in show code block

    v4.1.0d (09-03-2023)

    Remove all references to RGB since it isn't supported by MVTools2
    Pass LFR through the motion mask to further mask out DCT flicker (even when DCTFlicker=false, when true mask is stronger)
    Replace prefilter=4 (FluxSmoothST) with "IQMST", suited for very grainy live action HD sources
    Update documentation

    v4.0.0d (02-03-2023)

    YUY2 support for all clip type arguments via internal planar conversion (CClip, mfilter, prefilter and input)
    Direct interlaced support for all 'mode' filters and clip type arguments (CClip, mfilter, prefilter and input)
    Update handling of interlaced content. Bugfix + Performance + Code optimization
    Update chroma shift for UHDHalf to use Catmull-Rom instead of slower spline16
    Allow string types for 'prefilter' argument to define the preset
    Replace GaussT5 with TemporalGauss 'mode' and add TemporalSmooth mode (IDW weightings)
    Reparametrize thSCD1, DCTR and scaleCSAD for TS (Temporal___) modes (regression fix)
    Add 'mode' to show panel
    Allow recursion for all 'mode's except TemporalSoften
    Optimizations for chroma only denoising
    Add 'threads' arg for when CPU nnedi3 (pel>1, subpixel=4 and gpuid=-1)
    ex_retinex() - Fixed highlights=false for lvl=1 and lvl=2
    ex_retinex() - Fixed range conversion for all 'lvl' modes
    ex_BM3D() - Fix range string format when converting to other formats
    ex_DGDenoise() - Update chroma subsampling kernel to 'Didee' instead of slower spline36
    Finished Documentation

    v3.6.0d (06-02-2023)

    ex_Luma_Rebuild - Add 'lo' and 'hi' args for optional normalization
    Some typos and cosmetics

    v3.5.9d (18-01-2023)

    Better field parity detection for interlaced clips
    Frame property assignments for interlaced clips

    v3.5.8d (16-01-2023)

    Support back YUY2 via internal YV16 conversion
    Add IQMV as prefilter=3 and tune ex_FluxSmoothST() (prefilter=4)
    Optimize ex_BM3D() and ex_DGDenoise() format revert, and support Y clips
    Support Y clips when show=true

    v3.5.7d (02-12-2022)

    Fix logic for nnedi3 pixel center shift (subpixel=4)
    Fix Globals output (Globals=3)
    Fix super_render pelclip being set to nop() when reading Globals

    v3.5.6d (30-11-2022)

    Fix pixel center shift deviation in nnedi3 (subpixel=4) for high pel
    Swap prefilter 6 and 7 order for more coherence
    Tweak mode="dfttest" internal 'tmode' arg to work with odd 'tr'

    v3.5.5d (20-09-2022)

    Add 'DFTTest' as mode
    Update Documentation (WIP)
    Cosmetics

    v3.5.4d (02-08-2022)

    Replaced NNEDI3CL() with nnedi3wrap() so you can switch to CPU or GPU nnedi3 via 'gpuid' arg
    Since ResizersPack is now mandatory, nmod() was used where appropiate
    Fixed dimension references when UHDHalf is used
    Changed Str=1 to go directly to ConvertBits()
    Fixed 'show' panel for UHD and increased curve precision in 'show'
    ex_retinex() - Fixed normalization in HBD for lvl=3
    ex_retinex() - Expanded mask terminator

    v3.5.3d (08-07-2022)

    Replace nnedi3 calls (CPU based) with NNEDI3CL (GPU) when subpixel=4

    v3.5.2d (28-06-2022)

    ex_luma_rebuild() - Add RGB support
    ex_retinex() - Support for single channel clips
    ex_retinex() - Argument to disable highlight compression

    v3.5.1d (01-06-2022)

    Update function definitions
    Rename 'device_id' arg to 'gpuid'
    Allow CPU processing for prefilters via gpuid=-1
    Update UHD downscale coefficients
    'Str=1.0' is inclusive for ex_luma_rebuild() (only does a range conversion)
    ex_retinex() - Default UV to 3, for when used as stand-alone
    ex_retinex() - Add proper greyscale conversion
    ex_BM3D() - Add 'gpuid' argument
    ex_KNLMeansCL() - Change 'device_id' to 'gpuid'

    v3.5.0d (17-04-2022)

    Change 'search' and 'thSCD1' Defaults
    ex_Luma_Rebuild() - Add 'tv_out' and 'bits' args
    ex_retinex() - Change pmax to not thresholded max for lvl=3

    v3.4.9d (01-04-2022)

    Tweak some defaults; searchr, DCTR, pelsearch, plevel, pglobal, searchparam and searchparamr
    Force input to frame based also for pel > 2
    Fix pelclip height for interlaced sources
    Retrieve prefilter '_ColorRange' instead of using input's
    Use lvl=3 for ex_retinex() prefiltering if '_SceneRange' is present
    ex_retinex() - Add 'tv_out' arg when output is not for prefiltering use cases
    ex_retinex() - Add 'lvl=3' mode, will use scene based accumulated min and max stats

    v3.4.8d (09-03-2022)

    Rebase to latest ExTools
    Rebase to latest LSFPlus
    Fine tune function definitions
    ex_luma_rebuild() - Add selective propCopy and update 'Str' and 'c' defaults
    ex_KNLMeansCL - Add 'DCT' arg and add propCopy
    ex_KNLMeansCL/ex_DGDenoise - Default 'DCT' to true

    v3.4.7d (15-02-2022)

    Adjust defaults for internal ex_luma_rebuild()
    Subpixel=3 (now Default) is blackmanresize(taps=8), nnedi3 is now subpixel=4
    Fine tuned prefiltering settings and ex_BM3D() uses CUDA back again
    ex_BM3D() - Add 'preset' arg and add additional arguments to BM3D_CUDA and BM3D_CPU calls
    ex_DGDenoise() - Add LFR and DCT args
    ex_KNLMeansCL() - Turn 'LFR' to float and rebase with ex_LFR()

    v3.4.6d (08-02-2022)

    Fix typo in ex_KNLMeansCL()
    Reimplement back ex_KNLMeansCL() as prefilter=5
    Shift ex_DGDenoise() to prefilter=7
    Add post-blur to prefilter=5 and prefilter=7
    Default prefilter=6 (ex_BM3D) to CPU mode (CUDA is bugged)

    v3.4.5d (08-02-2022)

    ex_DGDEnoise() - New GPU based denoiser wrapper
    ex_KNLMeansCL() - Add 'wref' arg and limit 's' to 8
    Replace ex_KNLMeansCL() with ex_DGDenoise() as prefilter=5
    Optimize 'thSADR' and 'thSADC' Defaults
    LSFmod() - Change 'smode' to 4 for HD
    ex_Luma_Rebuild() - Fix 'show' setting
    ex_retinex() - frameprops passthrough
    ex_BM3D() - Add better matrix detection for the format conversions
    ex_BM3D() - Default chroma sigma to 1 when not used otherwise garbage output

    v3.4.4d (28-01-2022)

    Add 'IQMT' as degrain mode
    Add range arg to nnedi3
    Rebase LSFmod to latest version

    v3.4.3d (23-01-2022)

    Removed 'trymany' and 'divide' arguments
    Changed a few defaults; revert 'overlap', tune 'sharp', 'rfilter' and scaleCSAD
    Add a low frequency sharpened prefilter when LFR is enabled
    Optimize/simplify ex_KNLMeansCL() 'LFR' algorithm
    Add a stronger LFR for ex_KNLMeansCL prefilter
    Fix issue when subpixel=3 was used (limit 'sharp' to 2 in MSuper)
    ex_minblur()/ex_sbr() - Fixed last call clip order to properly inherit frameprops

    v3.4.2d (10-01-2022)

    Add function definitions
    Fix for ex_luma_rebuild() plot

    v3.4.1d (08-01-2022)

    Default overlap to blksize/4 when refinemotion is used. (Slight +detail retention when motion and +performance)
    Rebase to latest ExTools. Affected 'fulls' args in prefilter=0 and prefilter=4
    ex_luma_rebuild() - Add 'show' argument to show curve plot

    v3.4.0d (14-12-2021)

    Rebase to latest ExTools
    Fix for default LFR value on UHD clips
    Optimized tv to pc luma range for HBD inputs and Str=0

    v3.3.9d (03-12-2021)

    Recursion for MDegrain
    Defaults when input is single plane or plane=0
    Clean Asserts and allow blksize of 24
    Prefilter UHD clips in its halved version (if UHDHalf=true, default)
    New prefilter=3 for ex_FluxSmoothST(), following modes are shifted up in number
    Fix super_render when reading Globals
    ex_Luma_Rebuild() use internal scale_inputs when tv_range=false (faster) + ditch 'fulls'
    ex_retinex() use internal scale_inputs when tv_range=false (faster) + ditch 'fulls'
    ex_retinex() replace old YPlaneMin/Max with PlaneMinMaxStats
    ex_BM3D() switch 'fulls' arg with 'tv_range'
    ex_BM3D() new arg 'OPP' to filter in OPP space as originally intended

    v3.3.8d (14-11-2021)

    Optimize nnedi3 for subpixel=3
    Rename srfilter to rfilter
    Final tweaks to DCTFlicker

    v3.3.7d (13-11-2021)

    ex_MinBlur() 'th' arg.
    Add 'smart2' and 'smart3' modes
    Use 8-bit for subpixel=3.

    v3.3.6d (12-11-2021)

    Remove 'fulls' arg, now it's derived from frameprops or overriden by tv_range arg
    Fill in appropiate values for 'fulld'
    Increase blksize limit to 64
    Improve DCTFlicker filtering
    Default DCTFlicker to false
    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!