示例#1
0
def do_filter():
    """Vapoursynth filtering"""
    src = JPBD.src_cut
    src = depth(src, 16)
    out = src

    h = 720
    w = get_w(h)

    fixedges = awf.bbmod(out, 2, 2, 2, 2, 64 << 8, 999)
    out = fixedges

    decomb = hvf.Vinverse(out)
    decomb = lvf.rfs(out, decomb, [(828, 836)])
    out = decomb

    clean = core.knlm.KNLMeansCL(out,
                                 h=0.55,
                                 a=2,
                                 d=3,
                                 device_type='gpu',
                                 device_id=0,
                                 channels='UV')
    clean = core.knlm.KNLMeansCL(clean,
                                 h=0.55,
                                 a=2,
                                 d=3,
                                 device_type='gpu',
                                 device_id=0,
                                 channels='Y')
    diff_den = core.std.MakeDiff(out, clean)
    out = depth(clean, 32)

    luma = get_y(out)
    line_mask = vdf.edge_detect(luma, 'FDOG', 0.05, (1, 1))

    descale = core.descale.Debilinear(luma, w, h)
    upscale = vdf.nnedi3_upscale(descale, correct_shift=False,
                                 pscrn=1).resize.Bicubic(src.width,
                                                         src.height,
                                                         src_left=.5,
                                                         src_top=.5)
    rescale = core.std.MaskedMerge(luma, upscale, line_mask)

    merged = vdf.merge_chroma(rescale, out)
    out = depth(merged, 16)

    moozzi = warping(out, 0.4, 4)
    sharp = hvf.LSFmod(moozzi,
                       strength=95,
                       Smode=3,
                       Lmode=1,
                       edgemode=1,
                       edgemaskHQ=True)
    out = sharp

    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)
    out = deband

    grain_org = core.std.MergeDiff(out, diff_den)
    out = grain_org

    ref = decomb
    credit_mask = vdf.diff_rescale_mask(ref, mthr=40, sw=5, sh=5)
    credit_mask = vdf.region_mask(credit_mask, 10, 10, 10,
                                  10).std.Inflate().std.Inflate()
    credit = lvf.rfs(out, core.std.MaskedMerge(out, ref, credit_mask),
                     [(0, 725), (31741, 33864)])
    antialias = lvf.sraa(ref, 2, 13, downscaler=core.resize.Bicubic)
    credit = lvf.rfs(credit, core.std.MaskedMerge(out, antialias, credit_mask),
                     [(833, 933), (1060, 1229), (1716, 1887), (2665, 2830),
                      (4813, 4947), (8179, 8272), (13757, 13810),
                      (20630, 20737), (20866, 20951), (21338, 21409),
                      (21480, 21520), (24719, 24786), (24829, 24869),
                      (28206, 28298), (28299, 28426), (33927, 34046)])
    out = credit

    return depth(out, 10)
示例#2
0
def do_filter():
    """Vapoursynth filtering"""
    src = JPBD.src_cut
    src = depth(src, 16)
    out = src
    opstart, opend = 3106, 5263
    h = 720
    w = get_w(h)

    fixedges = awf.bbmod(out, 2, 2, 2, 2, 64 << 8, 999)
    out = fixedges

    decomb = hvf.Vinverse(out)
    decomb = lvf.rfs(out, decomb, [(10171, 10179)])
    ref = decomb
    out = decomb

    clean = core.knlm.KNLMeansCL(out,
                                 h=0.55,
                                 a=2,
                                 d=3,
                                 device_type='gpu',
                                 device_id=0,
                                 channels='UV')
    clean = core.knlm.KNLMeansCL(clean,
                                 h=0.55,
                                 a=2,
                                 d=3,
                                 device_type='gpu',
                                 device_id=0,
                                 channels='Y')
    diff_den = core.std.MakeDiff(out, clean)
    out = depth(clean, 32)

    luma = get_y(out)
    line_mask = vdf.edge_detect(luma, 'FDOG', 0.05, (1, 1))

    descale = core.descale.Debilinear(luma, w, h)
    upscale = vdf.nnedi3_upscale(descale, correct_shift=False,
                                 pscrn=1).resize.Bicubic(src.width,
                                                         src.height,
                                                         src_left=.5,
                                                         src_top=.5)
    rescale = core.std.MaskedMerge(luma, upscale, line_mask)

    merged = vdf.merge_chroma(rescale, out)
    out = depth(merged, 16)

    moozzi = warping(out, 0.4, 4)
    sharp = hvf.LSFmod(moozzi,
                       strength=95,
                       Smode=3,
                       Lmode=1,
                       edgemode=1,
                       edgemaskHQ=True)
    out = sharp

    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)
    out = deband

    grain_org = core.std.MergeDiff(out, diff_den)
    out = grain_org

    credit_mask = vdf.diff_rescale_mask(ref, mthr=40, sw=5, sh=5)
    credit_mask = vdf.region_mask(credit_mask, 10, 10, 10,
                                  10).std.Inflate().std.Inflate()
    antialias = lvf.sraa(ref, 2, 13, downscaler=core.resize.Bicubic)
    credit = lvf.rfs(out, core.std.MaskedMerge(out, antialias, credit_mask),
                     [(10178, 10248), (21423, 22764)])

    out = credit

    src_c, ncop = [clip.std.Median() for clip in [src, JPBD_NCOP.src_cut]]
    opening_mask = vdf.dcm(out, src_c[opstart:opend + 1],
                           ncop[:opend - opstart + 1], opstart, opend, 3,
                           3).std.Convolution([1] * 9)

    credit = lvf.rfs(out, core.std.MaskedMerge(out, src, opening_mask),
                     [(opstart, opend)])
    out = credit

    logo_mask = lvf.src('credit_mask_logo.png', out).std.Convolution([1] * 9)
    credit = lvf.rfs(out, core.std.MaskedMerge(out, ref, logo_mask),
                     [(20992, 23225)])
    credit = lvf.rfs(credit, src, [(97766, src.num_frames - 1)])
    out = credit

    return depth(out, 10)
示例#3
0
def do_filter():
    """Vapoursynth filtering"""
    src = JPBD.src_cut
    src = depth(src, 16)
    out = src
    if out.num_frames < 34046:
        while out.num_frames != 34046:
            out += out[-1]
    opstart, opend = 0, 2157
    h = 720
    w = get_w(h)


    fixedges = awf.bbmod(out, 2, 2, 2, 2, 64<<8, 999)
    out = fixedges


    decomb = hvf.Vinverse(out)
    decomb = lvf.rfs(out, decomb, [(2187, 2195)])
    ref = decomb
    out = decomb

    from adptvgrnMod import adptvgrnMod
    first_denoise = hybrid_denoise(out, 0.35, 1.5)
    regrain = adptvgrnMod(first_denoise, 0.275, 0.175, 1.25, 45)
    regrain = lvf.rfs(out, regrain, [(28691, 28818)])
    out = regrain


    clean = core.knlm.KNLMeansCL(out, h=0.55, a=2, d=3, device_type='gpu', device_id=0, channels='UV')
    clean = core.knlm.KNLMeansCL(clean, h=0.55, a=2, d=3, device_type='gpu', device_id=0, channels='Y')
    diff_den = core.std.MakeDiff(out, clean)
    out = depth(clean, 32)



    luma = get_y(out)
    line_mask = vdf.edge_detect(luma, 'FDOG', 0.05, (1, 1))

    descale = core.descale.Debilinear(luma, w, h)
    upscale = vdf.nnedi3_upscale(descale, correct_shift=False, pscrn=1).resize.Bicubic(src.width, src.height, src_left=.5, src_top=.5)
    rescale = core.std.MaskedMerge(luma, upscale, line_mask)

    merged = vdf.merge_chroma(rescale, out)
    out = depth(merged, 16)


    moozzi = warping(out, 0.4, 4)
    sharp = hvf.LSFmod(moozzi, strength=95, Smode=3, Lmode=1, edgemode=1, edgemaskHQ=True)
    out = sharp


    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)
    out = deband


    grain_org = core.std.MergeDiff(out, diff_den)
    out = grain_org


    credit_mask = vdf.diff_rescale_mask(ref, mthr=40, sw=5, sh=5)
    credit_mask = vdf.region_mask(credit_mask, 10, 10, 10, 10).std.Inflate().std.Inflate()
    antialias = lvf.sraa(ref, 2, 13, downscaler=core.resize.Bicubic)
    credit = lvf.rfs(out, core.std.MaskedMerge(out, antialias, credit_mask),
                     [(2188, 2305), (33926, src.num_frames-1)])
    credit = lvf.rfs(credit, core.std.MaskedMerge(out, ref, credit_mask), [(31684, 33925)])

    out = credit


    src_c, ncop = [clip.std.Median() for clip in [src, JPBD_NCOP.src_cut]]
    opening_mask = vdf.dcm(out, src_c[opstart:opend+1], ncop[:opend-opstart+1], opstart, opend, 3, 3)
    credit_mask = opening_mask.std.Convolution([1]*9)

    credit = lvf.rfs(out, core.std.MaskedMerge(out, src, credit_mask), [(opstart, opend)])
    out = credit


    return depth(out, 10)
示例#4
0
def do_filter():
    """Vapoursynth filtering"""
    src = JPBD.src_clip
    src = depth(src, 16)
    src = src[:34016] + src[34016 + 24 * 2 + 22:-24]
    out = src

    h = 720
    w = get_w(h)

    fixedges = awf.bbmod(out, 2, 2, 2, 2, 64 << 8, 999)
    out = fixedges

    decomb = hvf.Vinverse(out)
    decomb = lvf.rfs(out, decomb, [(756, 764)])
    ref = decomb
    out = decomb

    from adptvgrnMod import adptvgrnMod
    first_denoise = hybrid_denoise(out, 0.35, 1.5)
    regrain = adptvgrnMod(first_denoise, 0.275, 0.175, 1.25, 45)
    regrain = lvf.rfs(out, regrain, [(23709, 23786), (30397, 30546)])
    out = regrain

    clean = core.knlm.KNLMeansCL(out,
                                 h=0.55,
                                 a=2,
                                 d=3,
                                 device_type='gpu',
                                 device_id=0,
                                 channels='UV')
    clean = core.knlm.KNLMeansCL(clean,
                                 h=0.55,
                                 a=2,
                                 d=3,
                                 device_type='gpu',
                                 device_id=0,
                                 channels='Y')
    diff_den = core.std.MakeDiff(out, clean)
    out = depth(clean, 32)

    luma = get_y(out)
    line_mask = vdf.edge_detect(luma, 'FDOG', 0.05, (1, 1))

    descale = core.descale.Debilinear(luma, w, h)
    upscale = vdf.nnedi3_upscale(descale, correct_shift=False,
                                 pscrn=1).resize.Bicubic(src.width,
                                                         src.height,
                                                         src_left=.5,
                                                         src_top=.5)
    rescale = core.std.MaskedMerge(luma, upscale, line_mask)

    merged = vdf.merge_chroma(rescale, out)
    out = depth(merged, 16)

    moozzi = warping(out, 0.4, 4)
    sharp = hvf.LSFmod(moozzi,
                       strength=95,
                       Smode=3,
                       Lmode=1,
                       edgemode=1,
                       edgemaskHQ=True)
    out = sharp

    deband_mask = lvf.denoise.detail_mask(out, brz_a=2000, brz_b=1000)
    deband = dbs.f3kpf(out, 17, 30, 30)
    deband_b = core.neo_f3kdb.Deband(out, 31, 18, 18, 18, 0, 0, 4)
    import placebo
    deband_c = placebo.deband(out, 18, 6, 1, 2)
    deband = lvf.rfs(deband, deband_b, [(16328, 16607), (17272, 17447)])
    deband = lvf.rfs(deband, deband_c, [(23709, 23786), (30397, 30546),
                                        (31115, 31353)])
    deband = core.std.MaskedMerge(deband, out, deband_mask)
    out = deband

    grain_org = core.std.MergeDiff(out, diff_den)
    out = grain_org

    credit_mask = vdf.diff_rescale_mask(ref, mthr=40, sw=5, sh=5)
    credit_mask = vdf.region_mask(credit_mask, 10, 10, 10,
                                  10).std.Inflate().std.Inflate()
    credit = lvf.rfs(out, core.std.MaskedMerge(out, ref, credit_mask),
                     [(0, 661), (26731, 34015)])
    credit = lvf.rfs(credit, src, [(34016, src.num_frames - 1)])
    out = credit

    return depth(out, 10)