├── .gitattributes ├── LICENSE ├── 2022-Q2 ├── Yuusha Yamemasu │ ├── video │ │ ├── test.vpy │ │ └── test.ini │ ├── yuusha_yamemasu.ini │ └── yuusha_yamemasu.vpy ├── Shiki Mamoru-san │ ├── Kawaii_dake.vpy │ └── Kawaii_dake.ini ├── Mobseka │ ├── mobseka.vpy │ └── mobseka.ini ├── Kunoichi Tsubaki │ ├── Kunoichi_Tsubaki.vpy │ └── Kunoichi_Tsubaki.ini ├── Tate no Yuusha │ ├── shieldbro.vpy │ └── shieldbro.ini ├── Cuckoos │ ├── Cuckoos.ini │ └── Cuckoos.vpy ├── Date A Live S4 │ ├── DAL_IV.ini │ └── DAL_IV.vpy ├── Honzuki S3 │ ├── Honzuki.ini │ └── Honzuki.vpy ├── RikeKoi │ ├── RikeKoi.ini │ └── RikeKoi.vpy ├── Skeleton Knight │ ├── skeleton.ini │ ├── skeleton_cred_gen.vpy │ └── skeleton.vpy ├── Spy X Family │ ├── Spy_X_Family.ini │ └── Spy_X_Family.vpy ├── Murabito │ ├── murabito.ini │ └── murabito.vpy ├── Mahoutsukai Reimeiki │ ├── mahoutsukai.ini │ └── mahoutsukai.vpy └── Kaguya-sama S3 │ ├── kaguya.ini │ └── kaguya.vpy ├── Lupin III S1_3 ├── lupin3_S1.ini ├── lupin3_S2.ini ├── lupin3_S3.ini ├── lupin3_S1.vpy ├── lupin3_S2.vpy └── lupin3_S3.vpy ├── Cowboy Bebop ├── Bebop.ini ├── Bebop_23.ini ├── Bebop.vpy └── Bebop_23.vpy └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | *.vpy linguist-language=python 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | -------------------------------------------------------------------------------- /2022-Q2/Yuusha Yamemasu/video/test.vpy: -------------------------------------------------------------------------------- 1 | import vapoursynth as vs 2 | import EoEfunc as eoe 3 | 4 | # region setup 5 | 6 | DEFAULT_PATH = r"01_incomplete.mkv" 7 | DEFAULT_CACHE = 32 8 | DEFAULT_THREADS = 24 9 | 10 | env = eoe.setup_env(globals()) 11 | core: vs._CoreProxy = env["core"] 12 | src_path: str = env["src_path"] 13 | GPU: int = env["GPU"] 14 | debug: bool = env["debug"] 15 | 16 | # endregion setup 17 | 18 | src = core.lsmas.LWLibavSource(src_path) 19 | comp = core.lsmas.LWLibavSource( 20 | R"../Yuusha, Yamemasu - 01 - 1080p WEB x264 -NanDesuKa (HIDIVE).mkv" 21 | )[24:] 22 | 23 | 24 | final = src 25 | final.set_output() 26 | 27 | if debug: 28 | debug_output = eoe.debug_output 29 | debug_output(src, "src") 30 | debug_output(comp, "comp") 31 | -------------------------------------------------------------------------------- /2022-Q2/Shiki Mamoru-san/Kawaii_dake.vpy: -------------------------------------------------------------------------------- 1 | import vapoursynth as vs 2 | import EoEfunc as eoe 3 | import lvsfunc as lvf 4 | import havsfunc as haf 5 | import kagefunc as kgf 6 | from vardefunc.deband import dumb3kdb 7 | 8 | # region setup 9 | 10 | DEFAULT_PATH = r"Kawaii dake ja Nai Shikimori-san - S01E01 - 1080p WEB x264 -NanDesuKa (CR).mkv" 11 | DEFAULT_CACHE = 32 12 | DEFAULT_THREADS = 24 13 | 14 | env = eoe.setup_env(globals()) 15 | core: vs._CoreProxy = env["core"] 16 | src_path: str = env["src_path"] 17 | GPU: int = env["GPU"] 18 | debug: bool = env["debug"] 19 | 20 | # endregion setup 21 | 22 | src = core.lsmas.LWLibavSource(src_path) 23 | src = eoe.fmt.set(src, "16") 24 | 25 | bm3d = eoe.dn.BM3D(src, [1.2, 0], 1, "lc") 26 | knlm = core.knlm.KNLMeansCL(bm3d, d=2, a=3, h=0.6, channels="UV") 27 | 28 | dehalo = haf.FineDehalo(knlm, rx=3, darkstr=0, brightstr=1) 29 | dehalo = haf.EdgeCleaner(dehalo, strength=2, rmode=13, smode=1, hot=True) 30 | 31 | deband = dumb3kdb(dehalo, 16, [30, 24, 24], [16, 4]) 32 | 33 | grain = kgf.adaptive_grain(deband, 0.25) 34 | 35 | final = grain 36 | final = eoe.fmt.set(final, "10") 37 | final.set_output() 38 | 39 | if debug: 40 | debug_output = eoe.debug_output 41 | debug_output(src, "src") 42 | debug_output(knlm, "knlm") 43 | debug_output(dehalo, "dehalo") 44 | debug_output(grain, "grain") 45 | -------------------------------------------------------------------------------- /2022-Q2/Mobseka/mobseka.vpy: -------------------------------------------------------------------------------- 1 | import vapoursynth as vs 2 | import EoEfunc as eoe 3 | import lvsfunc as lvf 4 | from vardefunc.deband import dumb3kdb 5 | import kagefunc as kgf 6 | 7 | # region setup 8 | 9 | DEFAULT_PATH = ( 10 | r"[SubsPlease] Otome Game Sekai wa Mob ni Kibishii Sekai desu - 01 (1080p) [D7F51270].mkv" 11 | ) 12 | DEFAULT_CACHE = 32 13 | DEFAULT_THREADS = 24 14 | 15 | env = eoe.setup_env(globals()) 16 | core: vs._CoreProxy = env["core"] 17 | src_path: str = env["src_path"] 18 | GPU: int = env["GPU"] 19 | debug: bool = env["debug"] 20 | 21 | # endregion setup 22 | 23 | src = core.lsmas.LWLibavSource(src_path) 24 | src = eoe.fmt.set(src, "16") 25 | 26 | cmde = eoe.dn.CMDE(src, 2, 100) 27 | 28 | bm3d = eoe.dn.BM3D(cmde, [1, 0], 0, "fast") 29 | knlm = core.knlm.KNLMeansCL(bm3d, d=2, a=3, h=0.9, channels="UV") 30 | 31 | aa = lvf.aa.clamp_aa( 32 | knlm, lvf.aa.nnedi3(knlm), lvf.aa.upscaled_sraa(knlm, 1.3, 13, eedi3cl=True), 4 33 | ) 34 | 35 | deband = dumb3kdb(aa, 16, 32, [8, 2]) 36 | 37 | grain = kgf.adaptive_grain(deband, 0.25) 38 | 39 | final = grain 40 | final = eoe.fmt.set(final, "10") 41 | final.set_output() 42 | 43 | if debug: 44 | debug_output = eoe.debug_output 45 | debug_output(src, "src") 46 | # debug_output(src, "src", fft=True) 47 | debug_output(cmde, "cmde") 48 | debug_output(bm3d, "dft") 49 | debug_output(knlm, "knlm") 50 | debug_output(aa, "aa") 51 | debug_output(grain, "grain") 52 | -------------------------------------------------------------------------------- /2022-Q2/Kunoichi Tsubaki/Kunoichi_Tsubaki.vpy: -------------------------------------------------------------------------------- 1 | import vapoursynth as vs 2 | import EoEfunc as eoe 3 | import lvsfunc as lvf 4 | import havsfunc as haf 5 | import kagefunc as kgf 6 | from vardefunc.deband import dumb3kdb 7 | 8 | # region setup 9 | 10 | DEFAULT_PATH = ( 11 | r"[Erai-raws] Kunoichi Tsubaki no Mune no Uchi - 01 [1080p][Multiple Subtitle][E4F9A214].mkv" 12 | ) 13 | DEFAULT_CACHE = 32 14 | DEFAULT_THREADS = 24 15 | 16 | env = eoe.setup_env(globals()) 17 | core: vs._CoreProxy = env["core"] 18 | src_path: str = env["src_path"] 19 | GPU: int = env["GPU"] 20 | debug: bool = env["debug"] 21 | 22 | # endregion setup 23 | 24 | src = core.lsmas.LWLibavSource(src_path) 25 | src = eoe.fmt.set(src, "16") 26 | 27 | bm3d = eoe.dn.BM3D(src, [1.2, 0], 1, "lc") 28 | knlm = core.knlm.KNLMeansCL(bm3d, d=2, a=3, h=0.6, channels="UV") 29 | 30 | aa = lvf.aa.nnedi3(knlm, opencl=True) 31 | 32 | dehalo = haf.FineDehalo(aa, rx=2.4, darkstr=0, brightstr=1, contra=1) 33 | dehalo = haf.EdgeCleaner(dehalo, strength=2, rmode=13, smode=1, hot=True) 34 | 35 | deband = dumb3kdb(dehalo, 16, [30, 24, 24], [16, 4]) 36 | 37 | grain = kgf.adaptive_grain(deband, 0.2) 38 | 39 | final = grain 40 | final = eoe.fmt.set(final, "10") 41 | final.set_output() 42 | 43 | if debug: 44 | debug_output = eoe.debug_output 45 | debug_output(src, "src") 46 | debug_output(knlm, "knlm") 47 | debug_output(aa, "aa") 48 | debug_output(dehalo, "dehalo") 49 | debug_output(grain, "grain") 50 | -------------------------------------------------------------------------------- /2022-Q2/Tate no Yuusha/shieldbro.vpy: -------------------------------------------------------------------------------- 1 | import vapoursynth as vs 2 | import EoEfunc as eoe 3 | import lvsfunc as lvf 4 | from vardefunc.deband import dumb3kdb 5 | import kagefunc as kgf 6 | 7 | # region setup 8 | 9 | DEFAULT_PATH = r"[SubsPlease] Tate no Yuusha no Nariagari S2 - 01 (1080p) [515B223B].mkv" 10 | DEFAULT_CACHE = 32 11 | DEFAULT_THREADS = 24 12 | 13 | env = eoe.setup_env(globals()) 14 | core: vs._CoreProxy = env["core"] 15 | src_path: str = env["src_path"] 16 | GPU: int = env["GPU"] 17 | debug: bool = env["debug"] 18 | 19 | # endregion setup 20 | 21 | src = core.lsmas.LWLibavSource(src_path) 22 | src = eoe.fmt.set(src, "16") 23 | 24 | sloc = [0, 0.25, 0.5, 1.5, 0.55, 3, 0.6, 6, 0.75, 16, 1, 16] 25 | dft = core.dfttest.DFTTest(src, planes=[0], tbsize=1, slocation=sloc) 26 | knlm = core.knlm.KNLMeansCL(dft, d=2, a=3, h=0.6, channels="UV") 27 | 28 | aa = lvf.aa.upscaled_sraa(knlm, 1.5, opencl=True) 29 | 30 | deband = dumb3kdb(aa, 16, [24, 16, 16], [16, 4]) 31 | 32 | grain = kgf.adaptive_grain(deband, 0.2) 33 | 34 | final = grain 35 | final = eoe.fmt.set(final, "10") 36 | final.set_output() 37 | 38 | # funny aliasing 10148 39 | 40 | if debug: 41 | debug_output = eoe.debug_output 42 | debug_output(src, "src") 43 | debug_output( 44 | core.lsmas.LWLibavSource(R"[Judas] Tate no Yuusha no Nariagari - S02E01 INCOMPLETE.mkv") 45 | ) 46 | debug_output(knlm, "knlm") 47 | debug_output(aa, "aa") 48 | debug_output(grain, "grain") 49 | -------------------------------------------------------------------------------- /2022-Q2/Cuckoos/Cuckoos.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Cuckoos 6 | SeriesNumber=01 7 | vpy=Cuckoos.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=2 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.5 29 | x265-psy-rdoq=1.0 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20 36 | x265-aq-mode=3 37 | x265-aq-strength=0.7 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.6 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/Mobseka/mobseka.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Mobseka 6 | SeriesNumber=01 7 | vpy=mobseka.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.7 29 | x265-psy-rdoq=1.4 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20 36 | x265-aq-mode=3 37 | x265-aq-strength=0.75 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.8 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/Yuusha Yamemasu/video/test.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=test 6 | SeriesNumber=01 7 | vpy=test.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.7 29 | x265-psy-rdoq=1.2 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=21 36 | x265-aq-mode=3 37 | x265-aq-strength=0.7 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.7 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params= 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /Lupin III S1_3/lupin3_S1.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Lupin 6 | SeriesNumber=01 7 | vpy=lupin3_S1.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.5 29 | x265-psy-rdoq=1.5 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20.75 36 | x265-aq-mode=4 37 | x265-aq-strength=1.0 38 | x265-cbqpoffs=1 39 | x265-crqpoffs=1 40 | x265-qcomp=0.67 41 | x265-deblock= 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate=112k 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=libopus 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /Lupin III S1_3/lupin3_S2.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Lupin 6 | SeriesNumber=02 7 | vpy=lupin3_S2.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.5 29 | x265-psy-rdoq=1.5 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20.75 36 | x265-aq-mode=4 37 | x265-aq-strength=1.0 38 | x265-cbqpoffs=1 39 | x265-crqpoffs=1 40 | x265-qcomp=0.67 41 | x265-deblock= 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate=112k 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=libopus 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /Lupin III S1_3/lupin3_S3.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Lupin 6 | SeriesNumber=03 7 | vpy=lupin3_S3.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.5 29 | x265-psy-rdoq=1.5 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20.75 36 | x265-aq-mode=4 37 | x265-aq-strength=1.0 38 | x265-cbqpoffs=1 39 | x265-crqpoffs=1 40 | x265-qcomp=0.67 41 | x265-deblock= 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate=112k 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=libopus 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/Date A Live S4/DAL_IV.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Date A Live 6 | SeriesNumber=04 7 | vpy=DAL_IV.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.5 29 | x265-psy-rdoq=1.3 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20 36 | x265-aq-mode=3 37 | x265-aq-strength=0.7 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.65 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/Honzuki S3/Honzuki.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Honzuki no Gekokujou S3 6 | SeriesNumber=01 7 | vpy=Honzuki.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.4 29 | x265-psy-rdoq=1.2 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=18 36 | x265-aq-mode=4 37 | x265-aq-strength=1 38 | x265-cbqpoffs= 39 | x265-crqpoffs= 40 | x265-qcomp=0.62 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/RikeKoi/RikeKoi.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=RikeKoi 6 | SeriesNumber=02 7 | vpy=RikeKoi.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.4 29 | x265-psy-rdoq=1.2 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20 36 | x265-aq-mode=4 37 | x265-aq-strength=1 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.62 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode --pbratio 1.25 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate=112k 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=libopus 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/Skeleton Knight/skeleton.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Gaikotsu Kishi-sama 6 | SeriesNumber=01 7 | vpy=skeleton.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.8 29 | x265-psy-rdoq=1.5 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20 36 | x265-aq-mode=3 37 | x265-aq-strength=0.75 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.67 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/Spy X Family/Spy_X_Family.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Spy X Family 6 | SeriesNumber=01 7 | vpy=Spy_X_Family.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.6 29 | x265-psy-rdoq=1.3 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20.5 36 | x265-aq-mode=3 37 | x265-aq-strength=0.7 38 | x265-cbqpoffs=-2 39 | x265-crqpoffs=-2 40 | x265-qcomp=0.63 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/Tate no Yuusha/shieldbro.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Tate no Yuusha no Nariagari 6 | SeriesNumber=02 7 | vpy=shieldbro.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge=5 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.75 29 | x265-psy-rdoq=1.5 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=19 36 | x265-aq-mode=3 37 | x265-aq-strength=0.75 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.68 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/Shiki Mamoru-san/Kawaii_dake.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Kawaii dake ja Nai Shikimori-san 6 | SeriesNumber=01 7 | vpy=Kawaii_dake.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.6 29 | x265-psy-rdoq=1.3 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20 36 | x265-aq-mode=3 37 | x265-aq-strength=0.7 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.62 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/Murabito/murabito.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Shijou Saikyou no Daimaou, Murabito A ni Tensei suru 6 | SeriesNumber=01 7 | vpy=murabito.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.8 29 | x265-psy-rdoq=1.5 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=20 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20 36 | x265-aq-mode=3 37 | x265-aq-strength=0.8 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.67 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/Kunoichi Tsubaki/Kunoichi_Tsubaki.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Kunoichi Tsubaki no Mune no Uchi 6 | SeriesNumber=01 7 | vpy=Kunoichi_Tsubaki.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.5 29 | x265-psy-rdoq=1.3 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20 36 | x265-aq-mode=3 37 | x265-aq-strength=0.7 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.64 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/Mahoutsukai Reimeiki/mahoutsukai.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Mahoutsukai Reimeiki (The Dawn of the Witch) 6 | SeriesNumber=01 7 | vpy=mahoutsukai.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.8 29 | x265-psy-rdoq=1.6 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20 36 | x265-aq-mode=3 37 | x265-aq-strength=0.75 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.65 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/Kaguya-sama S3/kaguya.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Kaguya-sama 6 | SeriesNumber=03 7 | vpy=kaguya.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge=5 21 | x265-me= 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme=1 26 | x265-hme-search=1,3,3 27 | x265-hme-range=16,32,57 28 | x265-psy-rd=0.5 29 | x265-psy-rdoq=1.3 30 | x265-keyint=320 31 | x265-min-keyint=32 32 | x265-rc-lookahead=250 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20.5 36 | x265-aq-mode=3 37 | x265-aq-strength=0.73 38 | x265-cbqpoffs= 39 | x265-crqpoffs= 40 | x265-qcomp=0.62 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode --aq-motion --ipratio 1.45 --scenecut 30 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /2022-Q2/Yuusha Yamemasu/yuusha_yamemasu.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Yuusha, Yamemasu 6 | SeriesNumber=01 7 | vpy=yuusha_yamemasu.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge= 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme= 26 | x265-hme-search= 27 | x265-hme-range= 28 | x265-psy-rd=0.8 29 | x265-psy-rdoq=1.5 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=120 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=20 36 | x265-aq-mode=3 37 | x265-aq-strength=0.8 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.67 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode --ipratio 1.3 --pbratio 1.2 --qpstep 1 --qblur 1 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate= 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix= 51 | FFmpegAudioCodec=copy 52 | 53 | ; mux 54 | mkvmergeParams= 55 | -------------------------------------------------------------------------------- /Cowboy Bebop/Bebop.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Cowboy Bebop 6 | SeriesNumber=01 7 | vpy=Bebop.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge=5 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme=1 26 | x265-hme-search=1,3,3 27 | x265-hme-range=16,32,57 28 | x265-psy-rd=0.9 29 | x265-psy-rdoq=3.25 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=25 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=18 36 | x265-aq-mode=3 37 | x265-aq-strength=0.7 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.6 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode --no-constrained-intra --no-strong-intra-smoothing --selective-sao 1 --scenecut 35 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate=112k 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix=1 51 | FFmpegAudioCodec=libopus 52 | 53 | ; mux 54 | mkvmergeVideoParams=--timestamps 0:timestamps.txt 55 | mkvmergeParams= 56 | -------------------------------------------------------------------------------- /Cowboy Bebop/Bebop_23.ini: -------------------------------------------------------------------------------- 1 | ; ===================================================== 2 | ; per season 3 | ; 4 | 5 | ShowName=Cowboy Bebop 6 | SeriesNumber=01 7 | vpy=Bebop_23.vpy 8 | 9 | ; video 10 | ; for boolean flags leave blank for default, 0 for false and 1 for true 11 | ; boolean flags are: b-intra, weightp, weightb, hme, and fades 12 | ; all other flags follow usual x265 syntax - https://x265.readthedocs.io/en/master/cli.html 13 | ; to disable deblock use 0, otherwise leave blank for default or follow above syntax 14 | x265-log-level=2 15 | x265-preset=slow 16 | x265-ref=6 17 | x265-b-intra=1 18 | x265-tu-intra-depth=4 19 | x265-tu-inter-depth=4 20 | x265-max-merge=5 21 | x265-me=3 22 | x265-subme=4 23 | x265-weightp=1 24 | x265-weightb=1 25 | x265-hme=1 26 | x265-hme-search=1,3,3 27 | x265-hme-range=16,32,57 28 | x265-psy-rd=0.9 29 | x265-psy-rdoq=3.25 30 | x265-keyint=240 31 | x265-min-keyint=24 32 | x265-rc-lookahead=25 33 | x265-bframes=8 34 | x265-fades=1 35 | x265-crf=19 36 | x265-aq-mode=3 37 | x265-aq-strength=0.7 38 | x265-cbqpoffs=-1 39 | x265-crqpoffs=-1 40 | x265-qcomp=0.6 41 | x265-deblock=-1:-1 42 | ; any other x265 params 43 | x265-extra-params=--pmode --no-constrained-intra --no-strong-intra-smoothing --selective-sao 1 --scenecut 35 44 | 45 | ; audio + subs 46 | ; only need to choose audio + sub order, attachments are mapped by default 47 | FFmpegMapping=-map 0:a? -map 0:s? 48 | FFmpegAudioBitrate=112k 49 | ; 1 for downmix, 0 for opus channel mapping, blank for no change 50 | FFmpegAudioDownmix=1 51 | FFmpegAudioCodec=libopus 52 | 53 | ; mux 54 | mkvmergeVideoParams=--timestamps 0:timestamps.txt 55 | mkvmergeParams= -------------------------------------------------------------------------------- /2022-Q2/Skeleton Knight/skeleton_cred_gen.vpy: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | import vapoursynth as vs 3 | import EoEfunc as eoe 4 | 5 | core = vs.core 6 | 7 | core.num_threads = 24 8 | core.max_cache_size = 1024 * 10 9 | 10 | src = core.lsmas.LWLibavSource( 11 | r"[Erai-raws] Gaikotsu Kishi-sama Tadaima Isekai e Odekake-chuu - 01 [1080p][Multiple" 12 | r" Subtitle][1D9B823B].mkv" 13 | ) 14 | ed = eoe.fmt.set(src[31889:], "rgb24") 15 | 16 | 17 | credits_ranges: list[tuple[int, int]] = [ 18 | (9, 78), 19 | (78, 156), 20 | (160, 230), 21 | (230, 337), 22 | (551, 628), 23 | (628, 709), 24 | (717, 826), 25 | (826, 908), 26 | (919, 984), 27 | (984, 1048), 28 | (1048, 1112), 29 | (1126, 1200), 30 | (1200, 1294), 31 | (1385, 1456), 32 | (1456, 1543), 33 | (1551, 1637), 34 | (1637, 1732), 35 | (1825, 1913), 36 | (2009, 2077), 37 | (2077, 2158), 38 | ] 39 | 40 | cards: list[vs.VideoNode] = [] 41 | 42 | Path("./creds").mkdir(exist_ok=True) 43 | 44 | for credit_range in credits_ranges: 45 | card = ed[credit_range[0] : credit_range[1]] 46 | dir = Path(f"./creds/{credit_range[0]}-{credit_range[1]}") 47 | dir.mkdir(exist_ok=True) 48 | write: vs.VideoNode = core.imwri.Write(card, "png", dir / "%03d.png") 49 | 50 | def _cb(node, n, result): 51 | print("Wrote Frame") 52 | 53 | for i in range(write.num_frames): 54 | write.get_frame_async_raw(i, _cb) 55 | cards.append(card) 56 | 57 | 58 | ed_highlight_cards = ed[0] 59 | for i, card in enumerate(cards): 60 | ed_highlight_cards = ed_highlight_cards + card.text.Text(i, 5) 61 | ed_highlight_cards = ed_highlight_cards[1:] 62 | 63 | while True: 64 | pass 65 | -------------------------------------------------------------------------------- /2022-Q2/Spy X Family/Spy_X_Family.vpy: -------------------------------------------------------------------------------- 1 | import vapoursynth as vs 2 | import EoEfunc as eoe 3 | import lvsfunc as lvf 4 | import havsfunc as haf 5 | import kagefunc as kgf 6 | from vardefunc.deband import dumb3kdb 7 | 8 | # region setup 9 | 10 | DEFAULT_PATH = r"Spy x Family - S01E01 - 1080p WEB x264 -NanDesuKa (CR).mkv" 11 | DEFAULT_CACHE = 32 12 | DEFAULT_THREADS = 24 13 | 14 | env = eoe.setup_env(globals()) 15 | core: vs._CoreProxy = env["core"] 16 | src_path: str = env["src_path"] 17 | GPU: int = env["GPU"] 18 | debug: bool = env["debug"] 19 | 20 | # endregion setup 21 | 22 | src = core.lsmas.LWLibavSource(src_path) 23 | src = eoe.fmt.set(src, "16") 24 | 25 | rs = eoe.rs.rescale( 26 | src, 27 | 1536, 28 | 864, 29 | "bicubic", 30 | b=0, 31 | c=0.5, 32 | mask_detail=True, 33 | rescale_threshold=0.06, 34 | morpho=False, 35 | maximum=4, 36 | inflate=2, 37 | ) 38 | 39 | bm3d = eoe.dn.BM3D(rs, [1.2, 0], 1, "lc") 40 | knlm = core.knlm.KNLMeansCL(bm3d, d=2, a=3, h=0.6, channels="UV") 41 | 42 | aa = lvf.aa.nnedi3(knlm, opencl=True) 43 | 44 | dehalo = haf.FineDehalo(aa, rx=2.4, darkstr=0, brightstr=1, contra=1) 45 | dehalo = haf.EdgeCleaner(dehalo, strength=4, rmode=13, smode=1, hot=True) 46 | 47 | deband = dumb3kdb(dehalo, 16, [30, 24, 24], [16, 4]) 48 | 49 | grain = kgf.adaptive_grain(deband, 0.2) 50 | 51 | final = grain 52 | final = eoe.fmt.set(final, "10") 53 | final.set_output() 54 | 55 | if debug: 56 | debug_output = eoe.debug_output 57 | debug_output(src, "src") 58 | debug_output(rs, "rs") 59 | debug_output(knlm, "knlm") 60 | debug_output(aa, "aa") 61 | debug_output(dehalo, "dehalo") 62 | debug_output(grain, "grain") 63 | # debug_output(src, "src", fft=True) 64 | -------------------------------------------------------------------------------- /2022-Q2/RikeKoi/RikeKoi.vpy: -------------------------------------------------------------------------------- 1 | import vapoursynth as vs 2 | import EoEfunc as eoe 3 | import lvsfunc as lvf 4 | import havsfunc as haf 5 | import kagefunc as kgf 6 | from vardefunc.deband import dumb3kdb 7 | 8 | # region setup 9 | 10 | DEFAULT_PATH = ( 11 | r"[SubsPlease] Rikei ga Koi ni Ochita no de Shoumei shitemita S2 - 01 (1080p) [6DB3465C].mkv" 12 | ) 13 | DEFAULT_CACHE = 32 14 | DEFAULT_THREADS = 24 15 | 16 | env = eoe.setup_env(globals()) 17 | core: vs._CoreProxy = env["core"] 18 | src_path: str = env["src_path"] 19 | GPU: int = env["GPU"] 20 | debug: bool = env["debug"] 21 | 22 | 23 | # endregion setup 24 | 25 | src = core.lsmas.LWLibavSource(src_path) 26 | src = eoe.fmt.set(src, "16") 27 | 28 | cmde = eoe.dn.CMDE(src, thSAD=100, tr=3) 29 | 30 | aa = lvf.aa.upscaled_sraa(cmde, 1.6, opencl=True) 31 | 32 | dft = core.dfttest.DFTTest( 33 | aa, tbsize=1, planes=[0], slocation=[0, 0, 0.45, 0, 0.5, 2, 0.55, 4, 0.75, 8, 1, 16] 34 | ) 35 | knlm = core.knlm.KNLMeansCL(dft, d=2, a=3, h=0.7) 36 | 37 | cs = eoe.misc.ContraSharpening(knlm, aa.rgvs.Repair(cmde, 14)) 38 | 39 | dehalo = haf.FineDehalo(cs, darkstr=0.0, brightstr=0.8) 40 | 41 | cwarp = core.warp.AWarpSharp2(dehalo, blur=2, type=1, depth=2, planes=[1, 2]) 42 | 43 | deband = dumb3kdb(cwarp, 16, [24, 30, 30], [16, 4]) 44 | 45 | grain = kgf.adaptive_grain(deband, 0.2) 46 | 47 | final = grain 48 | final = eoe.fmt.set(final, "10") 49 | final.set_output() 50 | 51 | if debug: 52 | debug_output = eoe.debug_output 53 | debug_output(src, "src") 54 | debug_output(cmde, "cmde") 55 | debug_output(aa, "aa") 56 | debug_output(cs, "cs") 57 | debug_output(dehalo, "dehalo") 58 | debug_output(cwarp, "cwarp") 59 | debug_output(grain, "grain") 60 | # debug_output(src, "src", fft=True) 61 | -------------------------------------------------------------------------------- /Lupin III S1_3/lupin3_S1.vpy: -------------------------------------------------------------------------------- 1 | from vardefunc.deband import dumb3kdb 2 | import vapoursynth as vs 3 | import EoEfunc as eoe 4 | import lvsfunc as lvf 5 | import havsfunc as haf 6 | 7 | # region setup 8 | 9 | DEFAULT_PATH = r"00007.m2ts" 10 | DEFAULT_CACHE = 32 11 | DEFAULT_THREADS = 24 12 | 13 | env = eoe.setup_env(globals()) 14 | core: vs._CoreProxy = env["core"] 15 | src_path: str = env["src_path"] 16 | GPU: int = env["GPU"] 17 | debug: bool = env["debug"] 18 | 19 | # endregion setup 20 | 21 | src = core.lsmas.LWLibavSource(src_path) 22 | src = eoe.fmt.set(src, "16") 23 | 24 | src = core.std.Crop(src, 240, 240) 25 | 26 | cmde = eoe.dn.CMDE(src, thSAD=100, thSADC=200) 27 | bm3d = eoe.dn.BM3D(cmde, [1.1], 0) 28 | knlm = core.knlm.KNLMeansCL(bm3d, d=2, a=3, h=1.0) 29 | 30 | cs = eoe.misc.ContraSharpening(knlm, src) 31 | 32 | aa = lvf.aa.upscaled_sraa(cs, 2) 33 | 34 | dehalo = haf.FineDehalo(aa, darkstr=0.1, brightstr=0.8) 35 | 36 | cwarp = core.warp.AWarpSharp2(dehalo, blur=2, type=1, depth=4, planes=[1, 2]) 37 | 38 | slocation = [0, 0, 0.5, 0, 0.6, 1, 0.7, 1.5, 0.8, 4, 0.9, 6, 1, 16] 39 | dechecker = core.dfttest.DFTTest(cwarp, sigma=2, slocation=slocation, **eoe.freq._dfttest_args) 40 | 41 | deband = core.average.Mean( 42 | [ 43 | dumb3kdb(cwarp, 14, [24, 32, 32]), 44 | dumb3kdb(cwarp, 18, [30, 38, 38]), 45 | ] 46 | ) 47 | deband = dumb3kdb(deband, threshold=1, grain=[16, 6]) 48 | 49 | grain = eoe.misc.sized_grain(deband, [0.3, 0.1], 6, False) 50 | 51 | final = grain 52 | final = eoe.fmt.set(final, "10") 53 | final.set_output() 54 | 55 | if debug: 56 | debug_output = eoe.debug_output 57 | debug_output(src, "src") 58 | debug_output(cs, "denoise") 59 | debug_output(aa, "aa") 60 | debug_output(cwarp, "cwarp") 61 | debug_output(dechecker, "dechecker") 62 | debug_output(deband, "deband") 63 | debug_output(grain, "grain") 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EoE's Encoding Projects. 2 | 3 | A collection of my (readable) Vapoursynth scripts. All future projects will be committed here, with 4 | past projects possibly getting added slowly assuming I can clean them up. 5 | 6 | - *.vpy -> Vapoursynth Scripts 7 | - *.ini -> Start-BatchJudasEncode config files. 8 | 9 | ## Dependancies 10 | 11 | Dependancies for all projects can be installed automatically using the 12 | [Judas Vapoursynth Install Script](https://blog.eoe.codes/assets/vapoursynth-installation/Vapoursynth%20Install.7z) 13 | (more info on [my blog](https://blog.eoe.codes/vapoursynth%20scripting/2022/04/09/installing-vapoursynth.html)) 14 | 15 | If you just want a list of the most used however, 16 | 17 | - [EoEfunc@master](https://github.com/End-of-Eternity/EoEfunc) (`pip install git+https://github.com/End-of-Eternity/EoEfunc.git`) 18 | - [lvsfunc@c90a8a1](https://github.com/Irrational-Encoding-Wizardry/lvsfunc/tree/c90a8a1ebb79b65a93e02ef9e4775698d87de592) (`pip install git+https://github.com/Irrational-Encoding-Wizardry/lvsfunc.git@c90a8a1ebb79b65a93e02ef9e4775698d87de592`) 19 | - [vardefunc@0624065](https://github.com/Ichunjo/vardefunc/blob/06240655d9e01f29a6ea7d48eba49addf1b56f4d/requirements.txt) (`pip install git+https://github.com/Ichunjo/vardefunc.git@06240655d9e01f29a6ea7d48eba49addf1b56f4d`) 20 | - [havsfunc](https://github.com/HomeOfVapourSynthEvolution/havsfunc) (`pip install havsfunc`) 21 | - [kagefunc](https://github.com/Irrational-Encoding-Wizardry/kagefunc) (`vsrepo install kagefunc`) 22 | - [vsutil](https://github.com/Irrational-Encoding-Wizardry/vsutil) (`pip install vsutil`) 23 | 24 | All of these (except maybe vsutil?) have unlisted plugin dependancies. There's too many to list here 25 | though. I may try to autogenerate a list of dependancies per-project later on. 26 | 27 | You are free to use these scripts however you wish, however I give no guarantees that they will work, 28 | nor that they won't set your machine on fire. If you do use them for anything, credit is much 29 | appreciated. -------------------------------------------------------------------------------- /2022-Q2/Skeleton Knight/skeleton.vpy: -------------------------------------------------------------------------------- 1 | import vapoursynth as vs 2 | import EoEfunc as eoe 3 | import lvsfunc as lvf 4 | import kagefunc as kgf 5 | import havsfunc as haf 6 | from vardefunc.deband import dumb3kdb 7 | from vsutil import get_y, iterate 8 | 9 | # region setup 10 | 11 | DEFAULT_PATH = ( 12 | r"[Erai-raws] Gaikotsu Kishi-sama Tadaima Isekai e Odekake-chuu - 01 [1080p][Multiple" 13 | r" Subtitle][1D9B823B].mkv" 14 | ) 15 | DEFAULT_CACHE = 32 16 | DEFAULT_THREADS = 24 17 | 18 | env = eoe.setup_env(globals()) 19 | core: vs._CoreProxy = env["core"] 20 | src_path: str = env["src_path"] 21 | GPU: int = env["GPU"] 22 | debug: bool = env["debug"] 23 | 24 | # endregion setup 25 | 26 | src = core.lsmas.LWLibavSource(src_path) 27 | src = eoe.fmt.set(src, "16") 28 | 29 | sloc = [0, 0.25, 0.5, 1.5, 0.55, 3, 0.6, 6, 0.75, 16, 1, 16] 30 | dft = core.dfttest.DFTTest(src, planes=[0], tbsize=1, slocation=sloc) 31 | knlm = core.knlm.KNLMeansCL(dft, d=2, a=3, h=0.6, channels="UV") 32 | 33 | credit_mask = core.std.Expr(get_y(knlm), f"x {0.85*65536} > 65535 0 ?") 34 | credit_mask = core.median.TemporalMedian(credit_mask, 12) 35 | credit_mask = iterate(credit_mask, core.std.Maximum, 4) 36 | credit_mask = iterate(credit_mask, core.std.Inflate, 2) 37 | 38 | aa_strong = lvf.aa.upscaled_sraa(knlm, 1.3, opencl=True) 39 | aa_weak = lvf.aa.upscaled_sraa(knlm, 1.6, opencl=True) 40 | aa_credits = lvf.aa.clamp_aa(knlm, aa_strong, aa_weak) 41 | aa_credits = core.std.MaskedMerge(aa_credits, knlm, credit_mask) 42 | aa = aa_weak[:-2400] + aa_credits[-2400:] 43 | 44 | dehalo = haf.FineDehalo(aa, darkstr=0, brightstr=0.8) 45 | 46 | deband = dumb3kdb(dehalo, 16, [24, 16, 16], [16, 4]) 47 | 48 | grain = kgf.adaptive_grain(deband, 0.2) 49 | 50 | final = grain 51 | final = eoe.fmt.set(final, "10") 52 | final.set_output() 53 | 54 | if debug: 55 | debug_output = eoe.debug_output 56 | debug_output(src, "src") 57 | debug_output(knlm, "knlm") 58 | debug_output(aa, "aa") 59 | debug_output(credit_mask, "credit_mask") 60 | debug_output(grain, "grain") 61 | -------------------------------------------------------------------------------- /Lupin III S1_3/lupin3_S2.vpy: -------------------------------------------------------------------------------- 1 | from vardefunc.deband import dumb3kdb 2 | import vapoursynth as vs 3 | import EoEfunc as eoe 4 | import lvsfunc as lvf 5 | import havsfunc as haf 6 | 7 | # region setup 8 | 9 | DEFAULT_PATH = r"00001.m2ts" 10 | DEFAULT_CACHE = 32 11 | DEFAULT_THREADS = 24 12 | 13 | env = eoe.setup_env(globals()) 14 | core: vs._CoreProxy = env["core"] 15 | src_path: str = env["src_path"] 16 | GPU: int = env["GPU"] 17 | debug: bool = env["debug"] 18 | 19 | # endregion setup 20 | 21 | src = core.lsmas.LWLibavSource(src_path) 22 | src = eoe.fmt.set(src, "16") 23 | 24 | # crappy edges moment 25 | src = core.std.Crop(src, 244, 244, 4, 4) 26 | 27 | # horrible chroma moment 28 | cmde = eoe.dn.CMDE(src, thSAD=100, thSADC=200) 29 | bm3d = eoe.dn.BM3D(cmde, [1.1], 0) 30 | knlm = core.knlm.KNLMeansCL(bm3d, d=2, a=3, h=1.0) 31 | 32 | # crap noise means moving this later is a good idea 33 | cs = eoe.misc.ContraSharpening(knlm, src) 34 | 35 | ef = core.edgefixer.ContinuityFixer(cs, 1, 1, 1, 2) 36 | 37 | aa = lvf.aa.upscaled_sraa(cs, 2) 38 | 39 | dehalo = haf.FineDehalo(aa, darkstr=0.1, brightstr=0.8) 40 | 41 | cwarp = core.warp.AWarpSharp2(dehalo, blur=2, type=1, depth=4, planes=[1, 2]) 42 | 43 | slocation = [0, 0, 0.5, 0, 0.6, 1, 0.7, 1.5, 0.8, 4, 0.9, 6, 1, 16] 44 | dechecker = core.dfttest.DFTTest(cwarp, sigma=2, slocation=slocation, **eoe.freq._dfttest_args) 45 | 46 | deband = core.average.Mean( 47 | [ 48 | dumb3kdb(cwarp, 14, [24, 32, 32]), 49 | dumb3kdb(cwarp, 18, [30, 38, 38]), 50 | ] 51 | ) 52 | deband = dumb3kdb(deband, threshold=1, grain=[16, 6]) 53 | 54 | grain = eoe.misc.sized_grain(deband, [0.3, 0.1], 6, False) 55 | 56 | final = grain 57 | final = eoe.fmt.set(final, "10") 58 | final.set_output() 59 | 60 | if debug: 61 | debug_output = eoe.debug_output 62 | debug_output(src, "src") 63 | debug_output(cs, "denoise") 64 | debug_output(aa, "aa") 65 | debug_output(cwarp, "cwarp") 66 | debug_output(dechecker, "dechecker") 67 | debug_output(deband, "deband") 68 | debug_output(grain, "grain") 69 | -------------------------------------------------------------------------------- /Lupin III S1_3/lupin3_S3.vpy: -------------------------------------------------------------------------------- 1 | from vardefunc.deband import dumb3kdb 2 | import vapoursynth as vs 3 | import EoEfunc as eoe 4 | import lvsfunc as lvf 5 | import havsfunc as haf 6 | 7 | # region setup 8 | 9 | DEFAULT_PATH = r"00002.m2ts" 10 | DEFAULT_CACHE = 32 11 | DEFAULT_THREADS = 24 12 | 13 | env = eoe.setup_env(globals()) 14 | core: vs._CoreProxy = env["core"] 15 | src_path: str = env["src_path"] 16 | GPU: int = env["GPU"] 17 | debug: bool = env["debug"] 18 | 19 | # endregion setup 20 | 21 | src = core.lsmas.LWLibavSource(src_path) 22 | src = eoe.fmt.set(src, "16") 23 | 24 | src = core.std.Crop(src, 242, 242, 0, 2) 25 | 26 | cmde = eoe.dn.CMDE(src, thSAD=100, thSADC=200) 27 | bm3d = eoe.dn.BM3D(cmde, [1.1], 0) 28 | knlm = core.knlm.KNLMeansCL(bm3d, d=2, a=3, h=1.0) 29 | 30 | cs = eoe.misc.ContraSharpening(knlm, src) 31 | 32 | # crap noise means moving this later is a good idea 33 | ef = core.edgefixer.ContinuityFixer(cs, 1, 1, 1, 0) 34 | 35 | aa = lvf.aa.upscaled_sraa(ef, 2) 36 | 37 | dehalo = haf.FineDehalo(aa, darkstr=0.1, brightstr=0.8) 38 | 39 | cwarp = core.warp.AWarpSharp2(dehalo, blur=2, type=1, depth=4, planes=[1, 2]) 40 | 41 | slocation = [0, 0, 0.5, 0, 0.6, 1, 0.7, 1.5, 0.8, 4, 0.9, 6, 1, 16] 42 | dechecker = core.dfttest.DFTTest(cwarp, sigma=2, slocation=slocation, **eoe.freq._dfttest_args) 43 | 44 | deband = core.average.Mean( 45 | [ 46 | dumb3kdb(cwarp, 14, [24, 32, 32]), 47 | dumb3kdb(cwarp, 18, [30, 38, 38]), 48 | ] 49 | ) 50 | deband = dumb3kdb(deband, threshold=1, grain=[16, 6]) 51 | 52 | grain = eoe.misc.sized_grain(deband, [0.3, 0.1], 6, False) 53 | 54 | final = grain 55 | final = eoe.fmt.set(final, "10") 56 | final.set_output() 57 | 58 | if debug: 59 | debug_output = eoe.debug_output 60 | debug_output(core.lsmas.LWLibavSource(src_path), "core.lsmas.LWLibavSource(src_path)") 61 | debug_output(src, "src") 62 | debug_output(cs, "denoise") 63 | debug_output(aa, "aa") 64 | debug_output(cwarp, "cwarp") 65 | debug_output(dechecker, "dechecker") 66 | debug_output(deband, "deband") 67 | debug_output(grain, "grain") 68 | -------------------------------------------------------------------------------- /2022-Q2/Date A Live S4/DAL_IV.vpy: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | import vapoursynth as vs 4 | import EoEfunc as eoe 5 | import lvsfunc as lvf 6 | import kagefunc as kgf 7 | from vardefunc.deband import dumb3kdb 8 | from vsutil import get_y 9 | 10 | 11 | # region setup 12 | 13 | DEFAULT_PATH = r"Date A Live - S04E01 - 1080p WEB x264 -NanDesuKa (CR).mkv" 14 | DEFAULT_CACHE = 32 15 | DEFAULT_THREADS = 24 16 | 17 | env = eoe.setup_env(globals()) 18 | core: vs._CoreProxy = env["core"] 19 | src_path: str = env["src_path"] 20 | GPU: int = env["GPU"] 21 | debug: bool = env["debug"] 22 | 23 | # endregion setup 24 | 25 | ep = re.match(r"Date A Live - S04E(\d\d) - 1080p WEB x264 -NanDesuKa \(CR\)\.mkv", src_path) 26 | 27 | if ep is None: 28 | raise ValueError("Couldn't find episode number in file name") 29 | ep = ep.group(1) 30 | 31 | cr = core.lsmas.LWLibavSource(src_path) 32 | funi = core.lsmas.LWLibavSource( 33 | rf"src/Date A Live - S04E{ep} - 1080p WEB H.264 -NanDesuKa (FUNi).mkv" 34 | ) 35 | funi = funi[240:] 36 | cr = cr[: funi.num_frames] 37 | 38 | cmde_cr = eoe.dn.CMDE(cr, 3, 100, refine=2) 39 | cmde_funi = eoe.dn.CMDE(get_y(funi), 3, 100, refine=2) 40 | 41 | # weight CR a little higher because it's better quality 42 | cmde = core.std.Expr([get_y(cmde_cr), cmde_funi], "x 6 * y 5 * + 11 /") 43 | cmde = core.std.ShufflePlanes([cmde, cmde_cr], [0, 1, 2], vs.YUV) 44 | 45 | sloc = [0, 0, 0.4, 1, 0.45, 3, 0.5, 5, 1, 32] 46 | dft = core.dfttest.DFTTest(cmde, tbsize=1, slocation=sloc) 47 | bm3d = eoe.dn.BM3D(dft, [1.3, 0], 1, "lc") 48 | knlm = core.knlm.KNLMeansCL(bm3d, d=2, a=3, h=0.6, channels="UV") 49 | 50 | aa = lvf.aa.nnedi3(knlm, opencl=True) 51 | 52 | # fmt: off 53 | deband = core.average.Mean([ 54 | dumb3kdb(aa, 8, [36, 24, 24], 0), 55 | dumb3kdb(aa, 16, [36, 24, 24], 0), 56 | ]) 57 | deband = dumb3kdb(deband, 16, 1, [16, 4]) 58 | # fmt: on 59 | 60 | grain = kgf.adaptive_grain(deband, 0.2) 61 | 62 | final = grain 63 | final = eoe.fmt.set(final, "10") 64 | final.set_output() 65 | 66 | if debug: 67 | debug_output = eoe.debug_output 68 | debug_output(cr, "cr") 69 | debug_output(funi, "funi") 70 | debug_output(cmde, "cmde") 71 | debug_output(knlm, "knlm") 72 | debug_output(aa, "aa") 73 | debug_output(deband, "deband") 74 | debug_output(grain, "grain") 75 | -------------------------------------------------------------------------------- /2022-Q2/Yuusha Yamemasu/yuusha_yamemasu.vpy: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | import vapoursynth as vs 4 | import EoEfunc as eoe 5 | import lvsfunc as lvf 6 | import kagefunc as kgf 7 | from vsTAAmbk import TAAmbk as taa 8 | from vsutil import get_y, split, join 9 | from vardefunc.deband import dumb3kdb 10 | 11 | # region setup 12 | 13 | DEFAULT_PATH = r"Yuusha, Yamemasu - 01 - 1080p WEB HEVC -NanDesuKa (B-Global).mkv" 14 | DEFAULT_CACHE = 32 15 | DEFAULT_THREADS = 24 16 | 17 | env = eoe.setup_env(globals()) 18 | core: vs._CoreProxy = env["core"] 19 | src_path: str = env["src_path"] 20 | GPU: int = env["GPU"] 21 | debug: bool = env["debug"] 22 | 23 | # endregion setup 24 | 25 | ep = re.match(r"Yuusha, Yamemasu - (\d\d) - 1080p WEB HEVC -NanDesuKa \(B-Global\)\.mkv", src_path) 26 | 27 | if ep is None: 28 | raise ValueError("Couldn't find episode number in file name") 29 | 30 | src_hevc = core.lsmas.LWLibavSource(src_path) 31 | src_avc = core.lsmas.LWLibavSource( 32 | f"src/Yuusha, Yamemasu - {ep.group(1)} - 1080p WEB H.264 -NanDesuKa (B-Global).mkv" 33 | ) 34 | src_hevc = eoe.fmt.set(src_hevc, "16") 35 | src_avc = eoe.fmt.set(src_avc, "16") 36 | 37 | src = core.std.ShufflePlanes( 38 | [core.average.Mean([get_y(src_hevc), get_y(src_avc)]), src_hevc], [0, 1, 2], vs.YUV 39 | ) 40 | 41 | cmde = eoe.dn.CMDE(src, tr=2, thSAD=100) 42 | dark_mask = core.adg.Mask(cmde.std.PlaneStats(), 24) 43 | cmde = core.std.MaskedMerge(cmde, src, dark_mask) 44 | 45 | sloc = [0, 0.25, 0.5, 1, 0.55, 2, 0.6, 4, 0.75, 16, 1, 16] 46 | dft = core.dfttest.DFTTest(cmde, planes=[0], tbsize=1, slocation=sloc) 47 | bm3d = eoe.dn.BM3D(dft, [1, 2], 0, "np") 48 | 49 | planes = split(bm3d) 50 | # can't believe I'm unironically using SangNom 51 | planes[0] = lvf.aa.clamp_aa( 52 | planes[0], lvf.aa.nnedi3(planes[0], opencl=True), taa(planes[0], -3, opencl=True) 53 | ) 54 | # Use this if you don't care about performance and want better quality than SangNom 55 | # planes[0] = lvf.aa.nneedi3_clamp(planes[0], opencl=True) 56 | planes[1] = lvf.aa.nnedi3(planes[1], opencl=True) 57 | planes[2] = lvf.aa.nnedi3(planes[2], opencl=True) 58 | aa = join(planes) 59 | 60 | deband = dumb3kdb(aa, 16, [30, 24, 24], [16, 4]) 61 | 62 | grain = kgf.adaptive_grain(deband, 0.2) 63 | 64 | final = grain 65 | final = eoe.fmt.set(final, "10") 66 | final.set_output() 67 | 68 | if debug: 69 | debug_output = eoe.debug_output 70 | debug_output(src, "src") 71 | debug_output(cmde, "cmde") 72 | debug_output(dark_mask, "dark_mask") 73 | debug_output(bm3d, "bm3d") 74 | debug_output(aa, "aa") 75 | debug_output(grain, "grain") 76 | -------------------------------------------------------------------------------- /2022-Q2/Mahoutsukai Reimeiki/mahoutsukai.vpy: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | import vapoursynth as vs 4 | import EoEfunc as eoe 5 | import havsfunc as haf 6 | import kagefunc as kgf 7 | from vardefunc.deband import dumb3kdb 8 | 9 | 10 | # region setup 11 | 12 | DEFAULT_PATH = r"Mahoutsukai Reimeiki - 01 - 1080p WEB x264 -NanDesuKa (CR).mkv" 13 | DEFAULT_CACHE = 32 14 | DEFAULT_THREADS = 24 15 | 16 | env = eoe.setup_env(globals()) 17 | core: vs._CoreProxy = env["core"] 18 | src_path: str = env["src_path"] 19 | GPU: int = env["GPU"] 20 | debug: bool = env["debug"] 21 | 22 | # endregion setup 23 | 24 | ep = re.match(r"Mahoutsukai Reimeiki - (\d\d) - 1080p WEB x264 -NanDesuKa \(CR\)\.mkv", src_path) 25 | 26 | if ep is None: 27 | raise ValueError("Could not get episode from filename") 28 | ep = ep.group(1) 29 | 30 | src_cr = core.lsmas.LWLibavSource(src_path) 31 | 32 | src_1080_hevc = f"src/Mahoutsukai Reimeiki - {ep} - 1080p WEB HEVC -NanDesuKa (B-Global).mkv" 33 | src_2160_hevc = f"src/Mahoutsukai Reimeiki - {ep} - 2160p WEB HEVC -NanDesuKa (B-Global).mkv" 34 | src_2160_avc = f"src/Mahoutsukai Reimeiki - {ep} - 2160p WEB H.264 -NanDesuKa (B-Global).mkv" 35 | src_1080_hevc = core.lsmas.LWLibavSource(src_1080_hevc) 36 | src_2160_hevc = core.lsmas.LWLibavSource(src_2160_hevc) 37 | src_2160_avc = core.lsmas.LWLibavSource(src_2160_avc) 38 | 39 | resize_args = dict(filter_param_a=0, filter_param_b=0.5, format=vs.YUV420P16) 40 | src_1080_hevc = eoe.fmt.set(src_1080_hevc, "16") 41 | src_2160_hevc = core.resize.Bicubic(src_2160_hevc, 1920, 1080, **resize_args) 42 | src_2160_avc = core.resize.Bicubic(src_2160_avc, 1920, 1080, **resize_args) 43 | 44 | cmde_1080_hevc = eoe.dn.CMDE(src_1080_hevc, 3, 150, refine=1) 45 | cmde_2160_hevc = eoe.dn.CMDE(src_2160_hevc, 3, 150, refine=1) 46 | cmde_2160_avc = eoe.dn.CMDE(src_2160_avc, 3, 150, refine=1) 47 | 48 | cmde = core.average.Mean([cmde_1080_hevc, cmde_2160_avc, cmde_2160_hevc]) 49 | 50 | sloc = [0, 0.25, 0.5, 1.5, 0.5, 4, 0.6, 8, 0.75, 16, 1, 16] 51 | dft = core.dfttest.DFTTest(cmde, planes=[0], tbsize=1, slocation=sloc) 52 | bm3d = eoe.dn.BM3D(dft, [1, 0], 1, "lc") 53 | knlm = core.knlm.KNLMeansCL(bm3d, d=2, a=3, h=0.6, channels="UV") 54 | 55 | dehalo = haf.FineDehalo(knlm, darkstr=0, brightstr=0.7) 56 | 57 | deband = dumb3kdb(dehalo, 16, [24, 24, 24], [16, 4]) 58 | 59 | grain = kgf.adaptive_grain(deband, 0.25) 60 | 61 | final = grain 62 | final = eoe.fmt.set(final, "10") 63 | final.set_output() 64 | 65 | if debug: 66 | debug_output = eoe.debug_output 67 | debug_output(src_1080_hevc, "src_1080_hevc") 68 | debug_output(src_cr, "src_sp") 69 | debug_output( 70 | core.lsmas.LWLibavSource( 71 | "[Judas] Mahoutsukai Reimeiki (The Dawn of the Witch) - S01E01.mkv" 72 | ), 73 | "encode", 74 | ) 75 | # debug_output(src_2160_hevc, "src_2160_hevc") 76 | # debug_output(src_2160_avc, "src_2160_avc") 77 | debug_output(cmde, "cmde") 78 | debug_output(knlm, "knlm") 79 | debug_output(dehalo, "dehalo") 80 | debug_output(grain, "grain") 81 | -------------------------------------------------------------------------------- /2022-Q2/Kaguya-sama S3/kaguya.vpy: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | import vapoursynth as vs 4 | import EoEfunc as eoe 5 | import lvsfunc as lvf 6 | import havsfunc as haf 7 | import kagefunc as kgf 8 | from vardefunc.deband import dumb3kdb 9 | from vsutil import get_y, plane 10 | 11 | 12 | # region setup 13 | 14 | DEFAULT_PATH = ( 15 | r"Kaguya-sama wa Kokurasetai - Tensai-tachi no Renai Zunousen - S03E02 - 1080p WEB x264" 16 | r" -NanDesuKa (CR).mkv" 17 | ) 18 | DEFAULT_CACHE = 32 19 | DEFAULT_THREADS = 24 20 | 21 | env = eoe.setup_env(globals()) 22 | core: vs._CoreProxy = env["core"] 23 | src_path: str = env["src_path"] 24 | GPU: int = env["GPU"] 25 | debug: bool = env["debug"] 26 | 27 | # endregion setup 28 | 29 | ep = re.match( 30 | r"Kaguya-sama wa Kokurasetai - Tensai-tachi no Renai Zunousen - S03E(\d\d) - 1080p WEB x264" 31 | r" -NanDesuKa \(CR\)\.mkv", 32 | src_path, 33 | ) 34 | 35 | if ep is None: 36 | raise ValueError("Couldn't find episode number in file name") 37 | ep = ep.group(1) 38 | 39 | b_avc = f"src/Kaguya-sama wa Kokurasetai S3 - {ep} - 1080p WEB H.264 -NanDesuKa (B-Global).mkv" 40 | b_hevc = f"src/Kaguya-sama wa Kokurasetai S3 - {ep} - 1080p WEB HEVC -NanDesuKa (B-Global).mkv" 41 | 42 | cr = core.lsmas.LWLibavSource(src_path) 43 | b_avc = core.lsmas.LWLibavSource(b_avc) 44 | b_hevc = core.lsmas.LWLibavSource(b_hevc) 45 | 46 | cr = eoe.fmt.set(cr, "16").std.AssumeFPS(fpsnum=24000, fpsden=1001) 47 | b_avc = eoe.fmt.set(b_avc, "16") 48 | b_hevc = eoe.fmt.set(b_hevc, "16") 49 | 50 | cmde_b_hevc = eoe.dn.CMDE(get_y(b_hevc), 3, 100, refine=1, globalmode=eoe.dn.GlobalMode.WRITE) 51 | cmde_cr = eoe.dn.CMDE(get_y(cr), 3, 100, globalmode=eoe.dn.GlobalMode.READ) 52 | cmde_b_avc = eoe.dn.CMDE(get_y(b_avc), 3, 100, globalmode=eoe.dn.GlobalMode.READ) 53 | 54 | cmde_luma = core.std.Expr([cmde_cr, cmde_b_avc, cmde_b_hevc], "x 6 * y 8 * z 9 * + + 23 /") 55 | # minorly better performance than just averaging everything (~1.5%) 56 | chroma_u = core.average.Mean([plane(cr, 1), plane(b_avc, 1), plane(b_hevc, 1)]) 57 | chroma_v = core.average.Mean([plane(cr, 2), plane(b_avc, 2), plane(b_hevc, 2)]) 58 | cmde = core.std.ShufflePlanes([cmde_luma, chroma_u, chroma_v], planes=[0, 0, 0], colorfamily=vs.YUV) 59 | 60 | rs = eoe.rs.rescale( 61 | cmde, 62 | 1554, 63 | 874, 64 | "bicubic", 65 | b=0, 66 | c=0.5, 67 | mask_detail=True, 68 | rescale_threshold=0.05, 69 | morpho=False, 70 | maximum=4, 71 | inflate=2, 72 | ) 73 | 74 | bm3d = eoe.dn.BM3D(rs, [1.2, 1.6], 1, "lc") 75 | 76 | aa = lvf.aa.nnedi3(bm3d, opencl=True) 77 | 78 | dehalo = haf.FineDehalo(aa, rx=2.4, darkstr=0, brightstr=1, contra=1) 79 | dehalo = haf.EdgeCleaner(dehalo, strength=4, rmode=13, smode=1, hot=True) 80 | 81 | deband = dumb3kdb(dehalo, 16, [32, 24, 24], [16, 4]) 82 | 83 | grain = kgf.adaptive_grain(deband, 0.2, luma_scaling=4) 84 | 85 | final = grain 86 | final = eoe.fmt.set(final, "10") 87 | final.set_output() 88 | 89 | if debug: 90 | debug_output = eoe.debug_output 91 | debug_output(b_hevc, "b_hevc") 92 | debug_output(b_avc, "b_avc") 93 | debug_output(cr, "cr") 94 | debug_output(cmde, "cmde") 95 | debug_output(rs, "rs") 96 | debug_output(bm3d, "bm3d") 97 | debug_output(dehalo, "dehalo") 98 | debug_output(deband, "deband") 99 | -------------------------------------------------------------------------------- /2022-Q2/Cuckoos/Cuckoos.vpy: -------------------------------------------------------------------------------- 1 | import vapoursynth as vs 2 | import EoEfunc as eoe 3 | import lvsfunc as lvf 4 | import havsfunc as haf 5 | from debandshit import placebo_deband 6 | 7 | # region setup 8 | 9 | DEFAULT_PATH = r"[SubsPlease] Kakkou no Iinazuke - 01 (1080p) [46444F07].mkv" 10 | DEFAULT_CACHE = 32 11 | DEFAULT_THREADS = 24 12 | 13 | env = eoe.setup_env(globals()) 14 | core: vs._CoreProxy = env["core"] 15 | src_path: str = env["src_path"] 16 | GPU: int = env["GPU"] 17 | debug: bool = env["debug"] 18 | 19 | 20 | def rescale( 21 | src: vs.VideoNode, 22 | width: int = None, 23 | height: int = 0, 24 | kernel: str = "bilinear", 25 | taps: int = 4, 26 | b: float = 1 / 3, 27 | c: float = 1 / 3, 28 | mask_detail: bool = False, 29 | rescale_threshold: float = 0.015, 30 | get_mask: bool = False, 31 | **mask_args, 32 | ) -> vs.VideoNode: 33 | from EoEfunc.format import set_format, make_similar, make_similar_mask 34 | from vsutil import split, join, get_y 35 | import kagefunc as kgf 36 | import fvsfunc as fvf 37 | import nnedi3_rpow2 38 | 39 | if not height: 40 | raise ValueError("rescale: you need to specify a value for the output height") 41 | 42 | only_luma = src.format.num_planes == 1 43 | 44 | planes = split(src) 45 | planes[0] = descaled = make_similar( 46 | kgf._descale_luma(set_format(planes[0], "s"), width, height, kernel, taps, b, c), planes[0] 47 | ) 48 | 49 | # here are the only changes to rescale 50 | planes[0] = eoe.dn.BM3D(planes[0], [1.3, 0], 0, "fast") 51 | planes[0] = lvf.aa.nnedi3(planes[0], True) 52 | 53 | planes[0] = nnedi3_rpow2.nnedi3cl_rpow2(planes[0], rfactor=2) 54 | planes[0] = core.resize.Spline36(planes[0], src.width, src.height) 55 | 56 | if only_luma and not (mask_detail or get_mask): 57 | return planes[0] 58 | 59 | if mask_detail or get_mask: 60 | upscaled = fvf.Resize(descaled, src.width, src.height, kernel=kernel, taps=taps, a1=b, a2=c) 61 | mask = eoe.rs.get_descale_mask(get_y(src), upscaled, rescale_threshold, **mask_args) 62 | if mask_detail: 63 | planes[0] = core.std.MaskedMerge(planes[0], get_y(src), mask) 64 | scaled = join(planes) 65 | scaled = core.resize.Point(scaled, format=src.format) 66 | return (scaled, make_similar_mask(mask, scaled)) if get_mask else scaled 67 | 68 | 69 | # endregion setup 70 | 71 | src = core.lsmas.LWLibavSource(src_path) 72 | src = eoe.fmt.set(src, "16") 73 | 74 | # I need to add a "filter" function to rescale so that i dont have to copy paste the code in every 75 | # time i want to do something whilst descaled. 76 | rs, rs_mask = rescale( 77 | src, 78 | 1552, 79 | 873, 80 | "bicubic", 81 | b=0, 82 | c=0.5, 83 | mask_detail=True, 84 | morpho=False, 85 | rescale_threshold=0.03, 86 | get_mask=True, 87 | ) 88 | 89 | knlm = core.knlm.KNLMeansCL(rs, d=1, a=3, h=0.6, channels="UV") 90 | 91 | dehalo = haf.FineDehalo(knlm, 2, darkstr=0, brightstr=0.6) 92 | 93 | deband = placebo_deband(dehalo, 16, 2, 1, 2) 94 | 95 | final = deband 96 | final = eoe.fmt.set(final, "10") 97 | final.set_output() 98 | 99 | if debug: 100 | debug_output = eoe.debug_output 101 | debug_output(src, "src") 102 | debug_output(rs, "rs") 103 | debug_output(rs_mask, "rs_mask") 104 | debug_output(knlm, "knlm") 105 | debug_output(dehalo, "dehalo") 106 | debug_output(deband, "deband") 107 | -------------------------------------------------------------------------------- /2022-Q2/Murabito/murabito.vpy: -------------------------------------------------------------------------------- 1 | import vapoursynth as vs 2 | import EoEfunc as eoe 3 | import lvsfunc as lvf 4 | from vardefunc.deband import dumb3kdb 5 | import kagefunc as kgf 6 | import havsfunc as haf 7 | 8 | # region setup 9 | 10 | DEFAULT_PATH = ( 11 | r"Shijou Saikyou no Daimaou, Murabito A ni Tensei suru - 01 - 1080p WEB x264 -NanDesuKa" 12 | r" (CR).mkv" 13 | ) 14 | DEFAULT_CACHE = 32 15 | DEFAULT_THREADS = 24 16 | 17 | env = eoe.setup_env(globals()) 18 | core: vs._CoreProxy = env["core"] 19 | src_path: str = env["src_path"] 20 | GPU: int = env["GPU"] 21 | debug: bool = env["debug"] 22 | 23 | 24 | def rescale_f( 25 | src: vs.VideoNode, 26 | width: int = None, 27 | height: int = 0, 28 | kernel: str = "bilinear", 29 | taps: int = 4, 30 | b: float = 1 / 3, 31 | c: float = 1 / 3, 32 | mask_detail: bool = False, 33 | rescale_threshold: float = 0.015, 34 | get_mask: bool = False, 35 | **mask_args, 36 | ) -> vs.VideoNode: 37 | from EoEfunc.format import set_format, make_similar, make_similar_mask 38 | from vsutil import split, join, get_y 39 | import kagefunc as kgf 40 | import fvsfunc as fvf 41 | import nnedi3_rpow2 42 | 43 | if not height: 44 | raise ValueError("rescale: you need to specify a value for the output height") 45 | 46 | only_luma = src.format.num_planes == 1 47 | 48 | planes = split(src) 49 | planes[0] = descaled = make_similar( 50 | kgf._descale_luma(set_format(planes[0], "s"), width, height, kernel, taps, b, c), planes[0] 51 | ) 52 | 53 | sloc = [0, 1, 0.3, 1, 0.45, 2, 0.55, 4, 0.6, 6, 0.75, 16, 1, 16] 54 | planes[0] = core.dfttest.DFTTest(planes[0], tbsize=1, slocation=sloc) 55 | planes[0] = eoe.dn.BM3D(planes[0], [1.1, 0], 1, "lc") 56 | 57 | planes[0] = nnedi3_rpow2.nnedi3cl_rpow2(planes[0], rfactor=2) 58 | planes[0] = core.resize.Spline36(planes[0], src.width, src.height) 59 | 60 | if only_luma and not (mask_detail or get_mask): 61 | return planes[0] 62 | 63 | if mask_detail or get_mask: 64 | upscaled = fvf.Resize(descaled, src.width, src.height, kernel=kernel, taps=taps, a1=b, a2=c) 65 | mask = eoe.rs.get_descale_mask(get_y(src), upscaled, rescale_threshold, **mask_args) 66 | if mask_detail: 67 | planes[0] = core.std.MaskedMerge(planes[0], get_y(src), mask) 68 | scaled = join(planes) 69 | scaled = core.resize.Point(scaled, format=src.format) 70 | return (scaled, make_similar_mask(mask, scaled)) if get_mask else scaled 71 | 72 | 73 | # endregion setup 74 | 75 | src = core.lsmas.LWLibavSource(src_path) 76 | src = eoe.fmt.set(src, "16") 77 | 78 | rescale, rescale_mask = rescale_f( 79 | src, 80 | 1440, 81 | 810, 82 | "bicubic", 83 | b=0, 84 | c=1 / 2, 85 | mask_detail=True, 86 | rescale_threshold=0.03, 87 | morpho=False, 88 | maximum=3, 89 | inflate=3, 90 | get_mask=True, 91 | ) 92 | 93 | knlm = core.knlm.KNLMeansCL(rescale, d=2, a=3, h=0.6, channels="UV") 94 | 95 | aa = lvf.aa.nnedi3(knlm, opencl=True) 96 | aa = core.std.MaskedMerge(aa, knlm, rescale_mask) 97 | 98 | dehalo = haf.FineDehalo(aa, darkstr=0, brightstr=0.8, thlima=112) 99 | 100 | deband = dumb3kdb(dehalo, 16, [28, 16, 16], [48, 4]) 101 | 102 | grain = kgf.adaptive_grain(deband, 0.25, luma_scaling=4) 103 | 104 | final = grain 105 | final = eoe.fmt.set(final, "10") 106 | final.set_output() 107 | 108 | if debug: 109 | debug_output = eoe.debug_output 110 | debug_output(src, "src") 111 | debug_output( 112 | core.lsmas.LWLibavSource( 113 | "[Judas] Shijou Saikyou no Daimaou, Murabito A ni Tensei suru - S01E01 INCOMPLETE.mkv" 114 | ) 115 | ) 116 | debug_output( 117 | core.lsmas.LWLibavSource( 118 | "[EMBER] Shijou Saikyou no Daimaou, Murabito A ni Tensei suru - 01.mkv" 119 | ), 120 | "ember", 121 | ) 122 | debug_output(rescale, "rescale") 123 | debug_output(rescale_mask, "rescale_mask") 124 | # debug_output(dft, "dft") 125 | # debug_output(bm3d, "bm3d") 126 | debug_output(knlm, "knlm") 127 | debug_output(aa, "aa") 128 | debug_output(deband, "deband") 129 | debug_output(grain, "grain") 130 | -------------------------------------------------------------------------------- /2022-Q2/Honzuki S3/Honzuki.vpy: -------------------------------------------------------------------------------- 1 | import vapoursynth as vs 2 | import EoEfunc as eoe 3 | import lvsfunc as lvf 4 | import havsfunc as haf 5 | import kagefunc as kgf 6 | from vardefunc.deband import dumb3kdb 7 | 8 | # region setup 9 | 10 | DEFAULT_PATH = r"Honzuki no Gekokujou - S03E01 - 1080p WEB x264 -NanDesuKa (CR).mkv" 11 | DEFAULT_CACHE = 32 12 | DEFAULT_THREADS = 24 13 | 14 | env = eoe.setup_env(globals()) 15 | core: vs._CoreProxy = env["core"] 16 | src_path: str = env["src_path"] 17 | GPU: int = env["GPU"] 18 | debug: bool = env["debug"] 19 | 20 | 21 | def rescale( 22 | src: vs.VideoNode, 23 | width: int = None, 24 | height: int = 0, 25 | kernel: str = "bilinear", 26 | taps: int = 4, 27 | b: float = 1 / 3, 28 | c: float = 1 / 3, 29 | mask_detail: bool = False, 30 | rescale_threshold: float = 0.015, 31 | get_mask: bool = False, 32 | **mask_args, 33 | ) -> vs.VideoNode: 34 | from EoEfunc.format import set_format, make_similar, make_similar_mask 35 | from vsutil import split, join, get_y 36 | import kagefunc as kgf 37 | import fvsfunc as fvf 38 | import nnedi3_rpow2 39 | 40 | if not height: 41 | raise ValueError("rescale: you need to specify a value for the output height") 42 | 43 | only_luma = src.format.num_planes == 1 44 | 45 | planes = split(src) 46 | planes[0] = descaled = make_similar( 47 | kgf._descale_luma(set_format(planes[0], "s"), width, height, kernel, taps, b, c), planes[0] 48 | ) 49 | 50 | # denoise whilst descaled 51 | planes[0] = eoe.dn.BM3D(planes[0], [1.1, 0], 1, "lc") 52 | 53 | planes[0] = nnedi3_rpow2.nnedi3cl_rpow2(planes[0], rfactor=2) 54 | planes[0] = core.resize.Spline36(planes[0], src.width, src.height) 55 | 56 | if only_luma and not (mask_detail or get_mask): 57 | return planes[0] 58 | 59 | if mask_detail or get_mask: 60 | upscaled = fvf.Resize(descaled, src.width, src.height, kernel=kernel, taps=taps, a1=b, a2=c) 61 | mask = eoe.rs.get_descale_mask(get_y(src), upscaled, rescale_threshold, **mask_args) 62 | if mask_detail: 63 | planes[0] = core.std.MaskedMerge(planes[0], get_y(src), mask) 64 | scaled = join(planes) 65 | scaled = core.resize.Point(scaled, format=src.format) 66 | return (scaled, make_similar_mask(mask, scaled)) if get_mask else scaled 67 | 68 | 69 | # endregion setup 70 | 71 | src = core.lsmas.LWLibavSource(src_path) 72 | src = eoe.fmt.set(src, "16") 73 | 74 | # denoise inside rescale 75 | rs, rs_mask = rescale( 76 | src, 77 | 1444, 78 | 812, 79 | "bicubic", 80 | b=0, 81 | c=0.5, 82 | mask_detail=False, 83 | get_mask=True, 84 | rescale_threshold=0.05, 85 | morpho=False, 86 | maximum=4, 87 | inflate=2, 88 | ) 89 | 90 | # seperate denoise for areas not rescaled 91 | sloc = [0, 0, 0.3, 0, 0.45, 2, 0.55, 4, 0.6, 6, 0.75, 16, 1, 16] 92 | dft = core.dfttest.DFTTest(src, tbsize=1, slocation=sloc) 93 | # the ED is cursed 94 | dn = eoe.dn.BM3D(dft, [2, 0], 2, "lc") 95 | 96 | aa = lvf.aa.nnedi3(dn, opencl=True) 97 | aa = core.rgvs.Repair(aa, dn, 17) 98 | 99 | 100 | def select_rs(n, f: vs.VideoFrame): 101 | if f.props["PlaneStatsAverage"] > 0.001: 102 | return aa 103 | else: 104 | return rs 105 | 106 | 107 | # select whether to rescale based on rescale mask 108 | credits_fix = core.std.FrameEval(dn, select_rs, rs_mask.std.PlaneStats(), [dn, rs]) 109 | 110 | # ideally this would go before the frame eval, but i'm running out of vram here 111 | knlm = core.knlm.KNLMeansCL(credits_fix, d=2, a=3, h=0.7, channels="UV") 112 | 113 | dh = haf.FineDehalo(knlm, darkstr=0, brightstr=0.9) 114 | 115 | deband = dumb3kdb(dh, 16, [30, 24, 24], [8, 2]) 116 | 117 | grain = kgf.adaptive_grain(deband, 0.2, luma_scaling=8) 118 | 119 | final = grain 120 | final = eoe.fmt.set(final, "10") 121 | final.set_output() 122 | 123 | if debug: 124 | debug_output = eoe.debug_output 125 | debug_output(src, "src") 126 | # debug_output(rs, "rs") 127 | debug_output(dn, "dn") 128 | debug_output(aa, "aa") 129 | debug_output(credits_fix, "credits_fix") 130 | debug_output(rs_mask.std.PlaneStats(), "rs_mask", frame_props=True) 131 | debug_output(knlm, "knlm") 132 | debug_output(dh, "dh") 133 | debug_output(grain, "grain") 134 | -------------------------------------------------------------------------------- /Cowboy Bebop/Bebop.vpy: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import sys 3 | from pathlib import Path 4 | 5 | import vapoursynth as vs 6 | import EoEfunc as eoe 7 | import lvsfunc as lvf 8 | import havsfunc as haf 9 | from debandshit import placebo_deband 10 | from vardefunc.deband import dumb3kdb 11 | 12 | # region setup 13 | 14 | DEFAULT_PATH = r"[JySzE] Cowboy Bebop - 01 [v2].mkv" 15 | DEFAULT_CACHE = 32 16 | DEFAULT_THREADS = 24 17 | 18 | env = eoe.setup_env(globals()) 19 | core: vs._CoreProxy = env["core"] 20 | src_path: str = env["src_path"] 21 | GPU: int = env["GPU"] 22 | debug: bool = env["debug"] 23 | 24 | 25 | def extract_timestamps(path: str) -> None: 26 | # workaround to generate only during inital frame count 27 | if not debug and "max_cache_size" not in globals(): 28 | # delete existing timestamps 29 | Path("timestamps.txt").exists() and Path("timestamps.txt").unlink() 30 | print("Extracting timestamps...", file=sys.stderr) 31 | if subprocess.run(["mkvextract", "timecodes_v2", path, "0:timestamps.txt"]).returncode: 32 | raise RuntimeError("Failed to extract timestamps") 33 | 34 | 35 | # endregion setup 36 | 37 | 38 | extract_timestamps(src_path) 39 | src = core.lsmas.LWLibavSource(src_path) 40 | src = core.std.PlaneStats(src) 41 | src = eoe.fmt.set(src, 16) 42 | 43 | # because this script is for a mini, I'm going to be doing far more agressive filtering to get rid 44 | # of the excessive source grain (honestly looks good, but wont compress, at all). This *will* also 45 | # destroy fine details, but they wouldn't have been encoded properly anyway. If you use this script, 46 | # I'd recommend testing lower denoise strengths with some masking. 47 | 48 | # A good test scene for this destruction is EP06 frame 29043 49 | 50 | # cmde is magic, but the heavy dynamic grain is almost impossible to get rid of without destroying 51 | # lineart in difficult situations. It's also not possible to effectively freq_merge due to the size 52 | # of the grain. cmde also struggles with noise near edges. 53 | cmde_pre = eoe.dn.CMDE(src, 3, 250, 250, prefilter=3, freq_merge=False, contrasharp=True) 54 | # bilateral is used to clean up cmde, and does a somewhat decent job of leaving the lineart alone. 55 | bilateral = core.bilateralgpu.Bilateral(cmde_pre, 1) 56 | # bm3d using cmde+bilateral as a reference. Extremely strong. Manages to repair back many details 57 | # destroyed previously. 58 | bm3d = eoe.dn.BM3D(src, 5, profile="np", ref=bilateral, refine=2) 59 | # bm3d is brings back a little too much of the previous shit, so cmde again to get rid of that. 60 | # more accurate motion vectors generated here seem to do an overall good job. 61 | cmde_post = eoe.dn.CMDE(bm3d, tr=3, thSAD=250, freq_merge=False) 62 | # mask cmde_post using adg, sort of fixes cmde's tendancy to ghost lines in dark areas. 63 | # not as effective as freq_merge, but as above, freq_merge isnt possible. 64 | cmde_post = core.std.MaskedMerge(cmde_post, bm3d, core.adg.Mask(src, 24)) 65 | # contra sharp to regain some sharpness. 66 | cs = eoe.misc.ContraSharpening(cmde_post, cmde_pre) 67 | 68 | knlm = core.knlm.KNLMeansCL(cs, d=2, a=3, h=0.7, channels="uv") 69 | 70 | # reconnect lines. sort of goes against the art design, but so does removing the grain, so nvm. 71 | # some aliasing has been upscaled and is basically impossible to get rid of. see EP01 frame 4142 72 | aa = lvf.aa.upscaled_sraa(knlm, 1.5, opencl=True) 73 | 74 | # strong edgecleaner to fix up remaining mosquito noise around lines 75 | dehalo = haf.FineDehalo(aa, rx=2, darkstr=0.3, brightstr=1) 76 | dehalo = haf.EdgeCleaner(dehalo, strength=6, rmode=17, smode=1, hot=True) 77 | 78 | deband = core.average.Mean( 79 | [ 80 | # placebo did a better job on this kind of banding than f3kdb. 81 | # average to attempt to negate detail loss 82 | placebo_deband(dehalo, 12, [2, 1], 1, 0), 83 | placebo_deband(dehalo, 16, [3, 1], 1, 0), 84 | placebo_deband(dehalo, 20, [3, 1], 1, 0), 85 | dumb3kdb(dehalo, 16, [28, 16], 0), 86 | ] 87 | ) 88 | # no debanding, only grain. adaptive_grain unnecessary after this 89 | deband = placebo_deband(deband, 16, 0, 1, [3, 0]) 90 | 91 | final = deband 92 | final = eoe.fmt.set(final, "10") 93 | final.set_output() 94 | 95 | if debug: 96 | debug_output = eoe.debug_output 97 | debug_output(src, "src") 98 | debug_output("[Judas] Cowboy Bebop - S01E01 - Script v0.mkv", "encode") 99 | debug_output(cmde_pre, "cmde") 100 | debug_output(bilateral, "bilateral") 101 | debug_output(bm3d, "bm3d") 102 | debug_output(knlm, "knlm") 103 | debug_output(aa, "aa") 104 | debug_output(dehalo, "dehalo") 105 | debug_output(deband, "deband") 106 | -------------------------------------------------------------------------------- /Cowboy Bebop/Bebop_23.vpy: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import sys 3 | import numpy as np 4 | from functools import partial 5 | from pathlib import Path 6 | 7 | import vapoursynth as vs 8 | import EoEfunc as eoe 9 | import havsfunc as haf 10 | import lvsfunc as lvf 11 | from debandshit import placebo_deband 12 | from vardefunc.deband import dumb3kdb 13 | from vsutil import get_y, split, join 14 | from vsdpir import DPIR 15 | 16 | # region setup 17 | 18 | DEFAULT_PATH = r"[JySzE] Cowboy Bebop - 23 [v2].mkv" 19 | DEFAULT_CACHE = 32 20 | DEFAULT_THREADS = 24 21 | 22 | env = eoe.setup_env(globals()) 23 | core: vs._CoreProxy = env["core"] 24 | src_path: str = env["src_path"] 25 | GPU: int = env["GPU"] 26 | debug: bool = env["debug"] 27 | 28 | 29 | def extract_timestamps(path: str) -> None: 30 | # workaround to generate only during inital frame count 31 | if not debug and "max_cache_size" not in globals(): 32 | # delete existing timestamps 33 | Path("timestamps.txt").exists() and Path("timestamps.txt").unlink() 34 | print("Extracting timestamps...", file=sys.stderr) 35 | if subprocess.run(["mkvextract", "timecodes_v2", path, "0:timestamps.txt"]).returncode: 36 | raise RuntimeError("Failed to extract timestamps") 37 | 38 | 39 | def choose_tv(clip, tv, not_tv, thr=180, location=(724, 210)): 40 | assert tv.format == not_tv.format and tv.width == not_tv.width and tv.height == not_tv.height 41 | 42 | if debug: 43 | tv = core.text.Text(tv, "tv", 9) 44 | not_tv = core.text.Text(not_tv, "not tv", 9) 45 | 46 | def choose_func(n, f: vs.VideoFrame) -> vs.VideoFrame: 47 | return tv if np.array(f[0], copy=False)[location[1], location[0]] > thr else not_tv 48 | 49 | fft = core.fftspectrum.FFTSpectrum(get_y(clip), False) 50 | return core.std.FrameEval(tv, choose_func, fft, [tv, not_tv]) 51 | 52 | 53 | def dfttest(clip, **dfttest_args): 54 | keys = dfttest_args.keys() 55 | if not any(param in keys for param in ["slocation", "ssx", "ssy", "sst"]): 56 | dfttest_args.update(slocation=eoe.freq._slocation) 57 | if "sst" in keys and ("tbsize" not in keys or keys["tbsize"] < 2): 58 | raise ValueError("tbsize should be > 1 when using sst") 59 | kwargs = {**eoe.freq._dfttest_args, **dfttest_args} 60 | return core.dfttest.DFTTest(clip, **kwargs) 61 | 62 | 63 | def merge_frequency(low, hi, **dfttest_args): 64 | hif = core.std.MakeDiff(hi, dfttest(hi, **dfttest_args)) 65 | clip = core.std.MergeDiff(dfttest(low, **dfttest_args), hif) 66 | return clip 67 | 68 | 69 | # endregion setup 70 | 71 | 72 | extract_timestamps(src_path) 73 | src = core.lsmas.LWLibavSource(src_path) 74 | src = core.std.PlaneStats(src) 75 | src8 = src 76 | src = eoe.fmt.set(src, 16) 77 | 78 | 79 | # region: not tv 80 | 81 | cmde_pre = eoe.dn.CMDE(src, 3, 250, 250, prefilter=3, freq_merge=False, contrasharp=True) 82 | bilateral = core.bilateralgpu.Bilateral(cmde_pre, 1, use_shared_memory=False) 83 | bm3d = eoe.dn.BM3D(src, 5, profile="np", ref=bilateral, refine=2) 84 | cmde_post = eoe.dn.CMDE(bm3d, tr=3, thSAD=250, freq_merge=False) 85 | cmde_post = core.std.MaskedMerge(cmde_post, bm3d, core.adg.Mask(src, 24)) 86 | cs = eoe.misc.ContraSharpening(cmde_post, cmde_pre) 87 | knlm = core.knlm.KNLMeansCL(cs, d=2, a=3, h=0.7, channels="uv") 88 | aa = lvf.aa.upscaled_sraa(knlm, 1.5, opencl=True) 89 | 90 | dehalo = haf.HQDeringmod( 91 | aa, core.bilateral.Gaussian(aa, 3), mrad=6, msmooth=2, mthr=150, minp=0, darkthr=10, thr=0 92 | ) 93 | lmask = core.std.Sobel(get_y(dehalo)).std.Maximum().std.Expr("x 2 *") 94 | dehalo = core.std.MaskedMerge(dehalo, aa, lmask) 95 | dehalo = haf.FineDehalo(dehalo, rx=2, darkstr=0.4, brightstr=1) 96 | dehalo = haf.EdgeCleaner(dehalo, strength=6, rmode=17, smode=1, hot=True) 97 | 98 | # fmt: off 99 | deband = core.average.Mean([ 100 | placebo_deband(dehalo, 12, [2, 1], 1, 0), 101 | placebo_deband(dehalo, 16, [3, 1], 1, 0), 102 | placebo_deband(dehalo, 20, [3, 1], 1, 0), 103 | dumb3kdb(dehalo, 16, [28, 16], 0), 104 | ]) 105 | # fmt: on 106 | deband = placebo_deband(deband, 16, 0, 1, [3, 0]) 107 | 108 | ntv = deband 109 | 110 | # endregion: not tv 111 | 112 | # region: tv 113 | 114 | OVERLAP = 8 115 | 116 | planes = split(src) 117 | # fmt: off 118 | interleaved = core.std.Interleave([ 119 | core.std.Crop(planes[0], 0, src.width // 2 - OVERLAP), 120 | core.std.Crop(planes[0], src.width // 2 - OVERLAP, 0), 121 | core.std.AddBorders(core.std.StackVertical(planes[1:]), right=OVERLAP, color=32768) 122 | ]) 123 | # fmt: on 124 | processed = eoe.fmt.process_as(interleaved, partial(DPIR, strength=10, trt=True), "s") 125 | left, right, chroma = processed[::3], processed[1::3], processed[2::3] 126 | left = core.std.Crop(left, 0, OVERLAP) 127 | right = core.std.Crop(right, OVERLAP, 0) 128 | planes[0] = core.std.StackHorizontal([left, right]) 129 | planes[1] = core.std.Crop(chroma, 0, OVERLAP, 0, chroma.height // 2) 130 | planes[2] = core.std.Crop(chroma, 0, OVERLAP, chroma.height // 2, 0) 131 | 132 | dpir = join(planes) 133 | 134 | tv_cmde = eoe.dn.CMDE( 135 | dpir, 136 | 3, 137 | 500, 138 | 250, 139 | refine=5, 140 | prefilter=core.std.BoxBlur(dpir, 0, 6, 2, 1, 1), 141 | freq_merge=False, 142 | contrasharp=False, 143 | ) 144 | tv_cmde = merge_frequency( 145 | dpir, 146 | tv_cmde, 147 | slocation=None, 148 | sigma=1024, 149 | ssx=[0.0, 0, 0.03, 0, 0.06, 16, 0.15, 56, 0.2, 1024, 1.0, 1024], 150 | smode=1, 151 | sbsize=8, 152 | sosize=6, 153 | ) 154 | 155 | tv = tv_cmde 156 | 157 | # endregion: tv 158 | 159 | chosen = choose_tv(src8, tv, ntv) 160 | 161 | final = chosen 162 | final = eoe.fmt.set(final, "10") 163 | final.set_output() 164 | 165 | if debug: 166 | debug_output = eoe.debug_output 167 | debug_output(choose_tv(src8, src, src), "src") 168 | debug_output(src, "src", fft=True) 169 | debug_output(aa, "aa") 170 | debug_output(dehalo, "dehalo") 171 | debug_output(deband, "deband") 172 | debug_output(tv_cmde, "tv_cmde") 173 | debug_output(dpir, "dpir") 174 | debug_output(tv, "tv") 175 | debug_output(ntv, "ntv") 176 | debug_output(chosen, "chosen") 177 | 178 | print("Eval Done", file=sys.stderr) 179 | --------------------------------------------------------------------------------