版面规则
提问时请注意:尽量详细描述操作过程、AVS脚本内容等,最好能写出片名,只贴图有时无法看出问题原因。
提示:发布原创内容请尽量使用附件上传。使用网盘会出现过期失效的问题,请注意。
头像
06_taro
核心会员
核心会员
帖子: 998
注册时间: 2010-09-22 18:32
来自: United Kingdom
联系: 网站

AddGrain & Deband 工具包(LumaDB(L), GrainFactory(L), f3kgrain)

Download:

LumaDB(8-bit debanding filter): LumaDB-0.7.rar

LumaDBLite(16-bit debanding filter): LumaDBL-0.7.rar

GrainFactory3mod(8-bit luma segmented grain generator): GrainFactory3mod_v1.2.avsi

GrainFactoryLite(16-bit luma segmented grain generator): GrainFactoryLite_v1.2.avsi

f3kgrain(Another 8/16-bit luma adaptive grain generator): f3kgrain_v0.4.avsi

之前分成很多零散的帖子,然而這五個工具相關性很高,更新起來太不爽,於是合併。這五個工具的原帖不會繼續更新。
介紹見下面幾樓。
上次由 06_taro 在 2012-05-21 7:51,总共编辑 5 次。
つまんねー事聞くなよ!

I, personally, for me, believe (obviously sometimes) that my OS choice is right. That's me. I'm not telling you that you should believe it. Learn the facts, and the origins behind the facts, and make up your own damn mind. That's why you have one. (source)

Follow me: @06_taro

304——
为纪念伟大的宇宙史上最强压制304先生,联合国教科文组织决定,将每年的第304天,即平年的10月31日或者闰年的10月30日,定为世界304日。
头像
06_taro
核心会员
核心会员
帖子: 998
注册时间: 2010-09-22 18:32
来自: United Kingdom
联系: 网站

LumaDB(8-bit debanding filter)

旧发布贴:http://www.nmm-hd.org/newbbs/viewtopic.php?f=7&t=256

首先声明其实核心的东西都不是我写的,
HaibaraAi菊苣给我的,
Ai菊苣说是tp7菊苣写的……
于是函数化,
变量该有的基本都有了,
因为脚本很简单就懒得在avsi里面写文档了,
反正参数名全都和用到的其他滤镜参数名相同,
而且我写出来向来自己都看不懂。

核心思路就是以GradFun3为debanding核心,
GrainFactory3按照亮度不同自适应加grain,
GradFun3的thrradiusampn参数可调,
v0.3开始radius的默认值根据分辨率自适应调整,
GrainFactory3的g1strg2strg3str
g1shrpg2shrpg3shrp
g1sizeg2sizeg3size
g1texg2texg3tex
temp_avg可调整,
以及我自己添加的mod版里:
g1constg2constg3const可调,
v0.2及之前的是seed和constant,seed已经去掉,
constant现在按dark/midtone/bright分为g1const/g2const/g3const,
然后mask,
TEdgeMask的preblur可调,
deflate控制是否对mask做mt_deflate,
blur控制是否用RemoveGrain处理mask,
只处理Y平面。

我函数化以后专门设置了dither参数和grain参数,
大家可以自己设置dither与grain的滤镜,
"none"表示不处理,
例如LumaDB(dither="gradfun2db(thr=1.5)", grain="none")这样;

其实不蛋疼一般用默认参数就行了……
另外就是默认输出的grain是静态的,
有需要的可以自己用g1const=false、g2const=false这样改成动态grain。

顺便修改了一下LumaDB里面用到的GrainFactory3,
我的mod版可以分别用g1const、g2const、g3const让dark/midtone/bright area生成静态噪声,
顺便把控制噪声强度的g1str、g2str、g3str参数给float化了,
默认参数没动所以默认效果不变,
不过应该没人会真的用默认参数吧(默认是让AddGrainC生成var=13-25的噪声,貌似是旧版AddGrain的参数,对现在的值来说这口味重得……)

Requirements:
AddGrainC-v1.6.1
dither-v1.15.1
masktools-v2.0a48 (dither-1.6必须a48之后否则绿屏,自定义其他dither或用旧版GradFun3则无此要求)
RemoveGrain-v1.0
TEdgeMask-v0.9
f3kdb-v1.5.0
输入为YV12的色彩空间
► 显示剧情透露 用法举例

================== Changelog ===================

2012.04.06
v0.7 支持基於f3kdb的grain generator。

2012.03.13
v0.6 增加自定义mclip,支持Chroma处理,默认g*const改为false以适应10-bit时代

2011.11.21
v0.5 默认关闭GradFun3内部的mask并增加gf3mask来控制,另外增加mask来控制LumaDB是否做mask,方便用于MCTD_PP之类已经有mask的脚本内

2011.09.26
v0.4 增加th1/th2/th3/th4来自定义luma划分区域的范围,具体直接看GrainFactory3mod里的说明。dither更新到1.12.0,16-bit版也准备出来了……

2011.05.28
v0.3 GrainFactory3mod用g1const/g2const/g3const替换constant,从而噪点的constant也按照g1/g2/g3来区分;LumaDB去掉seed,反正不会有人用这个参数,constant也相应被替换为g1const/g2const/g3const,参数里radius的默认值修改为按分辨率自适应调整。

2011.05.27
v0.2 增加几个GrainFactory3里可以直接修改的参数方便使用,早改好了一直在用不过忘了在这里更新了……

2011.05.22
v0.1 脚本化。
上次由 06_taro 在 2012-04-07 8:42,总共编辑 4 次。
つまんねー事聞くなよ!

I, personally, for me, believe (obviously sometimes) that my OS choice is right. That's me. I'm not telling you that you should believe it. Learn the facts, and the origins behind the facts, and make up your own damn mind. That's why you have one. (source)

Follow me: @06_taro

304——
为纪念伟大的宇宙史上最强压制304先生,联合国教科文组织决定,将每年的第304天,即平年的10月31日或者闰年的10月30日,定为世界304日。
头像
06_taro
核心会员
核心会员
帖子: 998
注册时间: 2010-09-22 18:32
来自: United Kingdom
联系: 网站

LumaDBL(16-bit debanding filter)

旧发布贴:http://www.nmm-hd.org/newbbs/viewtopic.php?f=7&t=399

LumaDB的16-bit版本,俗称“撸马碉堡了”,和GrainFactoryLite一样输入输出都可以是8bit或者16bit的,靠"lsb"与"lsb_in"参数控制。

一些注意事项:
0. 因為16-bit處理非常耗內存,腳本開始請加上SetMemoryMax(1024),否則因為內存限制,速度會非常非常慢,尤其是分辨率高的時候(感謝304提出這個“非常慢”的問題= =)
1. 与GrainFactoryLite一样去掉了g*tex,
2. 同上g*const与temp_avg控制的噪点动态性改成用g*soft来控制,大于等于100时为静态噪声,
3. 与LumaDB不同的是默认的噪点是动态的,对debanding来说这样其实好些。
4. 自定义的"dither"和"grain"也不限定是8bit或者16bit,可以用d_lsb/d_lsb_in以及g_lsb/g_lsb_in控制(其实本来想做成只接受16bit自定义滤镜的,看了下连flash3kyuu_deband这种神器也只能输出16bit而不能输入16bit(扯蛋,很快就要有了……),所以还是加入8bit支持了……)
5. 原来的LumaDB如果自定义dither或者grain为"none"的时候dither或者grain过程为无处理,现在改成了"nop"或者"nop()",其实以前LumaDB就想这样用内置函数nop的,不过我个人习惯是不太喜欢在函数里用太多last处理,因为函数会比较乱囧,所以即使现在也不是当作last之后nop()而是直接比较字符串,所以请不要写成"nop( )"(加了空格)这样的形式。
► 显示剧情透露 用法举例
所需外部插件:
-> AddGrainC[v1.6.1]
-> MaskTools2[v2.0a48]
-> dither[v1.15.0]
-> RemoveGrain[v1.0]
-> TEdgeMask[v0.9]
-> GrainFactoryLite[v1.2]
-> f3kdb[v1.5.0]
-> f3kgrain[v0.3]
上次由 06_taro 在 2012-04-07 8:41,总共编辑 4 次。
つまんねー事聞くなよ!

I, personally, for me, believe (obviously sometimes) that my OS choice is right. That's me. I'm not telling you that you should believe it. Learn the facts, and the origins behind the facts, and make up your own damn mind. That's why you have one. (source)

Follow me: @06_taro

304——
为纪念伟大的宇宙史上最强压制304先生,联合国教科文组织决定,将每年的第304天,即平年的10月31日或者闰年的10月30日,定为世界304日。
头像
06_taro
核心会员
核心会员
帖子: 998
注册时间: 2010-09-22 18:32
来自: United Kingdom
联系: 网站

GrainFactory3mod(8-bit luma segmented grain generator)

旧发布贴(随LumaDB附送):http://www.nmm-hd.org/newbbs/viewtopic.php?f=7&t=256

基於Dideé大神的GrainFactory3略作修改後的8-bit grain generator,沒啥好說的…

需要的外部工具:
-> AddGrainC[v1.6.1]
-> RemoveGrain[v1.0pre]
-> MaskTools2[v2.0a48]
-> f3kdb[v1.5.0]
上次由 06_taro 在 2012-04-07 8:43,总共编辑 3 次。
つまんねー事聞くなよ!

I, personally, for me, believe (obviously sometimes) that my OS choice is right. That's me. I'm not telling you that you should believe it. Learn the facts, and the origins behind the facts, and make up your own damn mind. That's why you have one. (source)

Follow me: @06_taro

304——
为纪念伟大的宇宙史上最强压制304先生,联合国教科文组织决定,将每年的第304天,即平年的10月31日或者闰年的10月30日,定为世界304日。
头像
06_taro
核心会员
核心会员
帖子: 998
注册时间: 2010-09-22 18:32
来自: United Kingdom
联系: 网站

GrainFactoryLite(16-bit luma segmented grain generator)

旧发布贴:http://www.nmm-hd.org/newbbs/viewtopic.php?f=7&t=395

其实是在考虑把LumaDB给16-bit化,所以就先把其中的GrainFactory3mod拿出来先16-bit化了……GrainFactory3mod就不用介绍了吧,根据Luma值自适应地加噪点,可以配合debanding滤镜,譬如只对暗场加噪等等。

内部处理精度是16-bit的,为了兼容性默认输入输出还是8-bit(输出时做16->8 dithering),实际上输入和输出都可以是16-bit的。控制参数和dither里大部分工具保持一致,用lsb和lsb_in。dither用的是DitherPost,具体参数请看dither内mode的解释。也可以用ditherC自定义其他dither函数。

和噪点有关的参数基本保持与GrainFactory3mod一致,g*const改成g*soft,大于等于100时为静态噪声,因此temp_avg也不需要了;还有g*tex这种个人估计没人会去用而且改成16bit又比较麻烦的东西直接去掉了。
► 显示剧情透露 用法举例:
所需外部插件:
-> AddGrainC[v1.6.1]
-> RemoveGrain[v1.0pre]
-> MaskTools2[v2.0a48]
-> dither[v1.15.0]
-> f3kdb[v1.5.0]
-> f3kgrain[v0.3]
上次由 06_taro 在 2012-04-07 8:44,总共编辑 2 次。
つまんねー事聞くなよ!

I, personally, for me, believe (obviously sometimes) that my OS choice is right. That's me. I'm not telling you that you should believe it. Learn the facts, and the origins behind the facts, and make up your own damn mind. That's why you have one. (source)

Follow me: @06_taro

304——
为纪念伟大的宇宙史上最强压制304先生,联合国教科文组织决定,将每年的第304天,即平年的10月31日或者闰年的10月30日,定为世界304日。
头像
06_taro
核心会员
核心会员
帖子: 998
注册时间: 2010-09-22 18:32
来自: United Kingdom
联系: 网站

f3kgrain(Another 8/16-bit luma adaptive grain generator)

旧发布贴:http://www.nmm-hd.org/newbbs/viewtopic. ... t=50#p5707

基於f3kdb的grain generator。
支持8-bit/stacked 16-bit输入输出(输出与输入格式相同)
f3kdb裡的grain只能設定是動態還是靜態。如果是動態的話,動態的程度無法設置,於是自己寫了個控制動態程度的腳本。
可以luma自適應。

参数:
luma/chroma:即f3kdb内的grainY/grainC,噪点强度
mode:即f3kdb内的random_algo_grain,噪点生成算法
temp:时域稳定性,越高则噪点越静态,越低则噪点越动态
adapt:luma mask中心,luma值与此参数值相同时噪点越强,高于或低于此值噪点强度减弱(只对容易出banding的luma值附近加强噪点)
lsb:输入输出是否为stacked 16-bit。

需要的外部插件:
-> f3kdb[v1.5.1]
-> MaskTools2[v2.0a48]
-> RemoveGrain[v1.0pre]
-> dither[v1.17.0]
上次由 06_taro 在 2012-05-21 7:51,总共编辑 3 次。
つまんねー事聞くなよ!

I, personally, for me, believe (obviously sometimes) that my OS choice is right. That's me. I'm not telling you that you should believe it. Learn the facts, and the origins behind the facts, and make up your own damn mind. That's why you have one. (source)

Follow me: @06_taro

304——
为纪念伟大的宇宙史上最强压制304先生,联合国教科文组织决定,将每年的第304天,即平年的10月31日或者闰年的10月30日,定为世界304日。
头像
06_taro
核心会员
核心会员
帖子: 998
注册时间: 2010-09-22 18:32
来自: United Kingdom
联系: 网站

Re: AddGrain & Deband 工具包(LumaDB(L), GrainFactory(L), f3kgra

佔樓備用= =
其實我很邪惡地想把第一頁都佔了…
つまんねー事聞くなよ!

I, personally, for me, believe (obviously sometimes) that my OS choice is right. That's me. I'm not telling you that you should believe it. Learn the facts, and the origins behind the facts, and make up your own damn mind. That's why you have one. (source)

Follow me: @06_taro

304——
为纪念伟大的宇宙史上最强压制304先生,联合国教科文组织决定,将每年的第304天,即平年的10月31日或者闰年的10月30日,定为世界304日。
头像
06_taro
核心会员
核心会员
帖子: 998
注册时间: 2010-09-22 18:32
来自: United Kingdom
联系: 网站

Re: AddGrain & Deband 工具包(LumaDB(L), GrainFactory(L), f3kgra

f3kgrain - v0.4
- 支持8-bit的YV16/YV24
- 支持設定正態分佈時的sigma(標準差)
つまんねー事聞くなよ!

I, personally, for me, believe (obviously sometimes) that my OS choice is right. That's me. I'm not telling you that you should believe it. Learn the facts, and the origins behind the facts, and make up your own damn mind. That's why you have one. (source)

Follow me: @06_taro

304——
为纪念伟大的宇宙史上最强压制304先生,联合国教科文组织决定,将每年的第304天,即平年的10月31日或者闰年的10月30日,定为世界304日。
萧瑟朗
帖子: 16
注册时间: 2011-11-15 11:00

Re: AddGrain & Deband 工具包(LumaDB(L), GrainFactory(L), f3kgra

{:cat_9} 弱弱地求个vapoursynth版的LumaDBL

回到 “AviSynth”