View Single Post
Old 22nd June 2010, 11:28   #9  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by Boulder View Post
Code:
function RestoreSuper8Frames(clip "clip",bool "show")
Neat idea.
The code shows how messy this sort of thing can be with the standard ScriptClip, etc.
Nowadays it could be written much more simply, using GRunT:
Code:
function RestoreSuper8Frames(clip clip,bool "show")
{
	show= default(show,false)
	blank=BlankClip(clip)
	cf=clip.GreyScale().Blur(1.58,0)
	cc=cf.FieldDeinterlace(threshold=255,dthreshold=dt,map=true).Blur(1.58).Levels(140,1,255,0,255,coring=false)
	f0 = clip.ScriptClip("
	  ip=AverageLuma(cc,-1)  ic=AverageLuma(cc)  in=AverageLuma(cc, 1)
	  return (ip<=ic || in<ic)? blank : last
	", args="cc, blank")
	return((show) ? Overlay(f0,clip,opacity=0.5).Overlay(BilinearResize(cc,clip.Width(),clip.Height()),opacity=0.5,mode="add") : f0)
}
BTW The code you posted is missing the final '}' from the function.
Gavino is offline   Reply With Quote