@@ -3,23 +3,32 @@ import sys
33import havsfunc as haf
44import mvsfunc as mvf
55
6- core = vs.get_core(threads=8 )
6+ core = vs.get_core(threads=12 )
77
8- core.max_cache_size = 4000
8+ core.max_cache_size = 9000
99
1010#OKE:INPUTFILE
11- a="00000 .m2ts"
11+ a="00001 .m2ts"
1212src8 = core.lsmas.LWLibavSource(a)
1313src16 = core.fmtc.bitdepth(src8,bits=16)
1414
15- down = core.fmtc.resample(src16, 1280, 720)
16- res = down
15+ gray = core.std.ShufflePlanes(src16, 0, colorfamily=vs.GRAY)
16+ gray = core.fmtc.transfer(gray,transs="709",transd="linear")
17+ gray = core.fmtc.resample(gray,1280,720)
18+ gray = core.fmtc.transfer(gray,transs="linear",transd="709")
19+ UV = core.fmtc.resample(src16,1280,720)
20+ down = core.std.ShufflePlanes([gray,UV],[0,1,2], vs.YUV)
1721
18- #OKE:DEBUG
19- Debug = 1
20- if Debug:
21- res= core.std.Interleave([down, res] )
22- res= mvf.ToRGB(res,full=False,depth=8)
23- else: res = core.fmtc.bitdepth(res,bits=10 )
22+ nr16 = core.knlm.KNLMeansCL(down,device_type="GPU",h=0.6,s=3,d=1,a=2,channels="Y")
23+ noise16 = core.std.MakeDiff(down,nr16,0)
24+ dbed = core.f3kdb.Deband(nr16, 8,48,48,48,0,0,output_depth=16)
25+ dbed = core.f3kdb.Deband(dbed,16,32,32,32,0,0,output_depth=16 )
26+ dbed = mvf.LimitFilter(dbed,nr16,thr=0.5,thrc=0.4,elast=1.5)
27+ dbed = core.std.MergeDiff(dbed,noise16,0 )
2428
25- res.set_output()
29+
30+ bright = mvf.Depth(dbed,8,dither=1)
31+ dark = mvf.Depth(dbed,8,dither=0,ampo=1.5)
32+ res = core.std.MaskedMerge(dark, bright, core.std.Binarize(bright, 128, planes=0), first_plane=True)
33+
34+ res.set_output(0)
0 commit comments