Advertisement
Guest User

BicubicSharp

a guest
Jun 11th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function BicubicSharp(clip c, float "r", float "edges", float "g", float "wg", float "bl", float "str", int "mode", int "bitdepth") {
  3.     # BicubicSharp by Andrew Revvo
  4.     # Requires: HDRCore, HDRSharp, Dither
  5.     # Y8, YV12, YV16, YV24
  6.     #LoadPlugin(WmCore+"\HDRSharp.dll")
  7.     #LoadPlugin(WmCore+"\dither.dll")
  8.     r = default(r, 2.0)+1.0
  9.     r = r<=0 ? 0 : r
  10.     edges = default(edges, 0.5)
  11.     g = default(g, 2.2)
  12.     wg = default(wg, 5.0)
  13.     bl = default(bl, 0.0)
  14.     str = default(str, 0.5)*70
  15.     mode = default(mode, 1)
  16.     bitdepth = default(bitdepth, 8)
  17.     b = c.ConvertToY8().Bitdepth(from=bitdepth, to=88)
  18.     w = b.width()
  19.     h = b.height() / 2
  20.     b = b.Dither_resize16(int(w/r), int(h/r), kernel="bicubic")
  21.     b = b.Dither_resize16(w, h, kernel="bicubic")
  22.     b = b.Bitdepth(from=88, to=16)
  23.     c.UnsharpMask16Y(b, edges=edges, g=g, wg=wg, bl=bl, str=str, mode=mode, bitdepth=bitdepth)
  24. }
  25.  
  26. function BicubicSharp8(clip c, float "r", float "edges", float "g", float "wg", float "bl", float "str", int "mode", int "bitdepth") {
  27.     # BicubicSharp8 by Andrew Revvo
  28.     # Requires: HDRCore, HDRSharp
  29.     # Y8, YV12, YV16, YV24
  30.     #LoadPlugin(WmCore+"\HDRSharp.dll")
  31.     r = default(r, 2.0)+1.0
  32.     r = r<=0 ? 0 : r
  33.     edges = default(edges, 0.5)
  34.     g = default(g, 2.2)
  35.     wg = default(wg, 5.0)
  36.     bl = default(bl, 0.0)
  37.     str = default(str, 0.5)*70
  38.     mode = default(mode, 1)
  39.     bitdepth = default(bitdepth, 8)
  40.     b = c.ConvertToY8().Bitdepth(from=bitdepth, to=8)
  41.     w = b.width()
  42.     h = b.height()
  43.     b = b.BicubicResize(int(w/r), int(h/r))
  44.     b = b.BicubicResize(w, h)
  45.     c.UnsharpMask8Y(b, edges=edges, g=g, wg=wg, bl=bl, str=str, mode=mode, bitdepth=bitdepth)
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement