Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AVISource("00a.avi", "00b.avi")
- ConvertToRGB32
- Range( 8432, 13260, Fix_HUD)
- Range(15344, 77760, Fix_HUD)
- p01 = Trim( 0, 349).Simple30 # title screen: "Nintendo"
- p02 = Trim( 350, 387).TASBlend # title screen: monitors
- p03 = Trim( 388, 2157).Simple30 # intro
- p04 = Trim( 2158, 2791).Mother_Brain # intro: Mother Brain
- p05 = Trim( 2792, 7521).Simple30 # intro
- p06 = Trim( 7522, 8239).TASBlend # approaching Space Colony
- p07 = Trim( 8240, 13370).Advanced30 # Space Colony gameplay
- p08 = Trim(13371, 15343).TASBlend # exploding Space Colony and approaching Zebes
- p09 = Trim(15344, 29753).Advanced30 # gameplay
- p10 = Trim(29754, 30101).Simple30 # title screen: "Nintendo"
- p11 = Trim(30102, 30139).TASBlend # title screen: monitors
- p12 = Trim(30140, 30707).Simple30 # copy & load savegame
- p13 = Trim(30708, 68225).Advanced30 # gameplay up to Tourian save station
- p14 = Trim(68226, 68573).Simple30 # title screen: "Nintendo"
- p15 = Trim(68574, 68613).TASBlend # title screen: monitors
- p16 = Trim(68614, 69027).Simple30 # load savegame
- p17 = Trim(69028, 70007).Advanced30 # gameplay up to death
- p18 = Trim(70008, 70495).Simple30 # death and try again
- p19 = Trim(70496, 70545).TASBlend # title screen: monitors
- p20 = Trim(70546, 70931).Simple30 # load savegame
- p21 = Trim(70932, 77761).Advanced30 # gameplay up to last input
- p22 = Trim(77762, 0).Simple30 # extro
- p01+p02+p03+p04+p05+p06+p07+p08+p09+p10+p11+p12+p13+p14+p15+p16+p17+p18+p19+p20+p21+p22
- Trim(0, -45900)
- PointResize(1792, 1344)
- BilinearResize(960, 720)
- ConvertToYV24(chromaresample="point", matrix="PC.601")
- ConvertToYV12(chromaresample="point", matrix="PC.601")
- # ------------------------------------------------------------------------------------------------------------------------------
- function Advanced30(clip c) {
- c
- # TASBlend
- Deblink
- }
- function Fix_HUD(clip c) {
- HUD = c.Crop(0, 0, 0, 31).Crop(0, 1, 0, 0).AddBorders(0, 1, 0, 0)
- Main = c.Crop(0, 31, 0, 0).Crop(0, 1, 0, 0).AddBorders(0, 1, 0, 0)
- StackVertical(HUD, Main)
- }
- function Simple30(clip c) {
- c
- SelectEven
- # Subtitle("SelectEven")
- }
- # ------------------------------------------------------------------------------------------------------------------------------
- function BlendFrames(clip c) {
- # reduces framerate to 1/2 by blending the current frame with the last frame
- Layer(c, BlankClip(c, 1) + c, level=128)
- # Subtitle("BlendFrames")
- }
- function TASBlend(clip c, float "ratio") {
- # reduces framerate to 1/2 but leaves flicker effects partly visible
- # blends frame pairs with alternating opacity (default is 2/3+1/3;1/3+2/3)
- # optional "ratio" is the opacity of the first frame out of the four
- ratio = default(ratio, 2.0 / 3)
- opacity1 = round((1 - ratio) * 257)
- opacity2 = round(( ratio) * 257)
- c
- Interleave(Layer(SelectEvery(4, 0), SelectEvery(4, 1), level=opacity1),
- \ Layer(SelectEvery(4, 2), SelectEvery(4, 3), level=opacity2))
- # Subtitle("TASBlend")
- }
- function Deblink(clip c) {
- # blend on the frame it blinks in and out
- blink1 = c.ng_BlinkMask
- blink2 = MT_Logic(blink1.SelectEvery(1, -1), blink1, mode="or").ConvertToRGB32
- Layer(c, c.Trim(1, 0).Mask(blink2), level=127)
- SelectEven
- # Subtitle("Deblink")
- }
- function ng_BlinkMask(clip c, int "ml") {
- ml = default(ml, 128)
- src = c.ConvertToYV12
- super = MSuper(src, pel=1)
- VecF = MAnalyse(super, isb=false, blksize=4)
- VecB = MAnalyse(super, isb=true , blksize=4)
- MaskF = Mmask(src, VecF, kind=1, ml=ml).MT_Binarize(u=-128, v=-128)
- MaskB = Mmask(src, VecB, kind=1, ml=ml).MT_Binarize(u=-128, v=-128)
- eo0_to = MaskF.SelectEvery(2, 1)
- oe_from = MaskB.SelectEvery(2, 1)
- front = MT_Logic(eo0_to, oe_from, mode="and")
- oe_to = MaskF.SelectEvery(2, 2)
- eo_from = MaskB.SelectEvery(2, 2)
- back = MT_Logic(oe_to, eo_from, mode="and")
- ee_src = src.SelectEven
- ee_super = MSuper(ee_src, pel=1)
- ee_VecF = MAnalyse(ee_super, isb=false, blksize=4)
- ee_VecB = MAnalyse(ee_super, isb=true , blksize=4)
- ee_MaskF = Mmask(ee_src, ee_VecF, kind=1, ml=ml).MT_Binarize(u=-128, v=-128)
- ee_MaskB = Mmask(ee_src, ee_VecB, kind=1, ml=ml).MT_Binarize(u=-128, v=-128)
- ee_to = ee_MaskF.Trim(1, 0)
- ee_from = ee_MaskB
- ee = MT_Logic(ee_to, ee_from, mode="or")
- oo_src = src.SelectOdd
- oo_super = MSuper(oo_src, pel=1)
- oo_VecF = MAnalyse(oo_super, isb=false, blksize=4)
- oo_VecB = MAnalyse(oo_super, isb=true , blksize=4)
- oo_MaskF = Mmask(oo_src, oo_VecF, kind=1, ml=ml).MT_Binarize(u=-128, v=-128)
- oo_MaskB = Mmask(oo_src, oo_VecB, kind=1, ml=ml).MT_Binarize(u=-128, v=-128)
- oo_to = oo_MaskF.trim(1, 0)
- oo_from = oo_MaskB
- oo = MT_Logic(oo_to, oo_from, mode="or")
- # to e0-o1, from o1-e2, nothing e0-e2
- even_blink = MT_Logic(front, ee.MT_Invert, mode="and")
- # to o1-e2, from e2-o3, nothing o1-o3
- odd_blink = MT_Logic(back, oo.MT_Invert, mode="and")
- Interleave(even_blink, odd_blink)
- }
- function Mother_Brain(clip c) {
- c
- ConvertToYV12
- MT_Edge("-1 0 0 0 1 0 0 0 0", thY1=0, thY2=0)
- om1 = SelectEvery(4, -1)
- e0 = SelectEvery(4, 0)
- o1 = SelectEvery(4, 1)
- e2 = SelectEvery(4, 2)
- diff = MT_Logic(e0 , o1, mode="xor")
- s1 = MT_Logic(om1 , o1, mode="xor")
- s2 = MT_Logic(e0 , e2, mode="xor")
- same = MT_Logic(s1 , s2, mode="or" ).MT_Invert
- mask = MT_Logic(diff, same, mode="and").MT_Expand.MT_Expand.MT_Deflate(u=-128, v=-128).ConvertToRGB32
- sm1 = c.SelectEvery(4, -1)
- s0 = c.SelectEvery(4, 0)
- s1 = c.SelectEvery(4, 1)
- s2 = c.SelectEvery(4, 2)
- n0 = Layer(s0, s1.Mask(mask))
- n1 = Layer(s1, s0.Mask(mask))
- Interleave(sm1, n0, n1, s2).Trim(1, 0)
- SelectEven
- # Subtitle("Mother Brain")
- }
- # ------------------------------------------------------------------------------------------------------------------------------
- function Range(clip clip1, int a, int b, clip clip2) {
- # inserts clip2 at a..b; replacement for ApplyRange
- SafeTrim(clip1, 0 , a - 1 ) +\
- SafeTrim(clip2, a , b ) +\
- SafeTrim(clip1, b + 1, clip1.FrameCount - 1)
- }
- function SafeTrim(clip c, int a, int b) {
- # values are clipped to the clip's range; values < 1 have no special meaning
- c
- i = FrameCount - 1
- l = b - a + 1
- a = (a < 0) ? 0 : (a > i) ? i : a
- l = (l < 0) ? 0 : (l > i) ? i : l
- Trim(a, -l)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement