5
0

symphogear: xv: bd: shinai tweaks and ncop/ed

This commit is contained in:
louis f 2021-01-23 20:11:50 -05:00
parent 5f23f7290d
commit eb8b73c4a3
Signed by: louis
GPG Key ID: 44D7E1DE4E23D6F2
13 changed files with 107 additions and 28 deletions

View File

@ -1,9 +1,6 @@
import os
import vapoursynth as vs import vapoursynth as vs
import kagefunc as kgf import kagefunc as kgf
import fvsfunc as fvf import fvsfunc as fvf
import vsTAAmbk as vstaa
import vsutil import vsutil
from nnedi3_rpow2 import nnedi3_rpow2 from nnedi3_rpow2 import nnedi3_rpow2
@ -11,9 +8,8 @@ from ytttfunc import adaptivegrain
core = vs.core core = vs.core
core.max_cache_size = 8192
src = core.lsmas.LWLibavSource("bdmv/KIXA_90890/BDMV/STREAM/00007.m2ts")[24:-24] src = core.lsmas.LWLibavSource("../bdmv/KIXA_90890/BDMV/STREAM/00007.m2ts")[24:-24]
src = core.fmtc.bitdepth(src, bits=16) src = core.fmtc.bitdepth(src, bits=16)
Y = vsutil.get_y(src) Y = vsutil.get_y(src)
@ -27,7 +23,7 @@ Y872 = nnedi3_rpow2(Y872).resize.Spline36(1920, 1080, format=vs.GRAY16)
Yd = fvf.rfs(Y872, Y800, "[8952 9695]") Yd = fvf.rfs(Y872, Y800, "[8952 9695]")
scaled = core.std.ShufflePlanes([Yd, src], planes=[0, 1, 2], colorfamily=vs.YUV) scaled = core.std.ShufflePlanes([Yd, src], planes=[0, 1, 2], colorfamily=vs.YUV)
final = src final = scaled
final = adaptivegrain.adaptive_grain(final) final = adaptivegrain.adaptive_grain(final)
final = core.fmtc.bitdepth(final, bits=10, dmode=3) final = core.fmtc.bitdepth(final, bits=10, dmode=3)
final.set_output() final.set_output()

View File

@ -7,6 +7,6 @@ import vapoursynth as vs
core = vs.core core = vs.core
ac = acsuite.AC() ac = acsuite.AC()
path = r"bdmv/KIXA_90890/BDMV/STREAM/00007.m2ts" path = "../bdmv/KIXA_90890/BDMV/STREAM/00007.m2ts"
src = core.lsmas.LWLibavSource(path) src = core.lsmas.LWLibavSource(path)
ac.eztrim(src, [(24, -24)], os.path.splitext(path)[0] + ".wav", "shinai.wav") ac.eztrim(src, [(24, -24)], os.path.splitext(path)[0] + ".wav", "shinai.wav")

View File

@ -1,9 +1,6 @@
import os
import vapoursynth as vs import vapoursynth as vs
import kagefunc as kgf import kagefunc as kgf
import fvsfunc as fvf import fvsfunc as fvf
import vsTAAmbk as vstaa
import vsutil import vsutil
from nnedi3_rpow2 import nnedi3_rpow2 from nnedi3_rpow2 import nnedi3_rpow2
@ -11,9 +8,8 @@ from ytttfunc import adaptivegrain
core = vs.core core = vs.core
core.max_cache_size = 8192
src = core.lsmas.LWLibavSource("00007.m2ts")[24:-24] src = core.lsmas.LWLibavSource("../bdmv/KIXA_90891/BDMV/STREAM/00007.m2ts")[24:-24]
src = core.fmtc.bitdepth(src, bits=16) src = core.fmtc.bitdepth(src, bits=16)
Y = vsutil.get_y(src) Y = vsutil.get_y(src)
@ -21,7 +17,10 @@ Y = vsutil.get_y(src)
Y800 = kgf.inverse_scale(Y, height=800, kernel="bicubic", b=1/3, c=1/3, mask_detail=True) Y800 = kgf.inverse_scale(Y, height=800, kernel="bicubic", b=1/3, c=1/3, mask_detail=True)
Y800 = nnedi3_rpow2(Y800).resize.Spline36(1920, 1080, format=vs.GRAY16) Y800 = nnedi3_rpow2(Y800).resize.Spline36(1920, 1080, format=vs.GRAY16)
Yd = fvf.rfs(Y, Y800, "[7920 8663]") Y872 = kgf.inverse_scale(Y, height=872, kernel="bicubic", b=1/3, c=1/3, mask_detail=True)
Y872 = nnedi3_rpow2(Y872).resize.Spline36(1920, 1080, format=vs.GRAY16)
Yd = fvf.rfs(Y872, Y800, "[7920 8663]")
scaled = core.std.ShufflePlanes([Yd, src], planes=[0, 1, 2], colorfamily=vs.YUV) scaled = core.std.ShufflePlanes([Yd, src], planes=[0, 1, 2], colorfamily=vs.YUV)
final = scaled final = scaled

View File

@ -7,6 +7,6 @@ import vapoursynth as vs
core = vs.core core = vs.core
ac = acsuite.AC() ac = acsuite.AC()
path = r"00007.m2ts" path = "../bdmv/KIXA_90891/BDMV/STREAM/00007.m2ts"
src = core.lsmas.LWLibavSource(path) src = core.lsmas.LWLibavSource(path)
ac.eztrim(src, [(24, -24)], os.path.splitext(path)[0] + ".wav", "shinai.wav") ac.eztrim(src, [(24, -24)], os.path.splitext(path)[0] + ".wav", "shinai.wav")

View File

@ -1,9 +1,6 @@
import os
import vapoursynth as vs import vapoursynth as vs
import kagefunc as kgf import kagefunc as kgf
import fvsfunc as fvf import fvsfunc as fvf
import vsTAAmbk as vstaa
import vsutil import vsutil
from nnedi3_rpow2 import nnedi3_rpow2 from nnedi3_rpow2 import nnedi3_rpow2
@ -11,9 +8,8 @@ from ytttfunc import adaptivegrain
core = vs.core core = vs.core
core.max_cache_size = 1024
src = core.lsmas.LWLibavSource("KIXA_90892/BDMV/STREAM/00007.m2ts")[24:-24] src = core.lsmas.LWLibavSource("../bdmv/KIXA_90892/BDMV/STREAM/00007.m2ts")[24:-24]
src = core.fmtc.bitdepth(src, bits=16) src = core.fmtc.bitdepth(src, bits=16)
Y = vsutil.get_y(src) Y = vsutil.get_y(src)

View File

@ -7,6 +7,6 @@ import vapoursynth as vs
core = vs.core core = vs.core
ac = acsuite.AC() ac = acsuite.AC()
path = r"KIXA_90892/BDMV/STREAM/00007.m2ts" path = "../bdmv/KIXA_90892/BDMV/STREAM/00007.m2ts"
src = core.lsmas.LWLibavSource(path) src = core.lsmas.LWLibavSource(path)
ac.eztrim(src, [(24, -24)], os.path.splitext(path)[0] + ".wav", "shinai.wav") ac.eztrim(src, [(24, -24)], os.path.splitext(path)[0] + ".wav", "shinai.wav")

View File

@ -1,9 +1,6 @@
import os
import vapoursynth as vs import vapoursynth as vs
import kagefunc as kgf import kagefunc as kgf
import fvsfunc as fvf import fvsfunc as fvf
import vsTAAmbk as vstaa
import vsutil import vsutil
from nnedi3_rpow2 import nnedi3_rpow2 from nnedi3_rpow2 import nnedi3_rpow2
@ -11,9 +8,8 @@ from ytttfunc import adaptivegrain
core = vs.core core = vs.core
core.max_cache_size = 1024
src = core.lsmas.LWLibavSource("KIXA_90893/BDMV/Stream/00007.m2ts")[24:-24] src = core.lsmas.LWLibavSource("../bdmv/KIXA_90893/BDMV/Stream/00007.m2ts")[24:-24]
src = core.fmtc.bitdepth(src, bits=16) src = core.fmtc.bitdepth(src, bits=16)
Y = vsutil.get_y(src) Y = vsutil.get_y(src)

View File

@ -7,6 +7,6 @@ import vapoursynth as vs
core = vs.core core = vs.core
ac = acsuite.AC() ac = acsuite.AC()
path = r"KIXA_90893/BDMV/Stream/00007.m2ts" path = "../bdmv/KIXA_90893/BDMV/Stream/00007.m2ts"
src = core.lsmas.LWLibavSource(path) src = core.lsmas.LWLibavSource(path)
ac.eztrim(src, [(24, -24)], os.path.splitext(path)[0] + ".wav", "shinai.wav") ac.eztrim(src, [(24, -24)], os.path.splitext(path)[0] + ".wav", "shinai.wav")

View File

@ -0,0 +1,30 @@
import vapoursynth as vs
from toolz.functoolz import compose
from typing import List
import sys
sys.path.append("..")
from xv_common import FadeRange, Range, denoise, descale, deband, finalize # noqa: E402
core = vs.core
NO_SCALE: List[Range] = []
FORCE_SCALE: List[Range] = []
FADE_RANGES: List[FadeRange] = []
DEBAND_HARD: List[Range] = []
DEBAND_HARDER: List[Range] = []
src = core.lsmas.LWLibavSource("../bdmv/KIXA_90889/BDMV/STREAM/00008.m2ts")[24:-24]
src = src.fmtc.bitdepth(bits=16)
den = denoise(src)
final = compose(
finalize,
deband(hard=DEBAND_HARD, harder=DEBAND_HARDER),
descale(force_scale=FORCE_SCALE, no_scale=NO_SCALE, fade_ranges=FADE_RANGES)
)(den)
final.set_output()

View File

@ -0,0 +1,12 @@
#!/usr/bin/env python3
import acsuite
import os
import vapoursynth as vs
core = vs.core
ac = acsuite.AC()
path = "../bdmv/KIXA_90889/BDMV/STREAM/00008.m2ts"
src = core.lsmas.LWLibavSource(path)
ac.eztrim(src, [(22, -24)], os.path.splitext(path)[0] + ".wav", "nced.wav")

View File

@ -0,0 +1,38 @@
import vapoursynth as vs
from toolz.functoolz import compose
from typing import List, Optional, Tuple
import sys
sys.path.append("..")
from xv_common import FadeRange, Range, denoise, descale, w2x, deband, finalize # noqa: E402
core = vs.core
OP: Optional[Tuple[int, int]] = (0, 2399)
NO_SCALE: List[Range] = []
FORCE_SCALE: List[Range] = []
FADE_RANGES: List[FadeRange] = []
W2X_DENOISE: List[Range] = []
if OP is not None:
W2X_DENOISE.append(
(OP[0]+1859, OP[0]+1896), # flashy OP scene
)
DEBAND_HARD: List[Range] = []
DEBAND_HARDER: List[Range] = []
src = core.lsmas.LWLibavSource("../bdmv/KIXA_90889/BDMV/STREAM/00007.m2ts")[24:-24]
src = src.fmtc.bitdepth(bits=16)
den = denoise(src)
final = compose(
finalize,
deband(hard=DEBAND_HARD, harder=DEBAND_HARDER),
w2x(w2x_range=W2X_DENOISE),
descale(force_scale=FORCE_SCALE, no_scale=NO_SCALE, fade_ranges=FADE_RANGES)
)(den)
final.set_output()

View File

@ -0,0 +1,12 @@
#!/usr/bin/env python3
import acsuite
import os
import vapoursynth as vs
core = vs.core
ac = acsuite.AC()
path = "../bdmv/KIXA_90889/BDMV/STREAM/00007.m2ts"
src = core.lsmas.LWLibavSource(path)
ac.eztrim(src, [(24, -24)], os.path.splitext(path)[0] + ".wav", "ncop.wav")

View File

@ -24,9 +24,9 @@ def denoise(clip: vs.VideoNode) -> vs.VideoNode:
@curry @curry
def w2x(clip: vs.VideoNode, w2x_range: List[Range]) -> vs.VideoNode: def w2x(clip: vs.VideoNode, w2x_range: List[Range]) -> vs.VideoNode:
rgb = clip.resize.Point(format=vs.RGBS, matrix_in_s="709") rgb = clip.resize.Bicubic(format=vs.RGBS, matrix_in_s="709")
w2x = rgb.w2xnvk.Waifu2x(noise=1, scale=1, model=2) \ w2x = rgb.w2xnvk.Waifu2x(noise=1, scale=1, model=2) \
.resize.Point(format=clip.format.id, matrix_s="709") .resize.Bicubic(format=clip.format.id, matrix_s="709")
bm3d = BM3D(clip, sigma=[0, 5], ref=w2x) bm3d = BM3D(clip, sigma=[0, 5], ref=w2x)
bm3d = core.std.ShufflePlanes([w2x, bm3d], planes=[0, 1, 2], bm3d = core.std.ShufflePlanes([w2x, bm3d], planes=[0, 1, 2],