Advertisement
torchlight

median5t benchmark avs

Apr 23rd, 2014
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. blankclip(length=25000,width=1920,height=1080,pixel_type="y8")
  2.  
  3. function median5t(clip src)
  4. {
  5.     function min(clip a, clip b) {return mt_logic(a, b, mode="min")}
  6.     function max(clip a, clip b) {return mt_logic(a, b, mode="max")}
  7.     src
  8.     bcmin = min(SelectEvery(2, -1), SelectEvery(2, 0))
  9.     bcmax = max(SelectEvery(2, -1), SelectEvery(2, 0))
  10.     demin = bcmin.SelectEvery(1, 1) # min(SelectEvery(2, 1), SelectEvery(2, 2))
  11.     demax = bcmax.SelectEvery(1, 1) # max(SelectEvery(2, 1), SelectEvery(2, 2))
  12.     x = max(bcmin, demin)
  13.     y = min(bcmax, demax)
  14.     a = SelectEvery(2, -2)
  15.     f = SelectEvery(2, 3)
  16.     Interleave(a, x, y, f).RgTools_Clense().SelectEvery(4, 1, 2)
  17. }
  18.  
  19. function median5t_old(clip src)
  20. {
  21.     function min(clip a, clip b) {return mt_logic(a, b, mode="min")}
  22.     function max(clip a, clip b) {return mt_logic(a, b, mode="max")}
  23.     src
  24.     a = SelectEvery(1, -2)
  25.     b = SelectEvery(1, -1)
  26.     c = last
  27.     d = SelectEvery(1, 1)
  28.     e = SelectEvery(1, 2)
  29.     x = max(min(a, b), min(c, d))
  30.     y = min(max(a, b), max(c, d))
  31.     Interleave(x, y, e).RgTools_Clense().SelectEvery(3, 1)
  32. }
  33.  
  34. function median5t_gforce(clip src)
  35. {
  36.     function min(clip a, clip b) {return mt_logic(a, b, mode="min")}
  37.     function max(clip a, clip b) {return mt_logic(a, b, mode="max")}
  38.     src
  39.     i1 = SelectEvery(1, -2)
  40.     i2 = SelectEvery(1, -1)
  41.     i3 = last
  42.     i4 = SelectEvery(1, 1)
  43.     i5 = SelectEvery(1, 2)
  44.     m1 = Interleave(i1, i3, i5).RgTools_Clense().SelectEvery(3, 1)
  45.     m2 = i1.min(i3).min(i5).max(i2)
  46.     m3 = i1.max(i3).max(i5).min(i4)
  47.     return Interleave(m1, m2, m3).RgTools_Clense().SelectEvery(3, 1)
  48. }
  49.  
  50. median5t_gforce()
  51. SelectEvery(5, 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement