5
0

tanteidan: tv: ed2: aa scenefilter

This commit is contained in:
louis f 2021-04-28 12:52:00 -04:00
parent e29b8f0453
commit 6e93186ea6
Signed by: louis
GPG Key ID: 44D7E1DE4E23D6F2
3 changed files with 15 additions and 2 deletions
Bishounen Tanteidan
03
tanteidan_common

@ -1,7 +1,8 @@
import vapoursynth as vs
from tanteidan_common import (PrettyConfig, PrettySource, antialias, deband,
denoise, finalize, regrain, stupid_op_scenefilter)
denoise, finalize, regrain, stupid_op_scenefilter,
wd_scenefilter)
from yt_common.automation import SelfRunner
from yt_common.source import waka_replace
@ -22,6 +23,7 @@ CONFIG: PrettyConfig = PrettyConfig(EPNUM)
SOURCE: PrettySource = PrettySource(CONFIG)
OP: Optional[int] = 0
WELCOMING_DAYS: Optional[int] = 31864
WAKA_REPLACE: List[List[Range]] = [
[(1852, 1965), (31864, 32661)],
@ -94,6 +96,8 @@ def filter() -> vs.VideoNode:
deb = deband(den)
aa = antialias(deb, strong=AA_STRONG, weak=AA_WEAK, noaa=AA_NONE)
scenefilter = stupid_op_scenefilter(aa, deb, OP)
if WELCOMING_DAYS is not None:
scenefilter = wd_scenefilter(aa, deb, WELCOMING_DAYS)
grain = regrain(scenefilter)
final = finalize(grain)
final.set_output()

@ -1,2 +1,2 @@
from .config import PrettyConfig, PrettySource # noqa: F401
from .filter import antialias, deband, denoise, finalize, regrain, stupid_op_scenefilter # noqa: F401
from .filter import antialias, deband, denoise, finalize, regrain, stupid_op_scenefilter, wd_scenefilter # noqa: F401

@ -85,5 +85,14 @@ def stupid_op_scenefilter(aa: vs.VideoNode, deb: vs.VideoNode, start: Optional[i
return sraa
def wd_scenefilter(aa: vs.VideoNode, deb: vs.VideoNode, start: Optional[int]) -> vs.VideoNode:
# this does icky things to the credits but until we get NC it's way worth it
if start is None:
return aa
WD_AA_STRONG: List[Range] = [(start+1263, start+1355), (start+1468, start+1617)]
sraa = upscaled_sraa(deb, rfactor=1.6, downscaler=Bicubic(b=0, c=1/2).scale)
return replace_ranges(aa, sraa, WD_AA_STRONG)
def finalize(clip: vs.VideoNode) -> vs.VideoNode:
return vsutil.depth(clip, 10)