Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- src8 = last
- src16 = src8.U16
- sigma = 4.0
- prenr8 = src8.FFT3DGPU(sigma=sigma*0.8,sigma2=sigma*0.6,sigma3=sigma*0.4,sigma4=sigma*0.2,bw=16,bh=16,ow=8,oh=8,plane=0,bt=1,precision=2)
- nr16 = src16.SMDegrain(lsb_in=false,lsb=true,lsb_out=true,tr=2,Contrasharp=true,RefineMotion=false,plane=0,prefilter=prenr8,
- \thSAD=300,thSADC=150,blksize=16,thSCD1=200,thSCD2=100,Truemotion=false,Chroma=false,limit=2,limitC=1)
- noise = Dither_makediff16(src16, nr16, Y=3, U=2, V=2)
- db = nr16.f3kdb(range=12, Y=40, Cb=0, Cr=0, grainY=0, grainC=0, input_mode=1, output_mode=1)
- dbl = db.Dither_limit_dif16 (nr16, thr=0.25, elast=3.0, Y=3, U=2, V=2)
- dbed = Dither_add16(dbl, noise, Y=3, U=2, V=2, dif=true)
- dbed
- Function Dither_makediff16(clip a, clip b, bool "tv_range", int "Y", int "U", int "V")
- {
- tv_range = Default(tv_range, true)
- Y = Default(Y, 3 )
- U = Default(U, 3 )
- V = Default(V, 3 )
- addend = b.Dither_lut16("65536 x -", Y=Y==3?3:1, U=U==3?3:1, V=V==3?3:1)
- wrap = tv_range ? NOP() : b.Dither_lut16("x 0 == 1 0 ?", Y=Y==3?3:1, U=U==3?3:1, V=V==3?3:1)
- diff = Dither_add16(a, addend, Y=Y==3?3:1, U=U==3?3:1, V=V==3?3:1, dif=true)
- diff = tv_range ? diff : diff.Dither_add16(wrap, Y=Y==3?3:1, U=U==3?3:1, V=V==3?3:1, dif=false)
- diff = ( Y==2 || U==2 || V==2 ) ? mt_lutxy( diff, a, Y=(Y==2?4:2), U=(U==2?4:2), V=(V==2?4:2) ) : diff
- diff = ( Y==4 || U==4 || V==4 ) ? mt_lutxy( diff, b, Y=(Y==4?4:2), U=(U==4?4:2), V=(V==4?4:2) ) : diff
- return ( Y<=0 || U<=0 || V<=0 ) ? diff.Dither_lut16( Y=(Y<=0?Y:2), U=(U<=0?U:2), V=(V<=0?V:2) )
- \ : diff
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement