Thread: Avisynth+
View Single Post
Old 22nd March 2015, 06:50   #1023  |  Link
colours
Registered User
 
colours's Avatar
 
Join Date: Mar 2014
Posts: 308
Quote:
Originally Posted by Boulder View Post
I found out that the very first thing done by my cleaner function is the one that starts acting up.

Code:
reallylongscript
I know this is not very relevant, but I'm seeing a whole lot of optimisation potential there. Not tested, but should produce identical results and be faster.

Code:
function Flux5framesT(clip c,int "th",int "thC",bool "chromamotion")
{
	th  = default(th, 7)
	thC = default(thC, chromamotion ? th : 0)
	med = chromamotion ? ytouv(c.utoy8().median5t(), c.vtoy8().median5t(), c.median5t()) : c.median5t().mergechroma(c)
	avg = c.temporalsoften(2, th, thC, 24, 2)
	output = interleave(c, med, avg).clense(grey=!chromamotion).selectevery(3,1)
	return output
}

function median5t(clip src)
{ # from here
	function min(clip a, clip b) {return mt_logic(a, b, mode="min")}
	function max(clip a, clip b) {return mt_logic(a, b, mode="max")}
	src
	last + trim(framecount()-1,-1).loop(5)
	bcmin = min(SelectEvery(2, -1), SelectEvery(2, 0))
	bcmax = max(SelectEvery(2, -1), SelectEvery(2, 0))
	demin = bcmin.SelectEvery(1, 1)
	demax = bcmax.SelectEvery(1, 1)
	x = max(bcmin, demin)
	y = min(bcmax, demax)
	a = SelectEvery(2, -2)
	f = SelectEvery(2, 3)
	Interleave(a, x, y, f).Clense(grey=true).SelectEvery(4, 1, 2)
	trim(0,length=src.framecount())
}
__________________
Say no to AviSynth 2.5.8 and DirectShowSource!
colours is offline