def do_filter(): """Vapoursynth filtering""" src = JPBD.src_cut src = depth(src, 16) h = 882 w = get_w(h) kernel = 'lanczos' taps = 5 denoise = CoolDegrain(src, tr=1, thsad=24, blksize=8, overlap=4, plane=4) out = denoise luma = get_y(out) descale = kgf.get_descale_filter(kernel, taps=taps)(depth(luma, 32), w, h) upscale = vdf.fsrcnnx_upscale( depth(descale, 16), src.width, src.height, '_assets/shaders/FSRCNNX_x2_56-16-4-1.glsl', partial(core.resize.Bicubic, filter_param_a=0, filter_param_b=0)) out = upscale unwarp = line_darkening(out, 0.275).warp.AWarpSharp2(depth=-2.5) sharp = hvf.LSFmod(unwarp, strength=90, Smode=3, Lmode=1, edgemode=1, edgemaskHQ=True) stabilize = stabilization(out, sharp, 2, 1, 8, 16) out = vdf.merge_chroma(stabilize, denoise) antialias = lvf.sraa(out, 1.4, rep=7, downscaler=core.resize.Bicubic) out = antialias deband_mask = lvf.denoise.detail_mask(out, brz_a=2000, brz_b=1000) deband = dbs.f3kpf(out, 17, 42, 36) deband = core.std.MaskedMerge(deband, out, deband_mask) deband = core.neo_f3kdb.Deband(deband, preset='depth', grainy=24, grainc=18, keep_tv_range=True) out = deband grain = kgf.adaptive_grain(out, 0.2, luma_scaling=14) out = grain rescale_mask = vdf.drm(src, h, kernel, taps, mthr=40, sw=4, sh=4) credit = out credit = lvf.rfs(credit, core.std.MaskedMerge(credit, src, rescale_mask, 0), [(0, 647), (29954, 34046)]) credit = lvf.rfs(credit, src, [(0, 1)]) out = credit return depth(out, 10)
def do_filter(): """Vapoursynth filtering""" src = JPBD.src_cut src = depth(src, 32) src += src[-1] src = core.std.FreezeFrames(src, 3130, 3153, 3129) black = src.std.BlankClip().grain.Add(0.2) src = vdf.fade_filter(src, src, black, 3130, 3154) src = depth(src, 16) h = 882 w = get_w(h) kernel = 'lanczos' taps = 5 opstart, opend = 264, 2421 edstart, edend = 31767, 33924 denoise = CoolDegrain(src, tr=1, thsad=24, blksize=8, overlap=4, plane=4) out = denoise luma = get_y(out) descale = kgf.get_descale_filter(kernel, taps=taps)(depth(luma, 32), w, h) upscale = vdf.fsrcnnx_upscale(depth(descale, 16), src.width, src.height, '_assets/shaders/FSRCNNX_x2_56-16-4-1.glsl', partial(core.resize.Bicubic, filter_param_a=0, filter_param_b=0)) out = upscale unwarp = line_darkening(out, 0.275).warp.AWarpSharp2(depth=-2.5) sharp = hvf.LSFmod(unwarp, strength=90, Smode=3, Lmode=1, edgemode=1, edgemaskHQ=True) stabilize = stabilization(out, sharp, 2, 1, 8, 16) out = vdf.merge_chroma(stabilize, denoise) antialias = lvf.sraa(out, 1.4, rep=7, downscaler=core.resize.Bicubic) out = lvf.rfs(antialias, vdf.merge_chroma(upscale, denoise), [(edstart, edend)]) deband_mask = lvf.denoise.detail_mask(out, brz_a=2000, brz_b=1000) deband = dbs.f3kpf(out, 17, 36, 36) deband_b = dbs.f3kpf(out, 17, 56, 56) deband = lvf.rfs(deband, out, [(3149, 3153)]) deband = lvf.rfs(deband, deband_b, [(30213, 30422)]) deband = core.std.MaskedMerge(deband, out, deband_mask) deband = core.neo_f3kdb.Deband(deband, preset='depth', grainy=24, grainc=18, keep_tv_range=True) out = deband grain = kgf.adaptive_grain(out, 0.2, luma_scaling=14) out = grain rescale_mask = vdf.drm(src, h, kernel, taps, mthr=40, sw=4, sh=4) creditless_mask = core.std.Expr([ vdf.dcm(src, src[opstart:opend+1], JPBD_NCOP.src_cut[:opend-opstart+1], opstart, opend, 2, 2).std.Deflate(), vdf.dcm(src, src[edstart:edend+1], JPBD_NCED.src_cut[:edend-edstart+1], edstart, edend, 2, 2).std.Deflate()], 'x y +') credit = out credit = lvf.rfs(credit, core.std.MaskedMerge(credit, src, rescale_mask, 0), [(opstart+425, opstart+698), (33971, src.num_frames-1)]) credit = lvf.rfs(credit, core.std.MaskedMerge(credit, src, creditless_mask, 0), [(opstart, opend), (edstart, edend)]) credit = lvf.rfs(credit, src, [(7670, 7717), (20824, 20871), (26581, 26628)]) out = credit return depth(out, 10)
def do_filter(): """Vapoursynth filtering""" src = JPBD.src_cut src = depth(src, 16) h = 882 w = get_w(h) kernel = 'lanczos' taps = 5 opstart, opend = 1918, 4076 edstart, edend = 31768, 33925 denoise = CoolDegrain(src, tr=1, thsad=24, blksize=8, overlap=4, plane=4) out = denoise luma = get_y(out) descale = kgf.get_descale_filter(kernel, taps=taps)(depth(luma, 32), w, h) upscale = vdf.fsrcnnx_upscale( depth(descale, 16), src.width, src.height, '_assets/shaders/FSRCNNX_x2_56-16-4-1.glsl', partial(core.resize.Bicubic, filter_param_a=0, filter_param_b=0)) out = upscale import G41Fun as gf from vsTAAmbk import TAAmbk dehalo = gf.MaskedDHA(out, rx=2.8, ry=2.8, darkstr=0.4, brightstr=1.4, maskpull=48, maskpush=140) aaa = TAAmbk(dehalo, 'Eedi3SangNom', cycle=4, mtype=0) aaa = lvf.rfs(out, aaa, [(16052, 16105)]) out = aaa unwarp = line_darkening(out, 0.275).warp.AWarpSharp2(depth=-2.5) sharp = hvf.LSFmod(unwarp, strength=90, Smode=3, Lmode=1, edgemode=1, edgemaskHQ=True) stabilize = stabilization(out, sharp, 2, 1, 8, 16) out = vdf.merge_chroma(stabilize, denoise) antialias = lvf.sraa(out, 1.4, rep=7, downscaler=core.resize.Bicubic) out = lvf.rfs(antialias, vdf.merge_chroma(upscale, denoise), [(edstart, edend)]) deband_mask = lvf.denoise.detail_mask(out, brz_a=2000, brz_b=1000) deband = dbs.f3kpf(out, 17, 36, 36) deband = core.std.MaskedMerge(deband, out, deband_mask) deband = core.neo_f3kdb.Deband(deband, preset='depth', grainy=24, grainc=18, keep_tv_range=True) out = deband grain = kgf.adaptive_grain(out, 0.2, luma_scaling=14) out = grain rescale_mask = vdf.drm(src, h, kernel, taps, mthr=40, sw=4, sh=4) creditless_mask = core.std.Expr([ vdf.dcm(src, src[opstart:opend + 1], JPBD_NCOP.src_cut[:opend - opstart + 1], opstart, opend, 2, 2).std.Deflate(), vdf.dcm(src, src[edstart:edend + 1], JPBD_NCED.src_cut[:edend - edstart + 1], edstart, edend, 2, 2).std.Deflate() ], 'x y +') credit = out credit = lvf.rfs(credit, core.std.MaskedMerge(credit, src, rescale_mask, 0), [(opstart + 425, opstart + 698), (33972, src.num_frames - 1), (21962, 22009)]) credit = lvf.rfs(credit, core.std.MaskedMerge(credit, src, creditless_mask, 0), [(opstart, opend), (edstart, edend)]) credit = lvf.rfs(credit, src, [(5057, 5104), (12371, 12418)]) out = credit return depth(out, 10)
def do_filter(): """Vapoursynth filtering""" src = JPBD.src_cut src = depth(src, 16) h = 882 w = get_w(h) kernel = 'lanczos' taps = 5 opstart, opend = 936, 3092 edstart, edend = 31769, 33926 clip_in = depth(src, 32) dedimm = gf.Tweak(clip_in, sat=1.65, cont=1.65) dedimm = vdf.fade_filter(clip_in, clip_in, dedimm, 26133, 26183) out = depth(dedimm, 16) denoise = CoolDegrain(out, tr=1, thsad=24, blksize=8, overlap=4, plane=4) out = denoise luma = get_y(out) descale = kgf.get_descale_filter(kernel, taps=taps)(depth(luma, 32), w, h) upscale = vdf.fsrcnnx_upscale( depth(descale, 16), src.width, src.height, '_assets/shaders/FSRCNNX_x2_56-16-4-1.glsl', partial(core.resize.Bicubic, filter_param_a=0, filter_param_b=0)) out = upscale unwarp = line_darkening(out, 0.275).warp.AWarpSharp2(depth=-2.5) sharp = hvf.LSFmod(unwarp, strength=90, Smode=3, Lmode=1, edgemode=1, edgemaskHQ=True) stabilize = stabilization(out, sharp, 2, 1, 8, 16) out = vdf.merge_chroma(stabilize, denoise) antialias = lvf.sraa(out, 1.4, rep=7, downscaler=core.resize.Bicubic) out = lvf.rfs(antialias, vdf.merge_chroma(upscale, denoise), [(edstart, edend)]) deband_mask = lvf.denoise.detail_mask(out, brz_a=2000, brz_b=1000) deband = dbs.f3kpf(out, 17, 30, 30) deband = core.std.MaskedMerge(deband, out, deband_mask) deband = core.neo_f3kdb.Deband(deband, preset='depth', grainy=24, grainc=18, keep_tv_range=True) out = deband grain = kgf.adaptive_grain(out, 0.2, luma_scaling=14) out = grain rescale_mask = vdf.drm(src, h, kernel, taps, mthr=40, sw=4, sh=4) creditless_mask = core.std.Expr([ vdf.dcm(src, src[opstart:opend + 1], JPBD_NCOP.src_cut[:opend - opstart + 1], opstart, opend, 2, 2).std.Deflate(), vdf.dcm(src, src[edstart:edend + 1], JPBD_NCED.src_cut[:edend - edstart + 1], edstart, edend, 2, 2).std.Deflate() ], 'x y +') credit = out credit = lvf.rfs(credit, core.std.MaskedMerge(credit, src, rescale_mask, 0), [(opstart + 425, opstart + 698), (33973, src.num_frames - 1)]) credit = lvf.rfs(credit, core.std.MaskedMerge(credit, src, creditless_mask, 0), [(opstart, opend), (edstart, edend)]) credit = lvf.rfs(credit, src, [(16911, 16970), (24486, 24533)]) out = credit return depth(out, 10)