Go Back    Forum > Digital Video > Video Project Help > Restore, Filter, Improve Quality

Reply
 
LinkBack Thread Tools
  #1  
04-26-2015, 01:18 PM
Dogway Dogway is offline
Free Member
 
Join Date: Apr 2015
Posts: 4
Thanked 0 Times in 0 Posts
I want to bring my scripts and functions over here in case you find them useful. Also to bring attention and constructive discussion about overall Avisynth and video restoration.


SMDegrain is simply a wrapper for mdegrain, nothing fancy or magical. Just convenient automations for common tasks to get things done fast and in good quality, without forgetting some flexibility too. I created this based off my needs, and evolved from there. I took Caroliano's SMDegrain() as a base to build it because I also wanted something simple to use and straight to the point, in the same sense as the original script indicates: "To make your scripts shorter and less geeky". Think of it as a front end for mvtools2+mdegrain.

The main features of this function are:

High bitdepth denoising
Higher temporal radius (tr>3)
Contrasharpening
Interlaced support
YUY2 support
Prefilter and Motion Filter support
Motion Vectors Globals Input/Output
RefineMotion Option (MRecalculate)
+some more little options and any combination of the above supported


Everything is OFF by default so you just type smdegrain() and it works, but as soon as you start setting more parameters on you will find to need more plugins and scripts. To run it you will need at least mvtools2 and masktools2. Read on dependencies to know more.

A simple SMDegrain() call would be equal to:

Code:
super_search = Dither_Luma_Rebuild(S0=1.0,c=0.0625).MSuper(rfilter=4)

bv2 = super_search.MAnalyse(isb = true,  delta = 2, overlap= 4)
bv1 = super_search.MAnalyse(isb = true,  delta = 1, overlap= 4)
fv1 = super_search.MAnalyse(isb = false, delta = 1, overlap= 4)
fv2 = super_search.MAnalyse(isb = false, delta = 2, overlap= 4)

MDegrain2(MSuper(levels=1), bv1, fv1, bv2, fv2, thSAD=300, thSADC=150)
As you see, nothing too outrageous, just a nice good code block you save from typing and hence human induced errors.
I have to specially thank cretindesalpes for bearing my incessant questions related to this function.

enjoy!






Changelog:

Code:
v3.0d:   - Adjusted SD<>HD discretion
         - Added mfilter (Motion Filter) new feature
         - subpixel=3 (nnedi3); removed qual=2 due to possible blending bug (quote by cretindesalpes), this also boosts speed
         - Lowered the defaults for less aggressive denoise (still somewhat high)
         - Fixed chroma not showing in debug (show) mode when lsb=true and prefilter=3 were paired
         - Fixed long lasting issues in Show Panel for certain not mod height resolutions
         - Now prefilter=0 is minblur(0), lighter denoising than prefilter=1, default is now -1 (off)
         - Documentation update (plugin updates, notes, links, examples, etc)

v2.2d:   - Removed one residual variable in Contrasharpening function
         - Fixed a regression at v2.0 for Interlaced YUY2 sources by changing wrong variable ifC to if0, and...
         - ...adding a missing weave() to the last MergeChroma() call
         - Dropped Dither support. (Will still work/not work as before, but lack of official support renders it to a YMMV condition)

v2.1d:   - Fixed Refinemotion Globals Input labels
         - Fixed ContrasharpeningHD Vectors for Interlaced HD sources
         - Added ability to import Global Vectors even when "tr" is lower than parent instance "tr" (credit to cretindesalpes)
         - Expanded support for Interlaced Denoising "tr" up to 64 (credit to cretindesalpes)
         - Cosmetics

v2.0d:   - Fixed and optimized chroma handling for lsb_in, contrasharpening and YUY2 content v.1.95
         - Enhanced Chroma bypass on the sharpening stage
         - Merged ContraHD() internally for Contrasharpening in HD sources
         - Dropped QTGMC support on import/export motion vectors (small value for increased confusion)
         - Fixed Median code for planar inputs in MinBlur() (needs RemoveGrainHD, dropped medianblur requirement)
         - Defaulted truemotion to false for HD inputs
         - Code Optimization and Clean up
         - Others

  v1.9d: - Added truemotion parameter (default=true). Now you can change it to false (as in MCTemporalDenoise()), so low frequency detail won't be lost (walls...), although it could leave more noise on high frequency details
         - Added thSADC, and thSCD1/thSCD2 parameters for finer control
         - Tweaked prefilter=3 dfttest sigmas for better low frequency detail protection
         - Detached explanation and converted to html. Updated and extended the contents as well
         - Fine tuned and robustized the Show Panel
         - Optimized and organized code, more precisely the contrasharpening part
         - Fixed a few ternary checks for when Globals=3
         - Others

 v1.8d:  - Added automatic dark protection for prefilter=3 (dfttest performs badly in darks) v1.71d
         - Fixed chroma variable when chroma=false, from 2 (copy chroma) to 1 (discard chroma) v1.71d
         - Explanation and cosmetics v1.71d
         - Added acknowledgments and updated explanation
         - Added brackets to all functions (it has been reported to cause problems on occasional circumstances) (http://forum.doom9.org/showthread.ph...86#post1515886)
         - Reworked and fixed the parameters panel. Now you have a color guide to have an idea on what to tweak depending on selected mode in Show. For strings: "Speed", "Memory" and "Quality"
         - Optimized lsb_in for over 720p HD resolutions which was causing memory hogs
         - Fixed contrasharpening for YUY2 sources when lsb=true
         - Fixed some inconsistencies for YUY2 sources when prefilter=3 and extended protection a bit

 v1.7d:  - Fixed and extended introduction explanation v.1.61d
         - Fixed some issues for Globals=1 (Read) in relation to lsb_in and luma expansion auto-prefilter v.1.61d
         - Added mild gauss blur prefilter option as prefilter=1. Consequent modes are displaced v.1.61d
         - Changed prefilter 1 and 2 to Minblur (Gauss/Median combination) v.1.63d
         - Updated MinBlur function v.1.62d and v.1.66
         - Code tidied up v.1.62d
         - Updated luma expansion, now you can enhance darks (with 'Str' and 'Amp') in the same step as the TV->PC conversion stage, thus +optimized, +quality. v.1.63d by cretindesalpes (http://forum.doom9.org/showthread.ph...18#post1548318)
         - Removed pre_custom. Now use prefilter to load a prefiltered clip, as well as modes 0~3
         - Added Show parameter. Now you can see the used and default parameters along the prefilter clip as well
         - Fixed one note related to prefilter clip input for interlaced content

 v1.6d:  - Fixed and extended introduction explanation
         - Fixed Ditherpost for interlaced sources
         - Fixed a broken reference for reading MRecalculate globals when tr>3
         - Fixed a Globals=1 MSuper automatization
         - Fixed a plane processing bypass when chroma=false
         - Added LSFmod as optional contrasharpening (slower, but biased contrasharpening and probably better depending on source)
         - Added default luma expansion auto-prefilter for motion search (16% more values)
         - Added YUY2 support
         - Added the 'mode' parameter of ditherpost()
         - Added support for interlaced temporal radius up to 6

 v1.5d:  - Changed "srchSuper" Global variable to "QTGMC_srchSuper", compatible with QTGMC. Anyhow you may probably want to create a new super clip. Test it out! v.1.41d
         - Introduction spelling and presentation v.1.42d
         - Added lsb and lsb_in for prefilter=2 (dfttest) v.1.43d & v.1.44d
         - Some better definitions for the settings help v.1.45d
         - pelclip is now subpixel = 3 ('sharp' parameter before) v.1.45d
         - Other minor tweaks v.1.45d
         - Fixed an important issue when using prefilter with subpixel=3 ('pelclip' parameter before)
         - Optimizations in ditherpost for chroma
         - Changed rfilter (hierarchical levels smoothing/scaling) from default 2 to 4. Better results in my judge
         - Some more little tweaks in code and introduction

 v1.4d:  - Added pelclip option for top quality subpixel interpolation when pel > 1
         - Changed QTGMCV parameter to Globals, and added a bunch of new features like vectors output from smdegrain()
         - Big introduction and code optimization tweaks

 v1.3d:  - Fixed an important issue on the Interlaced parameter and improved overall handling (v.1.21d & v.1.3d)

 v1.2d:  - Added Interlaced parameter, for processing interlaced sources
         - Some introduction and code optimization tweaks (v.1.12d & v.1.2d)

 v1.1d:  - Implemented MDegrainN for tr > 3, from the MVTools2 mod of Dither
         - Minor introduction and code optimization tweaks

 v1.0d:  - Added CClip parameter. Reference an earlier stage of your processing chain as your sharp version for the contrasharpening

 v0.9d:  - Added QTGMCV parameter, for reusing vectors from QTGMC bob deinterlacer

 v0.8d:  - Fixed a few things related to the lsb_in option
         - Minor introduction and code optimization tweaks

 v0.7d:  - Implemented "fake" lsb_in option. Output will have slightly more quality (if any), and will compress better. (Experimental)
         - Fixed a not passed argument in the hpad, vpad parameters

 v0.6d:  - Minor introduction and code optimization tweaks

 v0.5d:  - Added dfttest option for preblur (now prefilter) option. Slower but better due to its internal deblock+denoise operation, plus sharper results
         - Added pre_custom option for the prefilter process, define here a denoised clip as your prefiltered version
         - Updated the introduction help

 v0.4d:  - Added preblur option for slight vector blurring where motionmatch is bad                     (http://forum.doom9.org/showthread.php?t=161594)
         - Added RefineMotion parameter for better motion vectors. Based off Killer()                   (http://forum.doom9.org/showthread.ph...72#post1266572)
         - Added parameters "lsb" and "lsb_out", for the MVTools2 mod version of cretindesalpes' Dither (http://forum.doom9.org/showthread.ph...59#post1386559)
         - Other minor aesthetics and performance adjustments

 v0.3d:  - Fixed plane (for MDegrain) and added chroma (for MAnalyse) parameters

 v0.2 :  - Added introductory section
         - Added more parameters

 v0.1 :  - Basic working version
         - Not released

How / Where to Download the Files?
You'll find the attached file downloads at the bottom of this top post. Files are provided for the convenience of our members. To get download access, simply join the forum as either a Free Member or Premium Member. We don't send spam or sell your email addresses. If you're not sure what to do with .zip or .rar files, see this help post.


Attached Files
File Type: zip SMDegrain v.3.0d.zip (26.4 KB, 31 downloads)
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
04-26-2015, 11:10 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,508
Thanked 2,449 Times in 2,081 Posts
New denoisers are always in demand, especially if they can remove noise WHILE mitigating unwanted side effects. This will be something that I look forward to trying next month.

Several others members here -- sanlyn, themaster1, etc -- probably feel the same.

Avisynth plugins are always a welcome addition here.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
Reply




Tags
avisynth, denoiser, dogway, mvtools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stabilization Tools Pack v1.7 for Avisynth [DOWNLOAD] Dogway Restore, Filter, Improve Quality 5 04-27-2015 07:15 PM
Simple hosting needs, with a twist MisterNeutron Web Hosting 12 02-09-2015 01:52 AM
Looking for a simple, FREE, no-frills authoring program unclescoob Author, Make Menus, Slideshows, Burn 4 12-20-2011 08:14 AM
Simple editor that can brighten .mpg movie files Sossity Edit Video, Audio 1 12-21-2010 04:18 AM
AVISynthesizer: Build complete Avisynth scripts using pre-made templates [DOWNLOAD] lordsmurf Encode, Convert for discs 0 11-09-2010 01:13 AM

Thread Tools



 
All times are GMT -5. The time now is 12:23 AM