Advertisement
mawen1250

limited f3kdb deband

Jul 10th, 2012
898
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. src8    = last
  2. src16   = src8.U16
  3.  
  4. sigma   = 4.0
  5. 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)
  6. nr16    = src16.SMDegrain(lsb_in=false,lsb=true,lsb_out=true,tr=2,Contrasharp=true,RefineMotion=false,plane=0,prefilter=prenr8,
  7. \thSAD=300,thSADC=150,blksize=16,thSCD1=200,thSCD2=100,Truemotion=false,Chroma=false,limit=2,limitC=1)
  8. noise   = Dither_makediff16(src16, nr16, Y=3, U=2, V=2)
  9.  
  10. db      = nr16.f3kdb(range=12, Y=40, Cb=0, Cr=0, grainY=0, grainC=0, input_mode=1, output_mode=1)
  11. dbl     = db.Dither_limit_dif16 (nr16, thr=0.25, elast=3.0, Y=3, U=2, V=2)
  12. dbed    = Dither_add16(dbl, noise, Y=3, U=2, V=2, dif=true)
  13.  
  14. dbed
  15.  
  16.  
  17.  
  18. Function Dither_makediff16(clip a, clip b, bool "tv_range", int "Y", int "U", int "V")
  19. {
  20.   tv_range = Default(tv_range, true)
  21.   Y        = Default(Y,        3   )
  22.   U        = Default(U,        3   )
  23.   V        = Default(V,        3   )
  24.  
  25.   addend = b.Dither_lut16("65536 x -", Y=Y==3?3:1, U=U==3?3:1, V=V==3?3:1)
  26.   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)
  27.  
  28.   diff = Dither_add16(a, addend, Y=Y==3?3:1, U=U==3?3:1, V=V==3?3:1, dif=true)
  29.   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)
  30.  
  31.   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
  32.   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
  33.  
  34.   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) )
  35.   \                               : diff
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement