Dogway
24th December 2011, 14:20
EDIT (2021): New SMDegrain and more over this thread (https://forum.doom9.org/showthread.php?t=182881)
This is just a wrapper for mdegrain, nothing fancy or magical. Just convenient automatizations 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 (http://forum.doom9.org/showthread.php?t=152326) as a base to build it because I also wanted something simple to use and straight to the point.
The main features of this function are:
High bitdepth denoising
Higher temporal radius (tr>3)
Contrasharpening
Interlaced support
YUY2 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.
Introduction deserves a good read to understand not only the parameters but overall mvtools2 behaviour from what I have experiencied and read over the forums.
This is my biggest function script I have done so I'm sure many things are wrong or can be improved for code efficiency, this is one reason I post it here. I'm not sure if it was right to add YUY2 and Globals support, as it adds lots of code without a meaningful gain on quality or possibilities. I might rethink its inclusion...
I have to specially thank cretindesalpes for bearing my incesant questions related to this. Eagerly awaiting MT : )
enjoy!
SMDegrain() Mod v1.8d (http://www.mediafire.com/?2ezelmw4aa65b3x) (18-01-2012)
http://img195.imageshack.us/img195/2640/showv18d.png
Changelog
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.php?p=1515886#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 enhace 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.php?p=1548318#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.php?p=1266572#post1266572)
- Added parameters "lsb" and "lsb_out", for the MVTools2 mod version of cretindesalpes' Dither (http://forum.doom9.org/showthread.php?p=1386559#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
This is just a wrapper for mdegrain, nothing fancy or magical. Just convenient automatizations 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 (http://forum.doom9.org/showthread.php?t=152326) as a base to build it because I also wanted something simple to use and straight to the point.
The main features of this function are:
High bitdepth denoising
Higher temporal radius (tr>3)
Contrasharpening
Interlaced support
YUY2 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.
Introduction deserves a good read to understand not only the parameters but overall mvtools2 behaviour from what I have experiencied and read over the forums.
This is my biggest function script I have done so I'm sure many things are wrong or can be improved for code efficiency, this is one reason I post it here. I'm not sure if it was right to add YUY2 and Globals support, as it adds lots of code without a meaningful gain on quality or possibilities. I might rethink its inclusion...
I have to specially thank cretindesalpes for bearing my incesant questions related to this. Eagerly awaiting MT : )
enjoy!
SMDegrain() Mod v1.8d (http://www.mediafire.com/?2ezelmw4aa65b3x) (18-01-2012)
http://img195.imageshack.us/img195/2640/showv18d.png
Changelog
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.php?p=1515886#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 enhace 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.php?p=1548318#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.php?p=1266572#post1266572)
- Added parameters "lsb" and "lsb_out", for the MVTools2 mod version of cretindesalpes' Dither (http://forum.doom9.org/showthread.php?p=1386559#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