SyntaxHighlighter Evolved VS and AVS Brush

SyntaxHighlighter Evolved VS and AVS Brush

IT, 其他

根据SyntaxHighlighter github文档制成,添加大量avs/vs常用函数。

由于函数的数量远大于官方自带的Script,因此页面往往需要更长的加载时间。

针对这个问题,可以根据需求删除不常用的函数,减少页面渲染时间

AviSynth Brush:

https://github.com/amefs/brush-Avisynth

代码效果示例:

#LoadSource
src8 = AVISource("00007.avi")

#Set Target Size
width = 1280
hight = 720

#Resize
src8 = Spline36Resize(src8, width, hight)

#RGB24 -> YV24
src8 = ConvertToYV24(src8, matrix="Rec709")

#8bit -> 16bit stack
src16 = U16(src8, stack=true)

#8bit YV24 -> 8bit YV12 & stacked 16bit YV24 -> stacked 16bit YV12
src8 = ConvertToYV12(src8, chromaresample="spline36", ChromaOutplacement="MPEG2")
U = src16.UtoY8(). Dither_resize16(width/2, hight/2, src_left=-0.5)
V = src16.VtoY8(). Dither_resize16(width/2, hight/2, src_left=-0.5)
src16 = YToUV(U, V, src16)

#denoise&debend
nr16 = KNLMeansCL (src16, cmode=False, h=0.5, s=3, d=2, a=2, device_type="GPU", device_id=1)
dbed = f3kdb(nr16, 8,48,36,36,0,0, input_mode=1, output_mode=1)
dbed = f3kdb(dbed, 16,36,40,40,0,0, input_mode=1, output_mode=1)
last = src16
dbed = Dither_limit_dif16(dbed, thr=0.4, elast=2.0)

#adaptive ordered dither
last = dbed
res = ditherpost(mode=0, ampo=1.5, mask=src8.mt_lut("x 32 +").ditherBuildMask())

#Output
res

VapourSynth Brush:

https://github.com/amefs/brush-VapourSynth

代码效果示例:

import sys
import vapoursynth as vs
import mvsfunc as mvf
import functools
core = vs.get_core(accept_lowercase = True)
core.max_cache_size = 5000
src = core.lsmas.LWLibavSource(r"%File1%", format = "yuv420p16").resize.Bicubic(width=1280, height=720,format=vs.YUV420P16 )
opt = core.lsmas.LWLibavSource(r"%File2%", format = "yuv420p16")
cmp = mvf.PlaneCompare(opt, src, mae = False, rmse = False, cov = False, corr = False)
def callback(n, clip, f):
print(n, f.props.PlanePSNR)
return clip
cmp = core.std.FrameEval(cmp, functools.partial(callback, clip = cmp), prop_src =[cmp])
cmp.set_output()

Amefs, EFS, Vapoursynth, Wordpress
上一篇文章
PR 帧服务器桥接压制教程
下一篇文章
Clementine 使用ALSA调用USB声卡

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Fill out this field
Fill out this field
请输入有效的电子邮箱地址。

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

keyboard_arrow_up