Log in

View Full Version : simple user function


DeathAngelBR
18th March 2014, 18:59
So I want a simple function so I don't have to comment out multiple lines while testing source filters and denoise chains.

I want to convert this:

sourceplugingoeshere(some source)

# all these lines I would have to comment out while testing etc
super = MSuper(pel=2, sharp=1)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
MDegrain1(super, backward_vec1,forward_vec1,thSAD=64)
fft3dgpu(precision=2,bw=16,bh=16,ow=8,oh=8,sigma=0.5,wintype=1)
dither_convert_8_to_16()
dither_resize16(1280,720,kernel="spline64")
smoothgrad()
gradfun3(lsb_in=true,lsb=true,smode=2,mask=3)
dither_out()

Into something like this:

function thatdenoiser(clip c) {

super = c.MSuper(pel=2, sharp=1)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
c.MDegrain1(super, backward_vec1,forward_vec1,thSAD=64)
fft3dgpu(precision=2,bw=16,bh=16,ow=8,oh=8,sigma=0.5,wintype=1)
dither_convert_8_to_16()
dither_resize16(1280,720,kernel="spline64")
smoothgrad()
gradfun3(lsb_in=true,lsb=true,smode=2,mask=3)
dither_out()

}


So the script is like this:

sourceplugingoeshere(some source)

thatdenoiser(last)

Is this correct?

raffriff42
18th March 2014, 19:57
When converting a bunch of statements using assumed Last, it's easy to make a mistake. Here's a little shortcutfunction myfunction (clip C)
{
C ## Last==C!
# (copy+paste your statements here)
# . . .
return Last
}

(BTW don't neglect the power of /* ... */ multi-line comments): /*
a group
of statements (inactive)
*/

a different
group of statements (active)
/*
*/