MC Spuds

From Avisynth wiki
Jump to: navigation, search
Abstract
Author Spuds, Didée
Version v1.1 BETA - 22.OCT.08
Download MC_Spuds.avsi
Category Spatial-Temporal Denoisers
Requirements
  • YV12
License
Discussion

MC_Spuds( clip clp, int "frames", int "strength", int "blocksize", int "overlap", int "thsad", int "dct", int "ml", bool "chro", bool "postprocess", bool "preprocess", bool "aggressive",int "debug", int "thSCD1", int "thSCD2", bool "edgeclean", bool "focus", bool "removeblocks", bool "starfield", bool "anime", float "ss_x", int "sharpp", bool "addnoise", int "shadow_l", int "shadow_h", float "thStar", int "limit", int "pnew", int "edm_lo", int "edm_hi", bool "flow", int "search", bool "colorbleed", int "quant1", int "quant2", int "uv", bool "temporal", int "pel", int "sharp", bool "premax", int "lumathres", int "lambda", bool "truemotion", int "lsad", int "plevel", bool "mvglobal", float "fs1", float "fs2", float "fs3", float "fs4", bool "prefast", int "prefilter", bool "gpu", bool "premc", string "mode")

Contents

Abstract

Motion compensated noise removal with sharpening.

Description

Motion compensated denoising. Extremely slow, but extremely effective. This script provides a wide array of denoising functions utilizing motion compensated methods and masks. To simplify usage a named parameter strength will set many defaults so you don't have to. Of course they are all override-able should you wish to fine tune and play. Major functions and options include:

  • Denoising (regular, flowed, aggressive and temporal)
  • Sharpening to zero or low motion areas only (Contra, LimitedSharpenFaster and none)
  • Deblocking (with deblock qed)
  • Basic Colorbleed removal
  • Edge cleaning (dering edges)
  • Starfield preservation (Attempts to retain night sky stars, most effective with anim but works for all)
  • Animation mode to work better with edges found in animations / toons.
  • Addnoise adds grain into the dark areas of the video

Required Filters

There are many tools needed to run the script, using them all correctly and in conjunction with one another is part of what the script does for you. Not all of these functions are used every time, some are unique to various special modes that you can apply to your video, so if you want to utilize everything the script offers then you should get all of these tools.

frames int = 2
(1-4) Number of forward and backward frames to search in determining motion vectors as well as what routine will be used to denoise.

 Frames=1  Mvdegrain or Mvcompensate (flow=true)
 Frames=2  Mvdegrain2 or Mvcompensate (flow=true)
 Frames=3  Mvdegrain3 or Mvcompensate (flow=true)
 Frames=4  Mvcompensate only

strength int = 3
(0-6) Collection of presets to make calling the function very easy. See below for what the value set .

pel int = 2
(0,2,4) Accuracy of the motion estimation, 2=1/2 pixel, See MVAnalyse for usage.

search int = 2
(0,1,2,3) Type of search to use for finding motion blocks, See MVAnalyse for usage.

blocksize int = strength
(4,8,16) Default based on strength value, can override the default by passing the blocksize=value. Large blocks are stronger noise removers and faster but can leave artifacts. Compensate with a larger overlap or smaller block. See MVAnalyse to usage.

overlap int = strength
Default based on strength value, can override the default by passing the overlap=value. Lower overlap is faster but can leave artifacts. See MVAnalyse for usage.

thsad int = strength
(0-255) Default based on strength value, can override the default by passing the thsad=value. Higher values tend to increase noise removal lower decrease. To high and you will get artifacts. See MVAnalyse for usage.

pnew int = strength
(0-255) Default based on strength value, can override the default by passing the pnew=value. See MVAnalyse for usage.

dct int = 0
(1,2,3,4,5) Use and change with extreme caution. See MVAnalyse for usage.

thSCD1 int = strength
(0-255) Default based on strength value, can override the default by passing the thSCD1=value. Scene detection threshold. See MVTools for usage.

limit int = strength
(0-255) Default based on strength value, can override the default by passing the limit=value. Used for frames=1,2,3 to limit how much the denoised frame can change from the original frame. See MVDegrain for usage.

thSCD2 int = strength
(0-255) Default based on strength value, can override the default by passing the thSCD2=value. Scene detection threshold. See MVTools for usage.

ml int = strength
(0-255) Default based on strength value, can override the default by passing the ml=value. Higher values lower what is seen as motion, lower decrease what is seen as motion. See MVMask for usage.

chro boolean = false
(true/false) Perform denoising of the luma only (false) or luma and chroma plans (true). True will be MUCH slower.


starfield boolean = false
(true/false) Creates a mask of the frames spots and re inserts them into the denoised frame IF the luma value of the mask is above the thStar threshold. If real noise is getting through increase thStar or if stars are still being removed decrease thStar. Its very sensitive and can cause noise to remain since to a filter a spot is a spot.

thStar float = 0.925
(0-255) Luma threshold for keeping a star mask or discarding it as noise.


anime boolean = false
(true/false) Sets various processing parameters that are good for anime / toon sources ie keeping lines intact, scene change detection, etc. Also turns on a artifact prevention routine for larger blocksizes.


addnoise boolean = false
(true/false) Adds random grain to dark areas of the frame, this can help prevent blocking when the file is encoded. Grain is added to areas with luma below shadow_l and a linear transitions from adding grain to no grain between shadow_l and shadow_h. Above shadow_h no grain is added.

shadow_l int = 24
Low limit for add noise, luma below this value will get grain added.

shadow_w int = 42
High limit for add noise, luma above this value is untouched.


focus boolean = false
(true/false) May or may not help provide a crisp edge where a blurry one exists.


aggressive boolean = true
(true/false) Does a two pass denoising. The first pass is a lite first pass and the second a normal (as specified) noise removal. The style of denoising will be the same for both passes (ie mvdegrain or mvcompensate) Slow but aggressive.


sharpp int = 1
(0,1,2) 1 = Use contra sharpening 2 = Use limited sharpen faster, 0=No sharpening. Sharpening is only applied to the static (non moving) areas of the frame.

ss_x float = 1.25
Passed to limited sharpen faster, this value is a smode=4 value.

ss_y float = 1.25
Passed to limited sharpen faster, this value is a smode=4 value.

lsfstr int = 80
Limitedsharpenfaster strength


removeblocks boolean = false
(true/false) If true initiates a call to deblock_qed with quant1, quant2 and uv as defined below.

quant1 int = 0
Quant1 value for deblock_qed.

quant2 int = 45
Quant2 value for deblock_qed.

uv int = 1
UV value for deblock_qed.


colorbleed boolean = false
(true/false) Removes some level of color bleeding, use if color bleeding is present.


flow boolean = false
(true/false) Used to determine if it will use mvcompensated or mvdegrained noise removal. Each have their strengths and weakness so see what you like. Frames=4 is always flow=true. Flow will create a long temporal clip that it denoises and then it will pull out the cleaned key frame and discard the wing frames.


postprocess boolean = false
(true/false) Option to run a second cleaning operation on the clip. Can be useful if the clip is very noisy. The amount of change is limited to help prevent over smoothing of the image.


preprocess boolean = strength
(true/false) Default based on strength value, can override the default by passing the prepreocess=true/false. Preprocess cleans the input clip so that MVAnalyse can do a better job finding motion and not getting distracted by noise. If the clip is very clean you can set this to false, otherwise leave it true.

premax boolean = false
(true/false) Override strength setting and use full strength preprocessing to improve motion search


temporal boolean = false
(true/false) Turns on temporal processing which can help with videos that have 'dancing' or very heavy grain. Its a special limiting function that prevents mvtools from removing more from and area then what a very strong none motion compensated denoising would.


debug int = 0
Various and cool outputs so you can see what the script is doing, try them all to see what they do.


edgeclean boolean = strength
(true/false) If true will build a conservative edge mask and apply de ringing to those edges. Useful for cleaning up ringing around edges that mvtools can find.

edm_lo int = 55
Low lut threshold for inclusion in the deringing mask, linear gradient between lo and hi.

edm_hi int = 255
High lut threshold for inclusion in the deringing mask, linear gradient between lo and hi.

Strength Presets

Strength 0 1 2 3 4 5 6
BlockSize 8 8 8 16 16 16 16
Overlap 2 0 2 4 8 8 8
Pnew 32 32 32 32 32 32 32
Thsad 100 300 400 425 450 450 500
Thscd 140 400 500 600 600 600 600
Thscd2 Reg/Anime 105/130 105/130 105/130 105/130 105/130 105/130 105/130
ml 130 130 120 110 100 90 90
limit 48 96 102 128 156 225 255
Pre Process false false true true true true true
Post Process false false false false false false true
Edge Clean false false true true true true true
dct Reg/Anime 0/3 0/3 0/3 0/0 0/0 0/0 0/0

Examples

Avisource("Blah.avi")
mc_spuds(frames=2,strength=4)

Links

Download mod : Current version "MC_Spuds()" + "MC_Spudsmod()" (recommended)
Download MC_Spuds.avsi : v1.1- 22.OCT.08
Download MC_Spuds.avs : v0.9c- 23.Mar.08
Download Mirror (broken)

Personal tools