Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- blankclip(length=25000,width=1920,height=1080,pixel_type="y8")
- function median5t(clip src)
- {
- function min(clip a, clip b) {return mt_logic(a, b, mode="min")}
- function max(clip a, clip b) {return mt_logic(a, b, mode="max")}
- src
- bcmin = min(SelectEvery(2, -1), SelectEvery(2, 0))
- bcmax = max(SelectEvery(2, -1), SelectEvery(2, 0))
- demin = bcmin.SelectEvery(1, 1) # min(SelectEvery(2, 1), SelectEvery(2, 2))
- demax = bcmax.SelectEvery(1, 1) # max(SelectEvery(2, 1), SelectEvery(2, 2))
- x = max(bcmin, demin)
- y = min(bcmax, demax)
- a = SelectEvery(2, -2)
- f = SelectEvery(2, 3)
- Interleave(a, x, y, f).RgTools_Clense().SelectEvery(4, 1, 2)
- }
- function median5t_old(clip src)
- {
- function min(clip a, clip b) {return mt_logic(a, b, mode="min")}
- function max(clip a, clip b) {return mt_logic(a, b, mode="max")}
- src
- a = SelectEvery(1, -2)
- b = SelectEvery(1, -1)
- c = last
- d = SelectEvery(1, 1)
- e = SelectEvery(1, 2)
- x = max(min(a, b), min(c, d))
- y = min(max(a, b), max(c, d))
- Interleave(x, y, e).RgTools_Clense().SelectEvery(3, 1)
- }
- function median5t_gforce(clip src)
- {
- function min(clip a, clip b) {return mt_logic(a, b, mode="min")}
- function max(clip a, clip b) {return mt_logic(a, b, mode="max")}
- src
- i1 = SelectEvery(1, -2)
- i2 = SelectEvery(1, -1)
- i3 = last
- i4 = SelectEvery(1, 1)
- i5 = SelectEvery(1, 2)
- m1 = Interleave(i1, i3, i5).RgTools_Clense().SelectEvery(3, 1)
- m2 = i1.min(i3).min(i5).max(i2)
- m3 = i1.max(i3).max(i5).min(i4)
- return Interleave(m1, m2, m3).RgTools_Clense().SelectEvery(3, 1)
- }
- median5t_gforce()
- SelectEvery(5, 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement