Untitled
By: a guest | Mar 19th, 2010 | Syntax:
None | Size: 1.12 KB | Hits: 85 | Expires: Never
# CondLI - Conditional Luma Interpolator v 0.55
function LumaInterpolation(clip clp,bool "ym"){
ym=Default(ym,false)
clp
nnedi2(0)
w=width
h=height
c0=last
c1=blackmanresize(w,h*2,taps=8).mt_convolution("0 1 0","0 0 1",u=2,v=2).spline144resize(w,h)
ym? mergeluma(clp,c1) : mergeluma(clp,c0)
return last
}
function CondLI(clip clp,float "thr", float "thrm", float "darkm",bool "ym",bool "show"){
thr=Default(thr,20.0)
thrm=Default(thrm,1.0)
darkm=Default(darkm,1.5)
ym=Default(ym,false)
show=Default(show,false)
sthr=String(thr)
clp
li=LumaInterpolation(ym)
separatefields()
a=selecteven()
b=selectodd()
m=a.FrameEvaluate("condli_k=exp(-log("+string(darkm)+")*AverageLuma()/256)*"+string(darkm))
m=m.mt_lutxy(b,"x y > x y - y x -",u=-128,v=-128)
m.ConditionalFilter(clp,li,"YPlaneMax("+string(thrm)+")*condli_k",">",sthr)
show ? stackvertical(m.ScriptClip("""Subtitle(string(YPlaneMax(""" + String(thrm) + """)*condli_k),20,50)
Subtitle("darkm = """ + String(darkm) + """ / thrm = """ + String(thrm) + """ / thr = """ + String(thr) + """",20,20)"""),clp.subtitle("source"),li.subtitle("interpolated")) : last
}