|
|
Line 1: |
Line 1: |
− | function BlindDeHalo2( clip clp, float "rx", float "ry", int "strength", bool "interlaced" )
| + | #REDIRECT [[BlindDeHalo3]] |
− | | + | |
− | {
| + | |
− | | + | |
− | rx = default( rx, 3.00 )
| + | |
− | | + | |
− | ry = default( ry, 3.00 )
| + | |
− | | + | |
− | strength = default( strength, 125 )
| + | |
− | | + | |
− | interlaced = default( interlaced, false )
| + | |
− | | + | |
− | function m4(float x) {return(x<16?16:int(round(x/4.0))*4)}
| + | |
− | | + | |
− | i = interlaced==false ? clp : clp.separatefields()
| + | |
− | | + | |
− | oxi=i.width
| + | |
− | | + | |
− | oyi=i.height
| + | |
− | | + | |
− | mm2=yv12lutxy(i.expand().blur(.8).expand(),i.inpand.blur(.8).inpand(),yexpr="x y - 2 *")
| + | |
− | | + | |
− | RR=string((rx+ry)/2.0)
| + | |
− | | + | |
− | ST=string(float(strength)/100.0)
| + | |
− | | + | |
− | sm1= i.bicubicresize(m4(oxi/rx),m4(oyi/ry)).bicubicresize(oxi,oyi,1.0,.0)
| + | |
− | | + | |
− | sm1d=yv12lutxy(i,sm1,yexpr="x y - 18 "+ST+" / "+RR+" / / 128 +")
| + | |
− | | + | |
− | sm1d=overlay(sm1d,sm1d,mode="hardlight")
| + | |
− | | + | |
− | clean=yv12lutxy(i,sm1d,yexpr="x y 128 - -").mergechroma(i)
| + | |
− | | + | |
− | clean1=maskedmerge(i,clean,mm2.expand.blur(1.58).expand .levels(32,1.0,255,0,208,false))
| + | |
− | | + | |
− | interlaced?clean1.weave():clean1
| + | |
− | | + | |
− | return last
| + | |
− | | + | |
− | }
| + | |
− | | + | |
− | [[Category:External filters]] | + | |