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

Re: AdaptDBMC - Luma/Fade/Blue自适应debanding脚本(公测,各种待优化)

其实1/3为单位floor的话精度也差不多足够了,反正x factor后还是会取整,实际上用到的精度可能差不多就是1/3左右……不过其实目前速度影响最大的估计还是在MVtools里,f3kdb好快好快的-v-
つまんねー事聞くなよ!

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日。
histamine
帖子: 85
注册时间: 2010-09-23 20:07

Re: AdaptDBMC - Luma/Fade/Blue自适应debanding脚本(公测,各种待优化)

代码: 全选

--- AdaptDBMC_beta.avsi	2011-12-15 05:49:50.000000000 +0800
+++ AdaptDBMC_beta_Mod.avsi	2011-12-16 15:19:43.000000000 +0800
@@ -128,16 +128,41 @@
 ### Mix all factors and calculate final factor of strength
 global strFact   = "( " + AdaptLuma + " * ( 1 + " + AdaptFade + " ) * ( 1 + " + AdaptBlue + " ) )"
 
-global f3kdb_eval = "f3kdb( Y=int("+String(Y)+"*"+strFact+
-\                       "), Cb=int("+String(Cb)+"*"+strFact+
-\                       "), Cr=int("+String(Cr)+"*"+strFact+
-\                       "), ditherY=int("+String(ditherY)+"*"+strFact+
-\                       "), ditherC=int("+String(ditherC)+"*"+strFact+
+global f3kdb_eval = "f3kdb( Y=int("+String(Y)+"*f3kdb_rfact"+
+\                       "), Cb=int("+String(Cb)+"*f3kdb_rfact"+
+\                       "), Cr=int("+String(Cr)+"*f3kdb_rfact"+
+\                       "), ditherY=int("+String(ditherY)+"*f3kdb_rfact"+
+\                       "), ditherC=int("+String(ditherC)+"*f3kdb_rfact"+
 \                           ( Defined(f3k_param) ? "), "+f3k_param+" )"
-\                                                : ") )" )
+\                                                : ") )" ) +
+\                           ( Info ? """.Subtitle("Real Final factor: "+String(f3kdb_rfact), x = 8, y = 28)""" : "")
 
-Info ? ScriptClip( f3kdb_eval+""".Subtitle( "Final factor: "+String( Eval(strFact) ), x=8, y=8 ).Subtitle( "Luma adaptive factor: "+String( Eval(AdaptLuma) ), x=8, y=38 ).Subtitle( "Fade adaptive factor: "+String( 1+Eval(AdaptFade) ), x=8, y=58 ).Subtitle( "Blue adaptive factor: "+String( 1+Eval(AdaptBlue) ), x=8, y=78 ).Subtitle( "Frame complexity: "+String( Eval(c_Complex) ), x=8, y=108 )""" )
-\    : ScriptClip( f3kdb_eval )
+global f3kdb_rfact = 1.00
+global f3kdb1 =  Eval(f3kdb_eval)
+
+global f3kdb_rfact = 1.33
+global f3kdb2 =  Eval(f3kdb_eval)
+
+global f3kdb_rfact = 1.67
+global f3kdb3 =  Eval(f3kdb_eval)
+
+global f3kdb_rfact = 2.00
+global f3kdb4 =  Eval(f3kdb_eval)
+
+global f3kdb_rfact = 2.33
+global f3kdb5 =  Eval(f3kdb_eval)
+
+global f3kdb_rfact = 2.66
+global f3kdb6 = Eval(f3kdb_eval)
+
+global f3kdb_rfact = 3.00
+global f3kdb7 = Eval(f3kdb_eval)
+
+global f3kdb_eval2 = """vStrFact = Eval(strFact)""" + chr(13)+"""f3kdbRet = (vStrFact < 1.33) ? f3kdb1:(vStrFact < 1.66) ? f3kdb2:(vStrFact < 2.0) ? f3kdb3:(vStrFact < 2.33) ? f3kdb4:(vStrFact < 2.66) ? f3kdb5: (vStrFact < 3) ? f3kdb6 : f3kdb7"""
+eClip = last 
+sClip = BlankClip(f3kdb1)                                                                                                                                       
+Info ? ScriptClip( f3kdb_eval2+chr(13)+"""f3kdbRet.Subtitle( "Final factor: "+String( Eval(strFact) ), x=8, y=8 ).Subtitle( "Luma adaptive factor: "+String( Eval(AdaptLuma) ), x=8, y=58 ).Subtitle( "Fade adaptive factor: "+String( 1+Eval(AdaptFade) ), x=8, y=78 ).Subtitle( "Blue adaptive factor: "+String( 1+Eval(AdaptBlue) ), x=8, y=98 ).Subtitle( "Frame complexity: "+String( Eval(c_Complex) ), x=8, y=128 )""" )
+\       :  Eval("""ScriptClip(sClip, "Eval(f3kdbRet)")"""+chr(13)+"""FrameEvaluate(eClip, f3kdb_eval2 )""")
 
 return SelectEvery( 1 + radius * 2, radius)
 }
info=false时支持16bit输出

发现写错了,请不要用

修正:
Eval("""ScriptClip(sClip, "Eval(f3kdbRet)")"""+chr(13)+"""FrameEvaluate(eClip, f3kdb_eval2 )""")
=> SCTri(ScriptClip(sClip, "f3kdbRet"),FrameEvaluate(eClip, f3kdb_eval2 ))
上次由 histamine 在 2011-12-16 17:15,总共编辑 6 次。
头像
06_taro
核心会员
核心会员
帖子: 998
注册时间: 2010-09-22 18:32
来自: United Kingdom
联系: 网站

Re: AdaptDBMC - Luma/Fade/Blue自适应debanding脚本(公测,各种待优化)

晚上回去放个能支持16bit输入/输出的版本~
つまんねー事聞くなよ!

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日。
histamine
帖子: 85
注册时间: 2010-09-23 20:07

Re: AdaptDBMC - Luma/Fade/Blue自适应debanding脚本(公测,各种待优化)

写了个插件用来处理不同分辨率情况下,ScriptClip和FrameEvaluate组合使用的情况

代码: 全选

LoadCPlugin("ScriptTrick.dll")
XXXSource()
feClip = FrameEvaluate( last.Spline36Resize(1280,720).ColorYUV(gain_y=50), "Text = String(AverageLuma)")
scClip = ScriptClip( last.Spline36Resize(1920,1080), "Subtitle(Text).Subtitle(String(AverageLuma),y=20)")
SCTri(scClip,EvalClip=feClip)
每次GetFrame时先获取feClip第n帧,再获取并返回scClip的第n帧
ScriptTrick20111216.7z
(58.66 KiB) 下载 133 次
histamine
帖子: 85
注册时间: 2010-09-23 20:07

Re: AdaptDBMC - Luma/Fade/Blue自适应debanding脚本(公测,各种待优化)

diff
► 显示剧情透露
avsi:
► 显示剧情透露
Speedup

update:
支持手动指定用来计算Final Factor的Clip(mvp参数),从而可以通过指定f3k_param参数实现支持16bit输入输出
并且可以通过降低mvp分辨率提高运动补偿速度(但会影响Frame complexity和Fade adaptive factor的计算)
► 显示剧情透露

回到 “AviSynth”