Welcome to Doom9's Forum, THE in-place 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. |
![]() |
#1 | Link |
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
GradFun2DBmod [v1.5 - Update 2009/12/30]
Code:
######################################################################################## ### ### ### GradFun2DB MOD : function GradFun2DBmod() ### ### ### ### v1.5 by "LaTo INV." ### ### ### ### 30 December 2009 ### ### ### ######################################################################################## ### ### ### /!\ Needed filters : Masktools (v2.0a36), Removegrain (v1.0PR), ### -------------------- GradFun2db (v1.0), AddGrainC(v1.4). ### ### ### USAGE: GradFun2DBmod( thr, thrC, mode, ### str, strC, temp, adapt, custom, ### mask, radius, range, ### show, screenW, screenH ) ### ### ### +--------+ ### | DITHER | ### +--------+ ### ### thr [default: 1.2] ### ------------------ ### GradFun2DB "thr" parameter ### ### thrC [default: thr] ### ------------------- ### GradFun2DB "thrC" parameter ### ### mode [default: 2] ### ----------------- ### Mode for the addition of 16 pixels around the image ### 0 = Off [same as GradFun2DB] ### 1 = AddBorders (speed:+ quality:-) [same as GradFunk] ### 2 = PointResize (speed:+ quality:+) ### 3 = Flip/Stack (speed:- quality:+) [same as GradFunkMirror] ### ### ### +-------+ ### | GRAIN | ### +-------+ ### ### str [default: 0.8] ### ------------------ ### AddGrainC "var" parameter ### ### strC [default: 0.0] ### ------------------- ### AddGrainC "uvar" parameter ### ### temp [default: 50] ### ------------------ ### Strength for temporal stabilization ### -1 = off ### 0 = nervous grain ### .. ### 100 = calm grain ### ### adapt [default: 64] ### ------------------- ### Threshold for luma-adaptative grain ### -1 = off ### 0 = source ### .. ### 255 = invert ### ### custom [default: "empty"] ### ------------------------- ### Use your own grain generator instead of AddGrain ### (temp & adapt parameters are on, set -1 to turn off) ### ### ### +------+ ### | MASK | ### +------+ ### ### mask [default: true] ### -------------------- ### Use adaptative deband mask ### (dither/grain is only applied to areas with banding's susceptibility) ### ### radius [default: 2] ### ------------------- ### Radius for the mask (1 is the fastest, 2-3 are slower) ### ### range [default: 2] ### ------------------ ### Range used in the mask (1-3 are good value) ### ### ### +-------+ ### | DEBUG | ### +-------+ ### ### show [default: false] ### --------------------- ### Show debug clip & informations ### ### screenW [default: 1280] ### ----------------------- ### Screen horizontal resolution (for show clip) ### ### screenH [default: 1024] ### ----------------------- ### Screen vertical resolution (for show clip) ### ######################################################################################## Update 2009.12.30 : GradFun2DBmod v1.5 v1.5: added MOD4 restriction changed script to accept MOD8 clip updated documentation v1.4: changed "temp" parameter (-1=off) updated documentation v1.3: replaced chroma parameter by thrC & strC v1.2: changed int->float for str parameter added custom parameter v1.1: added show parameter added small speed improvements added warning for bad settings fixed small bug with chroma=false v1.0: first public release Last edited by LaTo; 9th January 2010 at 09:57. |
![]() |
![]() |
![]() |
#4 | Link |
Fighting spam with a fish
Join Date: Sep 2005
Posts: 2,726
|
I long for the days when we will no longer need dithering and have high enough color bit depth to remove banding all together.
Oh, and LaTo, what's this? You posting a script with no "show" parameter! ![]()
__________________
FAQs:Bond's AVC/H.264 FAQ Site:Adubvideo Zsmooth - Cross-platform smoothing for Vapoursynth |
![]() |
![]() |
![]() |
#5 | Link | ||
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Quote:
![]() Quote:
![]() Maybe later, I haven't time these days... |
||
![]() |
![]() |
![]() |
#6 | Link |
LaTo INV.
Join Date: Jun 2007
Location: France
Posts: 701
|
Update v1.1 - 2009/01/24
v1.1:
added show parameter added small speed improvements added warning for bad settings fixed small bug with chroma=false Omission is repaired ![]() Last edited by LaTo; 24th January 2009 at 21:10. |
![]() |
![]() |
![]() |
#8 | Link | |
Fighting spam with a fish
Join Date: Sep 2005
Posts: 2,726
|
Quote:
__________________
FAQs:Bond's AVC/H.264 FAQ Site:Adubvideo Zsmooth - Cross-platform smoothing for Vapoursynth |
|
![]() |
![]() |
![]() |
#12 | Link |
Sleepy overworked fellow
Join Date: Feb 2008
Location: Maple syrup's homeland
Posts: 933
|
You could do it as string "mygraingen" and use eval in the script. This way, you wouldn't need to add all the possible parameters in gradfun2dbmod. (+ more flexibility if the user wants to use a combination of filters, etc etc) mygraingen="grainfactory3(blabla).something else()"
__________________
AnimeIVTC() - v2.00 -http://boinc.berkeley.edu/- Let all geeks use their incredibly powerful comps for the greater good (no, no, it won't slow your filtering/encoding :p) |
![]() |
![]() |
![]() |
#13 | Link | |
Registered User
Join Date: Nov 2006
Posts: 83
|
Quote:
Regards McCauley |
|
![]() |
![]() |
![]() |
#14 | Link |
x264aholic
Join Date: Jul 2007
Location: New York
Posts: 1,752
|
One way you can do this is to make a helper function.
Code:
function EvalFunction(clip src, string "filter") { src processed = Eval(filter) return processed } Code:
# Without the helper function you have to do this: Avisource("..") src = last proc = src.SomeFiltering() src dither = Eval("Blur(1)") # With the helper function you can do this: Avisource("...") src = last proc = src.SomeFiltering() dither = src.EvalFunction("Blur(1)")
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame. |
![]() |
![]() |
![]() |
#15 | Link |
Doom9 Lover
Join Date: Oct 2007
Location: New Zealand
Posts: 117
|
Wow took me a minute to see the difference without cheating by looking at the bottom, looks fantastic man.
So this filter mainly removes grainy sort of damage? What program did you use to produce that shot for comparing, could save myself a lot of time if you're willing to care and share ![]()
__________________
Creativity is the birth of a new era, will you be creative also? |
![]() |
![]() |
![]() |
#17 | Link |
Doom9 Lover
Join Date: Oct 2007
Location: New Zealand
Posts: 117
|
In my defense its still tuesday morning here -_-
The banding is caused by grain though is it not? i'll shut up now...
__________________
Creativity is the birth of a new era, will you be creative also? |
![]() |
![]() |
![]() |
#19 | Link |
Registered User
Join Date: May 2008
Posts: 40
|
I think str parameter should be float (it is float in addgrain).
Otherwise it's really a good script, I tried it on some anime clips and it works very well, a lot better than a simple GradFun2DB. The only problem is that anime shouldn't really have any grain so the default parameters need a little bit of tweaking ![]() |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|