Welcome to Doom9's Forum, THE inplace to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. 
7th August 2021, 09:43  #181  Link 
Registered User
Join Date: Nov 2009
Posts: 2,351

poisondeathray: I will have a look. Actually I had plans to replace GrainFactory3mod completely as it shouldn't be that slow. I want to make use of the Addgrain corr args to avoid resizing clip 3 times.
Julek: Do you have an input and output sample? I got some code but I'm not sure what I should target. Also there are adaptive mean/median/gaussian, which one do you need?
__________________
i74790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread 
7th August 2021, 18:26  #183  Link 
Registered User
Join Date: Nov 2009
Posts: 2,351

poisondeathray: I just checked and it's fine here, using your colorbars call and the GrainFactory3mod call from OP. The call is actually "GrainFactory3mod" not "GrainFactory3" (fixed in OP). Might you be missing a dependency?
gispos: I tested and yes, ex_contrast() defaults to UV=1 for YUV sources. I fixed it by enabling UV=3 if sat is defined, will upload for next update. Code:
UV = Default(UV, Defined(sat)  rgb ? 3 : 1)
__________________
i74790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread 
7th August 2021, 18:45  #184  Link  
Registered User
Join Date: Sep 2007
Posts: 5,336

Quote:
Yes, GrainFactory3mod . I mentioned GrainFactory3 because that separate older (non ex) function works If I copy/paste the function into the script and rename it something like GrainFactory3mod2 , it still returns original clip, so it's not autoloading some other function with the same name Yes all dependencies are met on the list, with same or newer versions 

7th August 2021, 21:09  #186  Link 
Registered User
Join Date: Nov 2009
Posts: 2,351

poisondeathray: Maybe you have a function (name) duplication? Another thing to care about avs+ version. Also are you using MIX mod? Both should work though but I always use MIX mods myself mostly. In any case download again from the repo (just updated) and check for dependencies.
ExTools updated to v4.6. ex_blur() whole refactor. Now it uses true gaussian coefficients and float radius. For matching removegrain(12), blur(1) use ex_boxblur(mode="weighted") ex_smartblur() bugfix that prevented the function from working ex_binarize() dynamic mode ex_median() optimize "medianST" mode EX/MIX mods Rebased to latest ExTools Reverted removegrain(19) to removegrain(20) I also tried to port removegrainHD smartmedian modes but failed to it, spent whole day yesterday. Might add my attempts if anyone is interested to give it a stab.
__________________
i74790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread 
7th August 2021, 21:38  #187  Link  
Registered User
Join Date: Sep 2007
Posts: 5,336

Quote:
Yes I just redownloaded and check prerequisites. Not sure what's going on Neither GrainFactory3mod EX or MIX mods work for me. I renamed the functions to call them separately. I even removed autoloading GrainFactory3mod.avsi versions and manually copy/pasted function into script . I double check that function is missing  ie. error message when GrainFactory3Mod is called eg. rename function function GrainFactory3mod_ex(clip... function GrainFactory3mod_mx(clip... They return the original clip for me The original GrainFactory3mod from 2020.04.06 (I think real_finder) works ok 

7th August 2021, 22:01  #188  Link 
Registered User
Join Date: Nov 2009
Posts: 2,351

I don't know, there's nothing special on my mod. In these situations I would work my way up within the function to check up where it starts to fail. Output process clip in different stages to see what's failing. Usually it tends to be a dumb oversight. Use simple script, empty the plugin folder, etc.
If you can please try replacing the last line: Code:
use_ALMask ? mt_merge(result... } Code:
result }
__________________
i74790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread 
7th August 2021, 22:15  #189  Link  
Registered User
Join Date: Sep 2007
Posts: 5,336

Quote:
It's ok  Don't worry about it, the original mod still works ok for me 

8th August 2021, 16:11  #190  Link  
Registered User
Join Date: Dec 2020
Posts: 83

Quote:
I usually use the mean option more. Link 

10th August 2021, 21:23  #191  Link 
Registered User
Join Date: Nov 2009
Posts: 2,351

ExTools updated to v4.7.
Guidelines for common operations with ex_xxpand(): Opening, closing, smooth, outline, inline, gradient, top hat, black hat. ex_hitormiss(). New function for advanced binary mask operations. Modes: Thin, thicken, prune, pruneS, boundary, convexhull, convexhull45, corner, cornerS, skeleton, SKIZ, end and junction. I may add more in the future. EX/MIX mods Minor cosmetic stealth updates
__________________
i74790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread 
10th August 2021, 21:52  #192  Link 
Registered User
Join Date: Nov 2009
Posts: 2,351

@Julek: I tried to port adaptive threshold, there are many flavours though but couldn't make anyone work, unless my integral image is wrong I think the problem is in the second part, the thresholding.
It involves two passes, since the integral overflows range_max I'm testing in 32bits first. Code:
# mean of the local sum str = "x[2,2] A^ x[1,2] B^ x[0,2] C^ x[1,2] D^ x[2,2] E^ x[2,1] F^ x[1,1] G^ x[0,1] H^ x[1,1] I^ x[2,1] J^ x[2,0] K^ x[1,0] L^ x[0,0] M^ x[1,0] N^ x[2,0] O^ x[2,1] P^ x[1,1] Q^ x[0,1] R^ x[1,1] S^ x[2,1] T^ x[2,2] U^ x[1,2] V^ x[0,2] X^ x[1,2] Y^ x[2,2] Z^ A B + WA^ WA C + WB^ WB D + WC^ WC E + WD^ A F + WE^ F G WA + + WF^ F G H WB + + + WG^ I WG WC + + WB  WH^ J WH WD + + WC  WI^ K WE + WJ^ K L WF + + WK^ K L M WG + + + WL^ N WL WH + + WG  WM^ O WM WI + + WH  WN^ P WJ + WO^ P Q WK + + WP^ P Q R WL + + + WQ^ S WQ WM + + WL  WR^ T WR WN + + WM  WS^ U WO + WT^ U V WP + + WU^ U V X WQ + + + WV^ Y WV WR + + WQ  WX^ Z WX WS + + WR  WY^ A WA WB WC WD WE WF WG WH WI WJ WK WL WM WN WO WP WQ WR WS WT WU WV WX WY + + + + + + + + + + + + + + + + + + + + + + + + 25 /" Some attempts for thresholding: Code:
str = "x y[2,2] y[2,2] + y[2,2]  y[2,2]  25 / 1 0.14  * <= 0 range_max ? " str = "x y[2,2] y[2,2] + y[2,2]  y[2,2]  25 / 0.8 * <= 0 range_max ? " # this seems legit str = "x y[0,0] y[2,2] + y[2,0]  y[0,2]  9 / 1 0.04  * <= 0 range_max ? " str = "x[0,0] y[0,0] y[2,2] + y[2,0]  y[0,2]  9 / 1 0.91  * <= range_max 0 ? " str = "y[0,0] y[2,2] + y[2,0]  y[0,2]  9 / 0.003 <= range_max 0 ? " # this seems legit str = "x y[0,0] y[1,0] y[1,1] y[0,1] y[2,2] + + + + y[2,0]  y[2,1]  y[0,2]  y[1,2]  9 / 1 0.958  * <= range_max 0 ? " str = "x[0,0] y[0,0] y[1,0] y[1,1] y[0,1] y[2,2] y[2,0] y[2,1] y[0,2] y[1,2] y[2,2] + + + + + + + + + y[2,0]  y[2,1]  y[0,2]  y[1,2]  9 / 1 0.9939  * <= range_max 0 ? " str = "x y y 25 / A@  B@ 1 B  / 1  0.445 * 1 + A * <= 0 range_max ? " # y should be local sum (without mean) str = "x x y 25 / A@  dup * sqrt 128 / 1  0.34 * 1 + A * <= 0 range_max ? " # Sauvola (y is local mean no integral) str = "x x y 25 / A@  dup * sqrt 0.5 / 1  0.25 * 10 A * exp 2 * 1 + + A * <= 0 range_max ? " # Phansalkar (y is local mean no integral) By the way, for Otsu's I found a way to create histogram bins, well a poor man's version of it, simply threshold image for each bin, subtract the previous thres and average each bin get the amount of values. Code:
ScriptClip(""" thr1=ex_binarize(25.5,true) bin1=thr1.AverageLuma() thr2=ex_logic(thr1, ex_binarize(51,true), "andn") bin2=thr2.AverageLuma() ... """)
__________________
i74790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread Last edited by Dogway; 10th August 2021 at 22:02. 
12th August 2021, 12:50  #193  Link 
Registered User
Join Date: Nov 2009
Posts: 2,351

ExTools updated to v4.8.
ex_binarize() added "otsu" mode. ex_median() fixed "adaptive" (for good). Optimized "median5", "medianST", "medianT" and "medianT5" ex_repair() optimized "median5" ex_bs() upgraded to convert from any bitdepth to any bitdepth, including self bitdepth with different bit scale. Updated benchmarks EX/MIX mods Rebase to latest ExTools SMDegrain updated to v3.2.4d. Revert to removegrain(20) Fix ex_BM3D() issue when input is 32bit Revert workaround for empty 'threads' issue Swapped mt_merge with ex_merge, thus totally removing masktools2 dependency GradePack updated to v2.6. Update ex_bs() Optimize ex_blend() "interpolation" mode ex_contrast() enable chroma if sat is defined.
__________________
i74790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread 
19th August 2021, 23:24  #194  Link 
Registered User
Join Date: Nov 2009
Posts: 2,351

@Tormento: Couldn't refrain myself so I cobbled this up in a moment. Defaults are not tuned, check against STPresso() to see how it compares, this runs about 100fps, STPresso 3.3fps.
Code:
# SpatioTemporal Thresholded Weighted Median function STTWM(clip a, int "sthres", int "tthres", int "athres", int "slimit", int "tlimit", int "UV", bool "fulls") { rgb = isRGB(a) isy = isy(a) bi = BitsPerComponent(a) ths = Default(sthres, 24) # 0  100% tht = Default(tthres, 49) # 0  100% tha = Default(athres, 1) # 0  100% sl = Default(slimit, 5) # 0  255 tl = Default(tlimit, 5) # 0  255 UV = Default(UV, rgb ? 3 : 1) fs = Default(fulls, rgb) ts = ths/100. tt = tht/100. ta = (100tha)/100. rt = 1  (ts + tt) * ta Assert(ths+tht<101, "Spatial and Temporal thresholds cannot sum more than 100%.") Assert(IsVersionOrGreater(3,7,1), "Update AviSynth+ version to 3.7.1+") str = Format( \ "x[1,1] x[1,1] dup1 dup1 min K^ max P^ x[1,1] x[1,1] dup1 dup1 min L^ max O^ x[0,1] dup D^ N^ x[1,0] dup C^ M^ x[0,1] dup I^ J^ x[1,0] dup G^ H^ x[0,0] dup dup dup A^ F^ B^ E^ N P dup1 dup1 min N^ max P^ F O dup1 dup1 min F^ max O^ J M dup1 dup1 min J^ max M^ I L dup1 dup1 min I^ max L^ B K dup1 dup1 min B^ max K^ E H dup1 dup1 min E^ max H^ D G dup1 dup1 min D^ max G^ A C dup1 dup1 min A^ max C^ H P dup1 dup1 min H^ max P^ M O dup1 dup1 min M^ max O^ E N dup1 dup1 min E^ max N^ C L dup1 dup1 min C^ max L^ G K dup1 dup1 min G^ max K^ F J dup1 dup1 min F^ max J^ A I dup1 dup1 min A^ max I^ B D dup1 dup1 min B^ max D^ O P min O^ L N dup1 dup1 min L^ max N^ H M dup1 dup1 min H^ max M^ J K dup1 dup1 min J^ max K^ D I dup1 dup1 min D^ max I^ F G dup1 dup1 min F^ max G^ C E dup1 dup1 min C^ max E^ A B max B^ M O min M^ K N min K^ H L dup1 dup1 min H^ max L^ G J dup1 dup1 min G^ max J^ E I dup1 dup1 min E^ max I^ C F max F^ B D max D^ K M min K^ E L dup1 dup1 min E^ max L^ H J dup1 dup1 min H^ max J^ G I dup1 dup1 min G^ max I^ D F max F^ K L min K^ I J min I^ G H max H^ E F max F^ I K min I^ F H max H^ H I dup1 dup1 max swap2 min x swap2 clip S@ dup dup dup a dup z dup y b dup1 dup1 min swap2 max swap4 swap1 swap8 dup1 dup1 min swap2 max swap4 swap1 swap6 dup1 dup1 min swap2 max swap9 swap1 swap3 dup1 dup1 min swap2 max swap7 swap1 swap5 dup1 dup1 min swap2 max swap2 swap1 swap4 dup1 dup1 min swap2 max swap3 swap1 swap6 dup1 dup1 min swap2 max swap2 swap1 swap7 dup1 dup1 min swap2 max swap4 swap1 swap8 dup1 dup1 min swap2 max swap9 swap1 swap3 min swap8 swap1 swap5 dup1 dup1 min swap2 max swap2 swap1 swap4 max swap2 swap1 swap7 dup1 dup1 min swap2 max swap7 swap1 swap4 dup1 dup1 min swap2 max swap2 swap1 swap5 dup1 dup1 min swap2 max swap6 swap1 swap3 dup1 dup1 min swap2 max swap2 swap1 swap7 min swap3 swap1 swap4 dup1 dup1 min swap2 max swap4 swap1 swap5 dup1 dup1 min swap2 max swap2 swap1 swap6 max swap3 swap1 swap2 min swap3 dup1 dup1 min swap2 max swap2 swap1 swap4 max swap2 min swap2 max x swap2 clip T@ x  abs {tl} > x T ? {tt} * S x  abs {sl} > x S ? {ts} * + {ta} * x {rt} * + ") b = a.selectevery(1,1) f = a.selectevery(1,+1) b2 = a.selectevery(1,2) f2 = a.selectevery(1,+2) isy ? Expr(a, b2, b, f, f2, str, optSingleMode = false ) : \ UV == 1 ? Expr(a, b2, b, f, f2, str, "", optSingleMode = false ) : \ Expr(a, b2, b, f, f2, str, ex_UVexpr(str, UV, bi, rgb, fs), optSingleMode = false, scale_inputs="none") }
__________________
i74790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread Last edited by Dogway; 19th August 2021 at 23:38. 
20th August 2021, 17:26  #195  Link  
Acid fr0g
Join Date: May 2002
Location: Italy
Posts: 2,507

I suffer OCD too
Quote:
Spresso(10,30).STpresso(10,30,4,22,8,49,1,mc=true) just a bit faster
__________________
@turment on Telegram 

23rd August 2021, 10:35  #196  Link  
Registered User
Join Date: Nov 2009
Posts: 2,351

I'm trying to port mt_hysteresis() (slow and seems a little buggy on each F5) to ExTools. I'm still not sure this can be ported even by reading the source code.
I managed to get a very similar output with this, which basically is just a 8connected hit structuring element. The other blocks in red still don't add or help at all. Code:
function ex_hysteresis(clip a, clip b, int "UV", bool "fulls") { rgb = isRGB(a) isy = isy(a) bi = BitsPerComponent(a) UV = Default(UV, rgb ? 3 : 1) fs = Default(fulls, rgb) str = "x[1,1] A^ x[0,1] B^ x[1,1] C^ x[1,0] D^ x[0,0] E^ x[1,0] F^ x[1,1] G^ x[0,1] H^ x[1,1] I^ y[1,1] J^ y[0,1] K^ y[1,1] L^ y[1,0] M^ y[0,0] N^ y[1,0] O^ y[1,1] P^ y[0,1] Q^ y[1,1] R^ J A min K B min max L C min max M D min max N E min max O F min max P G min max Q H min max R I min max X^ J K max L max M max O max P max Q max R max Z^ J N min K N min max L N min max M N min max O N min max P N min max Q N min max R N min max Y^ Y 0 != range_max 0 ? " isy ? Expr(a, b, str, optSingleMode=false) : \ UV == 1 ? Expr(a, b, str, "", optSingleMode=false) : \ Expr(a, b, str, ex_UVexpr(str, UV, bi, rgb, fs), optSingleMode=false) } Quote:
__________________
i74790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread 

23rd August 2021, 14:01  #197  Link 
Grumpy Old Man.
Join Date: Jul 2019
Location: Out There....
Posts: 692

Hi Dogway,
I just wanted to say that I have been using SMDegrain & ExTools (early builds) successfully in RipBot 264, but with the lasted builds I get an error when running AVSMeter saying there is an issue with Line 446 in SMDegrain. Are there any other dependancies that need to be used with the later builds ??? I can work around by using older builds of SMDegrain. Regards
__________________
Not poorly done, just doin' it my way !!! Live every day like it's your last, because one day, it will be !! (M$B) PD Builds, etc 
23rd August 2021, 22:52  #198  Link 
Registered User
Join Date: Nov 2009
Posts: 2,351

Maybe if you are doing contrasharpening with values you need my mod of LSFmod, or if you are using BM3D prefiltering you might need Utilsr41.
I noticed that in latest LSFmod I changed 'defaults' arg to 'preset', try changing that in line 337 until I update SMDegrain.
__________________
i74790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread 
24th August 2021, 02:17  #199  Link  
Grumpy Old Man.
Join Date: Jul 2019
Location: Out There....
Posts: 692

Quote:
Also, I checked the version of LSFmod I was using, and it's was a little old @ v2.187, the latest that I could find was v2.191...doesn't that sound right ?? I just had a look at Line 337 in v2.191, it's blank Don't know anything about BM3D....is there a forum or something around ?? I'll do some updates, and let you know OK, back already, and with the very quick response from "videoh" & "kedautinh12", I have some stuff to study thanks guys So I now have LSFMod v2.9mx, so I will see what that does.
__________________
Not poorly done, just doin' it my way !!! Live every day like it's your last, because one day, it will be !! (M$B) PD Builds, etc Last edited by Pauly Dunne; 24th August 2021 at 02:51. Reason: updated info 

24th August 2021, 02:29  #200  Link  
Useful n00b
Join Date: Jul 2014
Posts: 1,667

Quote:
Read the whole thread. test3 supports AVS+. 

Tags 
avisynth, dogway, filters, hbd, packs 
Thread Tools  Search this Thread 
Display Modes  

