Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2015
357
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. Function Median2(clip "input_1", clip "input_2", clip "input_3", clip "input_4", clip "input_5", string "chroma")
  2. {# median of 5 clips from Helpers.avs by G-force
  3.  
  4. chroma = default(chroma,"process") #default is "process". Alternates: "copy first" or "copy second"
  5.  
  6. #MEDIAN(i1,i3,i5)
  7. Interleave(input_1,input_3,input_5)
  8. chroma == "process" ? Clense(reduceflicker=false) : Clense(reduceflicker=false,grey=true)
  9. m1 = selectevery(3,1)
  10.  
  11. #MAX(MIN(i1,i3,i5),i2)
  12. m2 = input_1.MT_Logic(input_3,"min",chroma=chroma).MT_Logic(input_5,"min",chroma=chroma).MT_Logic(input_2,"max",chroma=chroma)
  13.  
  14. #MIN(MAX(i1,i3,i5),i4)
  15. m3 = input_1.MT_Logic(input_3,"max",chroma=chroma).MT_Logic(input_5,"max",chroma=chroma).MT_Logic(input_4,"min",chroma=chroma)
  16.  
  17. Interleave(m1,m2,m3)
  18. chroma == "process" ? Clense(reduceflicker=false) : Clense(reduceflicker=false,grey=true)
  19. selectevery(3,1)
  20.  
  21. chroma == "copy first" ? last.MergeChroma(input_1) : chroma == "copy second" ? last.MergeChroma(input_2) : last
  22.  
  23. Return(last)
  24. }
  25. #
  26. function TMedian2(clip c) {
  27. Median2( c.selectevery(1,-2), c.selectevery(1,-1), c, c.selectevery(1,1), c.selectevery(1,2) ) }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement