Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MP_Pipeline("""
- ### platform: win32
- SetMemoryMax(300)
- src="D:\Rurouni Kenshin Shin Kyoto\00000.ts"
- cf = src + ".ffindex"
- #FFIndex(src, cachefile=cf, demuxer="lavf")
- #FFVideoSource(src, cachefile=cf, seekmode=-1, threads=1)
- DSS2(src)
- emask = last.tcanny(sigma=1.2, mode=1, plane=1)
- ### export clip: emask
- ### prefetch: 32,16
- ### lock threads to cores
- ### ###
- ### platform: win32
- SetMemoryMax(1000)
- src = last
- nr = src.MCTD(settings="medium", radius=3, sigma=4, limit=-1, limit2=0, chroma=false, twopass=false, useTTmpSm=false,
- \pp=true, protect=true, deblock=false, useQED=true, enhance=false, GPU=false, fixband=false, sharp=false)
- mask1 = emask.mt_lut("x 3 <= 0 x 3 - 5 << ?",Y=3,U=1,V=1).mt_deflate()
- lumamask1 = src.mt_lut("x 192 > 0 x 96 > 192 x - 1 << 192 ? ?",U=1,V=1).RemoveGrain(19, -1)
- nrmask = mt_logic(mask1,lumamask1,"max")
- mnr = mt_merge(nr,src,nrmask,luma=false,Y=3,U=2,V=2)
- last = mnr
- ### export clip: emask
- ### prefetch: 8,4
- ### lock threads to cores
- ### ###
- SetMemoryMax(500)
- mnr = last
- w = width(mnr)
- h = height(mnr)
- upw4 = Round(w*0.375)*4
- uph4 = Round(h*0.375)*4
- dehalo = mnr.Dehalo_Alpha_mt(darkstr=0.0,brightstr=1.0,rx=1.8,ry=1.8,highsens=100,lowsens=30)
- #aa_clip = dehalo.nnedi3_rpow2(rfactor=2, fwidth=upw4, fheight=upw4, nsize=1, nns=3, qual=2).SangNom(aa=48).TurnRight().SangNom(aa=48).binomialBlur(varY=1.0,varC=1.0,usemmx=true).Spline36Resize(h, w, 0.5, -0.5).TurnLeft()
- aa_clip = dehalo.Spline64Resize(upw4, uph4).Repair(dehalo.GaussResize(upw4, uph4, p=100), 1).SangNom(aa=13).TurnRight().SangNom(aa=13).binomialBlur(varY=0.5,varC=0.5,usemmx=true).Spline36Resize(h, w).TurnLeft()
- #aa_clip = dehalo.eedi2(field=1, mthresh=10, lthresh=20, vthresh=20, maxd=24, nt=50).Spline36Resize(w, h, 0, -0.5).TurnRight().eedi2(field=1, mthresh=10, lthresh=20, vthresh=20, maxd=24, nt=50).Spline36Resize(h, w, 0, -0.5).TurnLeft()
- aa_cs = mt_adddiff(aa_clip, mt_makediff(aa_clip, aa_clip.RemoveGrain(20,11), U=3, V=3).Repair(mt_makediff(mnr, aa_clip, U=3, V=3), 13), U=3,V=3)
- aamask = emask.mt_lut("x 20 < 0 x 20 - 3 << ?", U=1, V=1).mt_deflate()#.RemoveGrain(20, -1)
- aaed = mt_merge(mnr, aa_cs, aamask, luma=true, U=3, V=3 )
- mask2 = emask.mt_lut("x 5 <= 0 x 5 - 4 << ?", U=1, V=1).mt_inflate()
- lumamask2 = aaed.mt_lut("x 160 > 255 x 75 > x 3 * 225 - 0 ? ?",U=1,V=1).RemoveGrain(19, -1)
- dbmask = mt_logic(mask2,lumamask2,"max")
- last = aaed
- ### export clip: dbmask
- ### prefetch: 8,4
- ### lock threads to cores
- ### ###
- SetMemoryMax(1600)
- aaed16 = last.U16
- s_str = 1.2
- s_reverse = s_str + 0.25
- s_divisor = 1.5
- s_indexR = 1.281
- sstring = "x 128 - abs "+String(s_divisor)+" / 1 "+String(s_indexR)+" / ^ "+String(s_str)+" * x 128 - x 128 - abs 0.001 + / * x 128 - 2 ^ x 128 - 2 ^ "+String(s_reverse)+" + / * 128 +"
- pre_nr = RemoveGrain(11, 11).RemoveGrain(4, 4)
- dif_nr = mt_makediff(pre_nr, Y=3, U=3, V=3)
- nr = pre_nr.U16.Dither_resize16(width, height, kernel="Gauss", fh=-1, fv=-1, a1=1)
- noise = makediff16( aaed16, nr, Y=3, U=3, V=3 )
- nrdb16 = nr.GradFun3(thr=0.35, radius=16, smode=2, mask=0, ampn=0, lsb=true, lsb_in=true)
- db16 = Dither_add16( nrdb16, noise, Y=3, U=3, V=3, dif=true)
- db8 = db16.DitherPost(mode=0)
- sharp8 = dif_nr.mt_lut(sstring)
- dif_db = mt_makediff(pre_nr, db8).mt_lut(sstring)
- shfx8 = sharp8.Repair(dif_db, 1, -1)
- shfx8 = mt_lutxy(sharp8, shfx8, "x 128 - abs y 128 - abs < x y ?")
- shfx16 = shfx8.U16
- sharp16 = sharp8.U16.Dither_limit_dif16(shfx8.U16, thr=2.5, U=1, V=1)
- d_lm8 = mt_lutxy(sharp8, shfx8, "x y != 255 0 ?")
- shpFin = shfx16.Dither_merge16_8(sharp16, d_lm8, U=1, V=1)
- dark = db16.Dither_add16(shpFin, Y=3, U=2, V=2, dif=true)
- Dither_merge16_8(dark, aaed16, dbmask, luma=true, U=3, V=3)
- Down10(depth=10,dither=-2,smooth=0,tvrange=true,stack=false)
- """)
- Interleave( DSS2("D:\Rurouni Kenshin Shin Kyoto\00000.ts").Dither_Convert_YUV_TO_RGB(mode=8, ampn=0), last.Dither_Convert_YUV_TO_RGB(mode=8, lsb_in=true, ampn=0))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement