Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th March 2009, 23:33   #21  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Hey ... isn't this the first function posted to public that actually uses MRecalculate? Congrats!

However on thing,
Quote:
Originally Posted by Jawed
It's brutally strong hence thSAD defaulting to 300. You may prefer lower
with my boring little stress test, I could not find that it's "brutally" strong. Seemed more like a halfway failure...

Since the deficiency isn't in the parameters but in the basic methodology, I couldn't let my fingers off and twiddled two small tweaks into that Killer() function. Just one "#" to deactivate a line, and a little sharpen for the source superclip. Nothing spectacular.

> Result sample < (Mediafire, 18 MB)

Is it legit to kill the Killer?
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 28th March 2009, 03:24   #22  |  Link
Jawed
Registered User
 
Join Date: Jan 2008
Location: London
Posts: 156
MRecalculate's nice because with blksize=16 specified it's very similar to blksize 8 but with performance that's somewhat faster.

I suspect you deactivated the final repair. You can try a compromise with mode=1 instead of 17.

I use playback sharpening.

With clips like your test clip (which isn't as noisy as my worst test clips ) I use FizzKiller, which doesn't have the final repair and has a gamma manipulation that makes your blood boil.

Jawed
Jawed is offline   Reply With Quote
Old 28th March 2009, 03:39   #23  |  Link
Sagekilla
x264aholic
 
Join Date: Jul 2007
Location: New York
Posts: 1,752
I had hoped to see some neat new function utilizing MVRecalculate that would provide a jump in quality. But, it seems like it does very little to help most of the time
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame.
Sagekilla is offline   Reply With Quote
Old 17th February 2011, 12:32   #24  |  Link
markanini
Registered User
 
Join Date: Apr 2006
Posts: 299
Quote:
Originally Posted by Didée View Post
Code:
DGDecode_mpeg2source("... .d2v", info=3)
ColorMatrix(hints=true, threads=0)
src = last

SetMTMode (2)

preNR = src.FFT3DFilter( with_appropriate_settings )  # as an example

preNR_super = preNR.MSuper(pel=2, sharp=1)
src_super   = src.MSuper(pel=2, sharp=1, levels=1)

backward_vec2 = MAnalyse(preNR_super, isb = true,  delta = 2, overlap=4)
backward_vec1 = MAnalyse(preNR_super, isb = true,  delta = 1, overlap=4)
forward_vec1  = MAnalyse(preNR_super, isb = false, delta = 1, overlap=4)
forward_vec2  = MAnalyse(preNR_super, isb = false, delta = 2, overlap=4)

src.MDegrain2(src_super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
The prefiltering should be just strong enough to eliminate all noise.
This script works great for me with FFT3DGPU as prefilter whereas TemporalDegrain can't take a change of the pel parameter without breaking. Seems faster as well but it may be my imagination....

Here's my modified version I use just for real-time viewing on sub-SD material(youtube etc). It steals many defualt setting from TemporalDegrain :
Code:
src = last
preNR = src.FFT3dGPu(sigma=16,sigma2=10,sigma3=6,sigma4=4,bw=16,bh=16)
preNR_super = preNR.MSuper(pel=1, sharp=2)
src_super   = src.MSuper(pel=1, sharp=2, levels=1)
backward_vec2 = MAnalyse(preNR_super, isb = true,  delta = 2, overlap=4,blksize=16)
backward_vec1 = MAnalyse(preNR_super, isb = true,  delta = 1, overlap=4,blksize=16)
forward_vec1  = MAnalyse(preNR_super, isb = false, delta = 1, overlap=4,blksize=16)
forward_vec2  = MAnalyse(preNR_super, isb = false, delta = 2, overlap=4,blksize=16)
src.MDegrain2(src_super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=200)
FWIW

Last edited by markanini; 17th February 2011 at 12:35.
markanini is offline   Reply With Quote
Old 17th February 2011, 17:29   #25  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
I'm using RemoveDirtMC for prefiltering.. works very fine on very grainy source.

Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 18th February 2011, 14:13   #26  |  Link
Nephilis
--preset WTF!
 
Join Date: Feb 2009
Posts: 86
If anyone interesting in an advanced RemoveDirtMC, so here is mine Thanx to Kassandro and as always Didée

Look at post no #31

Last edited by Nephilis; 21st February 2011 at 15:23.
Nephilis is offline   Reply With Quote
Old 18th February 2011, 14:48   #27  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Looking at that script, I assume that the results for radius = 1 / 2 / 3 should be pixel-identical. RemoveDirt is working with a temporal radius of 1 frame, nothing else. The additional MCompensate()'s might add to the script's complexity, but they're a NOP for the actual filtering.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 21st February 2011, 13:30   #28  |  Link
Nephilis
--preset WTF!
 
Join Date: Feb 2009
Posts: 86
But "Clense" function in RemoveDirt takes previous, current and the subsequent frame into consideration, doesn't it? (ForwardClense and BackwardClense, too)
And SCSelect function in RemoveDirt takes more than a frame into account, too..
What's your opinion?
Nephilis is offline   Reply With Quote
Old 21st February 2011, 13:57   #29  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
I tried this ...

Code:
source_clip
v1 = RemoveDirtMC_SE(radius=1)
v3 = RemoveDirtMC_SE(radius=3)
diff=mt_makediff(v1,v3,U=3,V=3)
... and analysed the "diff" clip. It contains only one value, Y=128, from 1st to last frame. There is no difference. radius=2/3 is identical to radius=1.

q.e.d. - theory proven by practice.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 21st February 2011, 14:26   #30  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Moreover, there's a bug in the script. The function "RemoveDirt" is called two times, in two different contexts. However, within the RemoveDirt function, you're using Clense with a fixed cache slot:

Clense(input, cache=4)

Which means that the two different instances of RemoveDirt use the same recursion-clip for Clense's recursive operation.

Obviously, this is not correct.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 21st February 2011, 14:46   #31  |  Link
Nephilis
--preset WTF!
 
Join Date: Feb 2009
Posts: 86
Quote:
Originally Posted by Didée View Post
I tried this ...

Code:
source_clip
v1 = RemoveDirtMC_SE(radius=1)
v3 = RemoveDirtMC_SE(radius=3)
diff=mt_makediff(v1,v3,U=3,V=3)
... and analysed the "diff" clip. It contains only one value, Y=128, from 1st to last frame. There is no difference. radius=2/3 is identical to radius=1.

q.e.d. - theory proven by practice.
Quote:
Originally Posted by Didée View Post
Moreover, there's a bug in the script. The function "RemoveDirt" is called two times, in two different contexts. However, within the RemoveDirt function, you're using Clense with a fixed cache slot:

Clense(input, cache=4)

Which means that the two different instances of RemoveDirt use the same recursion-clip for Clense's recursive operation.

Obviously, this is not correct.
Here, removed fixed cache values and redundant compensate stages.

Code:
########################################################################################################################
###                                                                                                                  ###
###                                                   RemoveDirtMC	           			     	     ###
###                                      	                             					     ###
###                                               **SPECIAL EDITION**                                  		     ###
###                                           	      By NEPHILIS	                                             ###
###                                                      @2011                                      		     ###
###                                                                                                                  ###
########################################################################################################################

##########################################################
##						   	##
## Requirements     : - MVTools      (v2.5.11.1)	##
## -----------------  - Masktools    (v2.0a48)	   	##
##		      - RemoveGrainT (v1.0) package 	##
##		      - RemoveDirt   (v0.9) package	##
##		      - AvsRecursion (v0.2) 		##
##		      - FluxSmooth   (v1.1) 	        ##
##		    					##
##########################################################

########################################################################################################################
#													   	       #
# Usage     : RemoveDirtMC_SE(clip input, int"radius", int"repmode", int"clmode",\                                     #
# ----------                              bool"TwoPassDeNoise", int"thSAD", int"thSADC")			       #
# 		                           			                                                       #
#													   	       #
########################################################################################################################

#################	
# ------------- #
# PARAMETERS  	#
# ------------- #
#################

#######################################################################################################################
#
# ----------
# Radius    : -- Temporal Radius for MDeGrain at second stage DeNoising.
# ----------
#
# ----------
# repmode   : -- RemoveDirt's "repmode" parameter.
# ----------     
#
# ----------
# clmode    : -- RemoveGrain's "mode" parameter in RemoveDirt function.
# ----------
#
# ----------
# Twopass
# Denoise   : -- To make a Temporal Denoising (MDeGrain) after Spatial Denoising.   
# ----------   
# 
# ----------
# thSAD, 
# thSADC    : -- MDeGrain's thSAD and thSADC parameters.
# ---------- 
#
#######################################################################################################################


Function RemoveDirtMC_SE(clip input, int"radius", int"repmode", int"clmode", bool"TwoPassDeNoise", int"thSAD", int"thSADC")

{
    
 radius = default(radius,    2)
repmode = default(repmode,  16)
 clmode = default(clmode,    5)
TwoPassDeNoise = default(TwoPassDeNoise, false)
 thSAD = default(thSAD ,   250)
thSADC = default(thSADC, thSAD)
    
     ox = input.width()
     oy = input.height()
     HD = (ox== 1920 || oy>= 800) ? true : false
blksize = (HD==true) ? 16:8
 search = (HD==true) ?  4:5
overlap = blksize/2

        src = input
      PreNR = input.RemoveDirt().TemporalDeGrain(5,8)
PreNR_super = MSuper(PreNR,hpad=4,vpad=4,pel=2,sharp=2)
  src_super = MSuper(input,hpad=4,vpad=4,pel=2,sharp=2,levels=1)

 bwv1 = MAnalyse(PreNR_super, blksize=blksize, search=search, isb=true,  delta=1, overlap=overlap, truemotion=true) 
 bwv2 = (TwoPassDeNoise==true && radius>=2) ? \
	MAnalyse(PreNR_super, blksize=blksize, search=search, isb=true,  delta=2, overlap=overlap, truemotion=true) : BlankClip()
 bwv3 = (TwoPassDeNoise==true && radius==3) ? \
	MAnalyse(PreNR_super, blksize=blksize, search=search, isb=true,  delta=3, overlap=overlap, truemotion=true) : BlankClip()
 fwv1 = MAnalyse(PreNR_super, blksize=blksize, search=search, isb=false, delta=1, overlap=overlap, truemotion=true) 
 fwv2 = (TwoPassDeNoise==true && radius>=2) ? \
	MAnalyse(PreNR_super, blksize=blksize, search=search, isb=false, delta=2, overlap=overlap, truemotion=true) : BlankClip()
 fwv3 = (TwoPassDeNoise==true && radius==3) ? \
	MAnalyse(PreNR_super, blksize=blksize, search=search, isb=false, delta=3, overlap=overlap, truemotion=true) : BlankClip()

 b1comp = MCompensate(input,src_super,bwv1) 
 f1comp = MCompensate(input,src_super,fwv1)

  int = interleave(f1comp, input, b1comp)
   
   NR = int.RemoveDirt(repmode=repmode, clmode=clmode)
 sum1 = SelectEvery(NR,3,1)
 sum1_super = ( TwoPassDeNoise==true  ) ? MSuper(sum1,hpad=4,vpad=4,pel=2,sharp=2,levels=1) : BlankClip()
       sum2 = ( TwoPassDeNoise==false ) ? sum1 
	\   : (  radius==1  ) ? MDeGrain1(sum1, sum1_super, bwv1, fwv1, thSAD=thSAD, thSADC=thSADC)
	\   : (  radius==2  ) ? MDeGrain2(sum1, sum1_super, bwv1, bwv2, fwv1, fwv2, thSAD=thSAD, thSADC=thSADC)
 	\   : 			MDeGrain3(sum1, sum1_super, bwv1, bwv2, bwv3, fwv1, fwv2, fwv3, thSAD=thSAD, thSADC=thSADC)
Return (sum2)

}


function TemporalDeGrain(clip input, int "mode", int "thr")

{
	rg = RemoveGrain(input, mode=mode)
	tr = TemporalRepair(rg, input)
             FluxSmoothT(tr,thr)
	 
}


function RemoveDirt(clip input, int "repmode", int "clmode") 

{
      
	repmode = default(repmode, 16)
	clmode  = default(clmode,   5)
	clensed = Clense(input)
	sbegin  = ForwardClense(input)
	send = BackwardClense(input)
	alt = Repair(SCSelect(input, sbegin, send, clensed, debug=false), input, mode=repmode) 
	restore = Repair(clensed, input, mode=repmode)
	corrected = RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=50, dist=1,\
	dmode=2, debug=false, noise=8, noisy=12)
	RemoveGrain(corrected, mode=clmode)
	
}
Nephilis is offline   Reply With Quote
Old 21st February 2011, 15:14   #32  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
To bring theory to a full circle:

Actually, there is one case where the additional compensations potentially can make a difference: it's around scenechanges, because SCselect - as you noted correctly - considers more than +/-1 temporal neighbors.

(And indeed .... checking with another test sequence, I found 1 occasion where a slight difference comes up: in the frame right before an unrelated one-frame-flash.)

But then, it's not guaranteed that the difference is a "good one" - it could be even worse. SCselect is quite robust without motion comensation. When it's faced with an interleaved compensated sequence, then the problem is that MCompensate (per default) uses no scenechange detection. Therefore MCompensate will try to match as good as possible across scenechanges (i.e. make the compensation from the not-correlated neighbor scene as similar as possible to the current reference frame). And therefore, chances are that motion compensation rather hurts SCselect's scenechange detection, instead of helping.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 21st February 2011, 15:34   #33  |  Link
Nephilis
--preset WTF!
 
Join Date: Feb 2009
Posts: 86
Quote:
Originally Posted by Didée View Post
.. And therefore, chances are that motion compensation rather hurts SCselect's scenechange detection, instead of helping.
Does help adding MSCDetection function before the compensation stage in the script to fix this problem?
Nephilis is offline   Reply With Quote
Old 21st February 2011, 16:02   #34  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
MSCDetection is "only" producing a B/W mask for custom usage. On it's own, it does nothing.

From the guts, my trust in SCselect (without any mocomp stuff fiddled in) is bigger than in MVTools' scenechange detection. If e.g. one (very dark scene with few features) changes to another (very dark scene with few features), MVTools will fail because in last instances it uses static thresholds. SCSelect acts dynamically, adapting it's detection to what "currently is really happening."
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 21st February 2011, 16:39   #35  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Instead of this:

Code:
[...]

  int = (radius==1) ? interleave(                f1comp, input, b1comp                )
   \  : (radius==2) ? interleave(        f2comp, f1comp, input, b1comp, b2comp        )
   \  :               interleave(f1comp, f2comp, f1comp, input, b1comp, b2comp, b3comp)
   
   NR = int.RemoveDirt(repmode=repmode, clmode=clmode)
 sum1 = SelectEvery(NR,1+radius*2,radius)

[...]

function RemoveDirt(clip input, int "repmode", int "clmode") 
{
	repmode = default(repmode, 16)
	clmode  = default(clmode,   5)
	clensed = Clense(input, cache=4)
	sbegin  = ForwardClense(input, cache=-1)
	send = BackwardClense(input, cache=-1)
	alt = Repair(SCSelect(input, sbegin, send, clensed, debug=false), input, mode=repmode) 
	restore = Repair(clensed, input, mode=repmode)
	corrected = RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=50, dist=1,\
	dmode=2, debug=false, noise=8, noisy=12)
	RemoveGrain(corrected, mode=clmode)
}
... I'd try to make it work more or less like this:

Code:
#  int = (radius==1) ? interleave(                f1comp, input, b1comp                )
#   \  : (radius==2) ? interleave(        f2comp, f1comp, input, b1comp, b2comp        )
#   \  :               interleave(f1comp, f2comp, f1comp, input, b1comp, b2comp, b3comp)
   
   NR = input.RemoveDirtX(f1comp,b1comp, repmode=repmode, clmode=clmode)
 sum1 = NR

[...]

function RemoveDirtX(clip input, clip fcomp, clip bcomp, int "repmode", int "clmode") 
{
	repmode = default(repmode, 16)
	clmode  = default(clmode,   5)
	clensed = interleave(fcomp,input,bcomp).Clense(cache=-1).selectevery(3,1)
	sbegin  = ForwardClense(input, cache=-1)
	send = BackwardClense(input, cache=-1)
	alt = Repair(SCSelect(input, sbegin, send, clensed, debug=false), input, mode=repmode) 
	restore = Repair(clensed, input, mode=repmode)
	corrected = RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=50, dist=1,\
	dmode=2, debug=false, noise=8, noisy=12)
	RemoveGrain(corrected, mode=clmode)
}
I'm not completely sure ATM, because I forgot the rationale behind "ForwardClense"/"BackwardClense", and can't find it quickly now. Clense is a median filter, but you can't calculate a median from only two elements. Therefore I don't see right now what these two special-clenses are actually doing.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 21st February 2011, 16:57   #36  |  Link
Nephilis
--preset WTF!
 
Join Date: Feb 2009
Posts: 86
From RemoveGrain document:
Beginning with version 0.9 there are also the filters BackwardClense and ForwardClense. They are primarily for clensing at sharp scene changes in the RemoveDirt script function. ForwardClense is for the first frame of a new scene and BackwardClense is for the last frame of a scene. The usage is the same as Clense.
Nephilis is offline   Reply With Quote
Old 21st February 2011, 17:12   #37  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
Yes, that I can read, too. It explains exactly nothing.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 16th March 2011, 12:08   #38  |  Link
Nephilis
--preset WTF!
 
Join Date: Feb 2009
Posts: 86
Hi, here is a new version of RemoveDirtMC..

by..

Code:
########################################################################################################################
###                                                                                                                  ###
###                                                   RemoveDirtMC	           			     	     ###
###                                      	         v1.1                    				     ###
###                                               **SPECIAL EDITION**                                  		     ###
###                                           	      By NEPHILIS	                                             ###
###                                                      @2011                                      		     ###
###                                                                                                                  ###
########################################################################################################################

###########################################################
##							 ##
## Requirements : - MVTools      (v2.5.11.0)		 ##
## -------------  - Masktools    (v2.0a48)		 ##
##		  - RemoveGrainT (v1.0) package 	 ##
##		  - RemoveDirt   (v0.9) package		 ##
##		  - AvsRecursion (v0.2) 		 ##
##		  - FluxSmooth   (v1.1)			 ##
##		  - NLMeansCL package			 ##
##		    (AvsFilterNet.dll, Cloo.dll,	 ##
##		     NLMeansCL_netautoload.dll)		 ##
##		  - NVIDIA GeForce 8 series or newer VGA ##
##							 ##
###########################################################

########################################################################################################################
#													   	       #
# Usage : RemoveDirtMC_SE(clip input,int"radius",int"repmode",int"clmode",bool"TwoPass",int"thSAD",int"thSADC" )       #
# ------		                           			                                               #
#													   	       #
########################################################################################################################

#################
# ------------- #
# PARAMETERS  	#
# ------------- #
#################

#######################################################################################################################
#
# ----------
# Radius    : -- Temporal Radius for MDeGrain at second stage DeNoising.
# ----------
#
# ----------
# repmode   : -- Repair mode value in main RemoveDirtSE function.
# ----------     
#
# ----------
# clmode    : -- RemoveGrain mode value in main RemoveDirtSE function.
# ----------
#
# ----------
# Twopass   : -- To make a Temporal Denoising (MDeGrain) after Spatial Denoising (RemoveDirtSE).   
# ----------   
#
# ----------
# thSAD, 
# thSADC    : -- MDeGrain's thSAD and thSADC parameters.
# ---------- 
#
#######################################################################################################################

Function RemoveDirtMC_SE(clip input, int"radius", int"repmode", int"clmode", bool"TwoPass", int"thSAD", int"thSADC")

{

version  = "v1.1"

  radius = default(radius,     2)
 repmode = default(repmode,   16)
  clmode = default(clmode,     5)
 TwoPass = default(TwoPass, true)
   thSAD = default(thSAD ,   150)
  thSADC = default(thSADC, thSAD)
    
      ox = input.width()
      oy = input.height()
      HD = (ox== 1920 || oy>= 800) ? true : false
 blksize = (HD==true) ? 16:8
  search = (HD==true) ?  4:5
 overlap = blksize/2

         src = input
       PreNR = src.NLMeansCL(h=radius*1.5,plane=4).TemporalDeGrain()
 PreNR_super = MSuper(PreNR,hpad=4,vpad=4,pel=2,sharp=2)
   src_super = MSuper(src  ,hpad=4,vpad=4,pel=2,sharp=2,levels=1)

 bwv1 = MAnalyse(PreNR_super, blksize=blksize, search=search, isb=true,  delta=1, overlap=overlap, truemotion=true) 
 bwv2 = (radius>=2) ? \
	MAnalyse(PreNR_super, blksize=blksize, search=search, isb=true,  delta=2, overlap=overlap, truemotion=true) : BlankClip()
 bwv3 = (radius==3) ? \
	MAnalyse(PreNR_super, blksize=blksize, search=search, isb=true,  delta=3, overlap=overlap, truemotion=true) : BlankClip()
 fwv1 = MAnalyse(PreNR_super, blksize=blksize, search=search, isb=false, delta=1, overlap=overlap, truemotion=true) 
 fwv2 = (radius>=2) ? \
	MAnalyse(PreNR_super, blksize=blksize, search=search, isb=false, delta=2, overlap=overlap, truemotion=true) : BlankClip()
 fwv3 = (radius==3) ? \
	MAnalyse(PreNR_super, blksize=blksize, search=search, isb=false, delta=3, overlap=overlap, truemotion=true) : BlankClip()

 bcomp = MCompensate(src,src_super,bwv1) 
 fcomp = MCompensate(src,src_super,fwv1)
  
 NR1 = src.RemoveDirtSE(fcomp, bcomp, repmode=repmode, clmode=clmode)
 NR1_super = ( TwoPass==true  ) ? MSuper(NR1,hpad=4,vpad=4,pel=2,sharp=2,levels=1) : BlankClip()
       NR2 = ( TwoPass==false ) ? NR1
\   	   : (  radius==1  ) ? MDeGrain1(NR1, NR1_super, bwv1, fwv1, thSAD=thSAD, thSADC=thSADC)
\   	   : (  radius==2  ) ? MDeGrain2(NR1, NR1_super, bwv1, bwv2, fwv1, fwv2, thSAD=thSAD, thSADC=thSADC)
\   	   : 		       MDeGrain3(NR1, NR1_super, bwv1, bwv2, bwv3, fwv1, fwv2, fwv3, thSAD=thSAD, thSADC=thSADC)
 Return (NR2)

}

function TemporalDeGrain(clip input, int "mode", int "thr")

{
	mode = default(mode, 5)
	thr  = default(thr,  8)
	rg = RemoveGrain(input, mode=mode)
	tr = TemporalRepair(rg, input)
        fs = FluxSmoothT(tr,thr)
	Return(fs)
	 
}

function RemoveDirtSE(clip input, clip fcomp, clip bcomp, int "repmode", int "clmode")

{
      
	repmode = default(repmode, 16)
	clmode  = default(clmode,   5)
	clensed = interleave(fcomp,input,bcomp).Clense(cache=-1).selectevery(3,1)
	sbegin  = ForwardClense(input, cache=-1)
	send   = BackwardClense(input, cache=-1)
	alt = Repair(SCSelect(input, sbegin, send, clensed, debug=false), input, mode=repmode) 
	restore = Repair(clensed, input, mode=repmode)
	corrected = RestoreMotionBlocks(clensed, restore, neighbour=input, alternative=alt, gmthreshold=50, dist=1,\
	dmode=2, debug=false, noise=8, noisy=12)
	postNR = RemoveGrain(corrected, mode=clmode)
	Return(postNR)
	
}

Last edited by Nephilis; 16th March 2011 at 14:02. Reason: syntax error
Nephilis is offline   Reply With Quote
Old 24th March 2011, 21:24   #39  |  Link
GRKNGLR
Registered User
 
Join Date: Feb 2009
Posts: 30
Good work Nephilis.
GRKNGLR is offline   Reply With Quote
Old 27th June 2011, 19:22   #40  |  Link
Gerry62
TV Guy
 
Join Date: Jun 2011
Posts: 46
Quote:
Originally Posted by Nephilis View Post
Hi, here is a new version of RemoveDirtMC..

Thanks for posting The script Nephilis, Just tested it on some shonky tatty 16mm Kine's, And they are vvveerryy Grainy, script works too well in fact and I need to do some tinkering,
This sample explains the kind of grain I mean!
http://www.megaupload.com/?d=BA654JB8

The point of my post is the subtle
NLMeansCL package
in ver1.1 of your Mighty script.

Now im only learning, but I cannot see any reference to where I would use this NLMeansCL in your new version, Id love to, as when I did some tests with NLmeansCl, I doubled my speed, 1-2fps to 5fps. So its a MASSIVE improvement in what I'm normally processing, How would I use the CL function with Ver1.1?

Excuse me if this sounds stupid, I do read all the posts and spend a couple of hours trying all the 'switches' to see what happens, I'm not one of those who wants people to do his work, Then Id learn nothing, and what's the fun in that.
although saying that, its probably staring me in the eye!
Gerry62 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:54.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.