View Full Version : GradFun2DBmod [v1.5 - Update 2009/12/30]


LaTo
23rd January 2009, 21:29
########################################################################################
### ###
### 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 (http://latoninf.free.fr/d9/GF/GradFun2DBmod.v1.5.avsi)


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


http://latoninf.free.fr/d9/GF/show_mini.png (http://latoninf.free.fr/d9/GF/show.png)

LaTo
23rd January 2009, 21:30
A mix of Udeband / GradFunk with new features... :cool:

I will add screenshots later...

jase99
23rd January 2009, 23:02
Wow, that was timely. Just what I was looking for. Thank you.

Adub
23rd January 2009, 23:42
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! ;) Nah, it aint necessary but I got used to it. It's simple enough to implement my own source view.

LaTo
24th January 2009, 08:10
I long for the days when we will no longer need dithering and have high enough color bit depth to remove banding all together.
Yes, this is clearly one of the biggest problems with DVD/Bluray (and others YV12 source) :mad:

Oh, and LaTo, what's this? You posting a script with no "show" parameter! ;) Nah, it aint necessary but I got used to it. It's simple enough to implement my own source view.
:D

Maybe later, I haven't time these days...

LaTo
24th January 2009, 19:44
v1.1:
added show parameter
added small speed improvements
added warning for bad settings
fixed small bug with chroma=false

Omission is repaired :D

LaTo
25th January 2009, 20:35
Please re-download the v1.1 because I made a mistake in the show function :rolleyes:

Adub
26th January 2009, 08:44
v1.1:
added show parameter

Haha!! Okay, now it's perfect! I have some anime that I can/need to test this on. If only I can find the time.

McCauley
26th January 2009, 12:20
Hi LaTo,

great script, thanks!
Would it be feasible to implement the possibility to call an external Grain Generator (=Grainfactory3) instead of AddGrain?

Regards
McCauley

Sagekilla
26th January 2009, 17:25
Ctrl+F -> AddGrain -> Replace with your choice ;)

LaTo
26th January 2009, 20:55
Hi LaTo,

great script, thanks!
Would it be feasible to implement the possibility to call an external Grain Generator (=Grainfactory3) instead of AddGrain?

Regards
McCauley
Why not... I will add a switch between Addgrain & GrainFactory3 later.

thetoof
26th January 2009, 21:37
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()"

McCauley
26th January 2009, 22:25
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()"

That's exactly what i had in mind, but i didn't really understand how to implement it with eval().

Regards
McCauley

Sagekilla
26th January 2009, 22:47
One way you can do this is to make a helper function.


function EvalFunction(clip src, string "filter")
{
src
processed = Eval(filter)
return processed
}


It makes script writing easier too:

# 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)")

Codex0nz
26th January 2009, 23:14
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 :D

Nightshiver
26th January 2009, 23:21
This filter is for debanding.....

Codex0nz
26th January 2009, 23:50
This filter is for debanding.....

In my defense its still tuesday morning here -_-

The banding is caused by grain though is it not? i'll shut up now...

Nightshiver
27th January 2009, 00:46
No, not always. Grain is sometimes put in movies to cover up banding. It is also caused by bad color gradients/color. In his example picture, there was practically no grain.

Sapo84
27th January 2009, 03:00
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 :sly: (supersampling may help too).

LaTo
28th January 2009, 17:51
v1.2:
changed int->float for str parameter
added custom parameter

LaTo
28th January 2009, 18:19
PS: If you really want supersampling (I haven't seen any enhancement):

custom="spline36resize(resolution*2).addgrain(xx,0,0).spline36resize(resolution)"

:D

McCauley
28th January 2009, 18:35
Thanks for the custom clip!
Added to the wiki (http://avisynth.org/mediawiki/External_filters#Debanding).

Regards
McCauley

thetoof
28th January 2009, 20:00
Could you give the pros/cons of the different parameters in the guide... you only name them, which is not very useful for unexperienced users. (that aside, good job ^_^)

stpdrgstr
3rd February 2009, 02:19
I've been testing this, and is quite good, the only parts of the image dithered are the ones that really need it.

Though, I don't really see any difference from temp=100 or using temp=50, the grain looks the same "jumpy" with any of these.

OrionZodiac
11th February 2009, 01:25
I didn't want to start a new thread, so i posted my ply for help here.

This is the first 10 seconds of freedom OVA ep#2. The source has virtually no grain, however the color gradient is HORRIBLE. I have been trying for days trying to get rid of the banding in some way or another, but the end-result does not look very good. Somebody please take a look at the purple area in the background and tell me if you have a good solution for the banding here.

http://www.megaupload.com/?d=GM7IZQR2

Thank you

LaTo
11th February 2009, 16:30
v1.3:
replaced chroma parameter by thrC & strC

LaTo
11th February 2009, 16:38
I didn't want to start a new thread, so i posted my ply for help here.

This is the first 10 seconds of freedom OVA ep#2. The source has virtually no grain, however the color gradient is HORRIBLE. I have been trying for days trying to get rid of the banding in some way or another, but the end-result does not look very good. Somebody please take a look at the purple area in the background and tell me if you have a good solution for the banding here.

http://www.megaupload.com/?d=GM7IZQR2

Thank you

GradFun2DBmod(thr=1.2,thrC=1.8,str=0.0,strC=0.0)

edit: If the effect disappear when encoding, you should increase str & strC until the dither remains.

Video Dude
26th February 2009, 18:27
Can GradFun2DBmod be applied straight to interlace video?

Or should a SeparateFields or the Bob/filter/reinterlace method be used to apply GradFun2DBmod to interlaced video?

swaaye
20th April 2009, 05:25
Could someone please post AddGrainC 1.4 somewhere? The link from the avisynth plugin page to foxyshadis site is dead and I can't find the v1.4 plugin anywhere. Only managed to find 1.3....

Socio
20th April 2009, 13:47
LaTo I have a side question; what app are you using in that side by side comparison in the OP?

Thanks

LaTo
20th April 2009, 14:14
LaTo I have a side question; what app are you using in that side by side comparison in the OP?

Thanks
No app, just: GradFun2DBmod(show=true)

Socio
20th April 2009, 15:22
No app, just: GradFun2DBmod(show=true)

Ok got it :thanks: playing around with it now;

http://img523.imageshack.us/img523/5941/1gran.th.jpg (http://img523.imageshack.us/my.php?image=1gran.jpg)

hartford
21st April 2009, 02:59
Could someone please post AddGrainC 1.4 somewhere? The link from the avisynth plugin page to foxyshadis site is dead and I can't find the v1.4 plugin anywhere. Only managed to find 1.3....

I've uploaded to the forum the 1.4 plugin:

http://forum.doom9.org/showthread.php?t=51320

It may take time before it is approved.

Hopefully, Warpenterprises will replace the old with the new.

Where did I get this? I don't recall.

SPiKA
23rd April 2009, 19:18
Thanks LaTo, this script is amazing!

Nephilis
3rd May 2009, 16:50
Where should i use GradFun2DBmod () (to avoid color blocking in dark areas in a frame) in the filterchain? At the last of script or somewhere else? Before or after sharpen, denoise ?

Thanx in advance..

SPiKA
3rd May 2009, 17:07
It's rather pointless to use it before denoising... xD

Sagekilla
3rd May 2009, 21:34
Generally I would use debanding after denoising, but not before sharpening. If you do it before sharpening, the sharpener may accidentally sharpen your dither.

i.e:


Denoise()
Deband()

or

Denoise()
Sharpen()
Deband()

Nephilis
4th May 2009, 12:41
I'll do it so
Denoise()
Sharpen()
Deband()

Thanx a lot Sagekilla..

Zelos
5th May 2009, 18:29
it's me or it's horribly slow ? :D

Sagekilla
6th May 2009, 03:06
Well yes, It's slower than your standard Gradfun2db, but that's because it has multiple masktools operations and some temporal soften + add grain sprinkled in. Temporal soften is fairly slow, and the mt_lut's don't help any either ;)

Korben
3rd September 2009, 23:01
Nice feature. Why is it not possible to use YUY2? I got an error message:

---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:

This is not an YV12 clip ! Please convert color space to YV12 before using GradFun2DBmod()

(GradFun2DBmod.v1.3.avsi, line 136)
(E:\Capture\Project_107\1tdecimate.avs, line 91)
---------------------------
OK
---------------------------

Adub
4th September 2009, 18:15
It has to due with it's supporting plugins. One(or more) of them do not support YUY2. Simple as that.

Benus_MinO
18th October 2009, 14:25
LaTo, how I can obtain results like this?:


http://img197.imageshack.us/img197/7634/imgxc.th.png (http://img197.imageshack.us/i/imgxc.png/)

Here is source:

http://pi.fastbighost.com/~benus/Banding.m2ts

LaTo
18th October 2009, 18:57
LaTo, how I can obtain results like this?:


http://img197.imageshack.us/img197/7634/imgxc.th.png (http://img197.imageshack.us/i/imgxc.png/)

Here is source:

http://pi.fastbighost.com/~benus/Banding.m2ts

Something like this should do the job: GradFun2DBmod(thr=1.6,thrC=1.2,str=0.8,strC=0.4)

Benus_MinO
18th October 2009, 19:27
Thank you.

VincAlastor
25th November 2009, 08:24
very good filter, thank you La To. but for daily using to slow! - is there a direct compute plan? ;)

LaTo
25th November 2009, 18:26
v1.4:
changed "temp" parameter (-1=off)
updated documentation

LaTo
25th November 2009, 18:28
very good filter, thank you La To. but for daily using to slow! - is there a direct compute plan? ;)


For faster settings try:

GradFun2DBmod(adapt=-1,temp=-1)

It should be a big speed up ;)


PS: For realtime processing (viewing) you can also add mask=false.

Dreadkillz
15th December 2009, 08:22
Hi, Lato.

Could you explain what "adapt" does? When I set adapt to high values, I see more noise on brighter areas than darker areas. Setting adapt to low values, I see more noise on darker areas than brighter areas.

ryrynz
15th December 2009, 10:58
Lato, loving your LSFmod, and am using it in conjunction with deband in ffdshow in most of my scripts. Would the settings you mentioned above be an adequate replacement for deband? Is there a setting that provides in your opinion better image quality with a similar performance impact? Awesome work man.

markanini
15th December 2009, 11:23
LaTo, could you suggest some settings for a deblocking type effect?

LaTo
15th December 2009, 21:24
Could you explain what "adapt" does? When I set adapt to high values, I see more noise on brighter areas than darker areas. Setting adapt to low values, I see more noise on darker areas than brighter areas.
Yes it's true, this parameter adapts the strength of the grain depending on the brightness.

The goal is to be as close to reality and to reproduce natural film grain.

I think that adapt=64 is a good value, but it also dependent of the source... Pick the best value for your eyes ;)


Would the settings you mentioned above be an adequate replacement for deband? Is there a setting that provides in your opinion better image quality with a similar performance impact? Awesome work man.
GradFun2DBmod is particularly designed for encode to remove and/or prevent banding.

However you can use it in realtime, the quality will be better but it is slower... It's a tradeoff, I think that the ffdshow deband is faster and good enough for only viewing.


could you suggest some settings for a deblocking type effect?
Never used for deblocking, but set mask=false and increase gradually thr/str parameters until blocks disappear.

rkalwaitis
16th December 2009, 13:35
Thanks for the update Lato.

Dogway
29th December 2009, 02:16
The filter only works in certain points of the filter chain. I dont know if Im doing something wrong. Here is an example where it doesnt work for me:

ffmpegsource("whatever.mp4")

trim(0, 900)

Tweak(sat=1.2, coring=false)
Levels(4, 0.96, 242, 0, 255, coring=false)

tnlmeans(ax=4,ay=4,az=10,sx=2,sy=2,bx=1,by=1,sse=false)
# GradFun2DBmod(thr=1.6,thrC=1.2,str=0,strC=0,radius=3,range=3,mode=2,temp=-1,mask=true,adapt=64) #here it works
Lanczos4Resize(858, 482)

ttempsmooth(maxr=7)
AddBorders(4,2,4,2,color=$000000)
mfToon(strength=0, sharpen=true, cwarp=false, wdepth=15, wblur=1, wthresh=0.5)
LimitedSharpenFaster(Smode=4, strength=20, edgemode=1, soft=-1)
Crop(6, 2, -6, -4)
GradFun2DBmod(thr=1.6,thrC=1.2,str=0,strC=0,radius=3,range=3,mode=2,temp=-1,mask=true,adapt=64) # here it has no effect


Although if I place it just before the resizer it does work. Its strange... And its not only in a certain video, it happens in others as well.

Stephen R. Savage
29th December 2009, 03:41
GradFun2DB, which is the key filter underlying all of GradFun2DBmod, fails silently if the input width is not divisible by 8. After cropping, you have a width of 846, which is not divisible by 8 (nor by 4). What should be done is that the mirroring stage of GradFun2DBmod be changed to pad to a mod8 width.

Alternatively, you could crop/resize to width 840 or 848 instead of 846.

Edit: I missed the AddBorders call. The width in that script is 860, so the point still stands.

LaTo
29th December 2009, 08:34
GradFun2DB, which is the key filter underlying all of GradFun2DBmod, fails silently if the input width is not divisible by 8. After cropping, you have a width of 846, which is not divisible by 8 (nor by 4). What should be done is that the mirroring stage of GradFun2DBmod be changed to pad to a mod8 width.

Alternatively, you could crop/resize to width 840 or 848 instead of 846.

Arf, I will add a warning in GF2DBmod :thanks:

LaTo
29th December 2009, 09:03
v1.5:
added MOD4 restriction
changed script to accept MOD8 clip
updated documentation

:)

Stephen R. Savage
29th December 2009, 16:51
That is unnecessary. Enabling GradFun2DBmod to work on mod2 and mod4 (width) video is as simple as a two line fix. Also, I think GF_Padding is the only edge protection mode necessary. It offers better performance than GF_Mirrors at the corners while still being faster. GF_Borders doesn't actually work (no dithering across sharp black edge), so it doesn't fit either.

Function GF_Padding(clip clp, float thr, float thrC)
{
ow = clp.width
oh = clp.height
w = int(round(ow/8.0)*8) + 32
h = CLP.height() + 32

RDY = CLP.pointresize(w,h,-16,-16,w,h)

LUM = RDY.gradfun2db(thr).Crop(16,16,ow,oh)
CHR = RDY.gradfun2db(thrC).Crop(16,16,ow,oh)

GFP = thr==1.0 && thrC==1.0 ? CLP
\ : thr==thrC ? LUM
\ : thr!=1.0 && thrC==1.0 ? LUM.mergechroma(CLP)
\ : thr==1.0 && thrC!=1.0 ? CLP.mergechroma(CHR)
\ : LUM.mergechroma(CHR)

Return GFP
}

I think this can be worked into the other modes, but I'll leave that for you to do.

Dogway
30th December 2009, 03:43
Thank you Stephen. I spent a lot of time trying to figure out.

Being mod 8 isn't too strict? limiting to 848 pixels width either messes up the AR, or I have to crop 3 pixels each side.

I normaly prefer pixel to pixel sampling with no scaling involved, I wouldn't mind encoding anamorphic unless desktop divx players respect custom AR(?)(ie. 848x480 vs 720x480)

sorry for the offtopic bit.

LaTo
30th December 2009, 11:05
That is unnecessary. Enabling GradFun2DBmod to work on mod2 and mod4 (width) video is as simple as a two line fix.
Yes, you're right indeed... So, now it accepts mod4 input.

Also, I think GF_Padding is the only edge protection mode necessary. It offers better performance than GF_Mirrors at the corners while still being faster. GF_Borders doesn't actually work (no dithering across sharp black edge), so it doesn't fit either.
Yes, it's why GF_Padding (mode=2) is the default mode ;)





/!\ I HAVE UPDATED THE SCRIPT FOR MOD4 INPUT
YOU SHOULD DOWNLOAD AGAIN THE V1.5 /!\

kool
28th January 2010, 11:53
Hi LaTo, thanks for this wonderful script, my first time using it, need your suggestion. Here (http://www.sendspace.com/file/7c23ty) is small clip of source, I have tried with

MCTemporalDenoise(settings="medium")
GradFun2DBmod()

What will be your suggestion here?

LaTo
28th January 2010, 12:33
Hi LaTo, thanks for this wonderful script, my first time using it, need your suggestion. Here (http://www.sendspace.com/file/7c23ty) is small clip of source, I have tried with

MCTemporalDenoise(settings="medium")
GradFun2DBmod()

What will be your suggestion here?

GradFun2DBmod is integrated in MCTemporalDenoise, so you should see "enhance" option instead (faster)...

kool
28th January 2010, 12:53
ah, That is why my encoding was slow :p. Would you suggest to use MCTemporalDenoise(settings="medium") and I will get GradFun2DBmod to work with defaults, or I should touch any params?

If I want to make some changes to GradFun2DBmod, how I would do that with MCTemporalDenoise, and what are the most important param to play with?

Thanks in advance.

LaTo
28th January 2010, 14:16
ah, That is why my encoding was slow :p. Would you suggest to use MCTemporalDenoise(settings="medium") and I will get GradFun2DBmod to work with defaults, or I should touch any params?

If I want to make some changes to GradFun2DBmod, how I would do that with MCTemporalDenoise, and what are the most important param to play with?

Thanks in advance.

It's in the .avsi of MCTemporalDenoise:

### +---------+
### | ENHANCE |
### +---------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+
### | enhance : Enable GradFun2DBmod post processing to enhance flat areas (may avoid banding & blocking when encoding too) |
### | GFthr : Gradfun2db threshold [1.0=off,...] |
### | AGstr : AddGrain strength [0.0=off,...] |
### | bias : Brightness bias for adaptative grain mask (the higher, the less grain in dark areas & the more grain in bright areas) [-1=off,0=input,1...254,255=invert] |
### | temp : Temporal stabilization for grain (the higher, the more calm) [0=nervous,...,100=static] |
### +---------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Dogway
6th February 2011, 12:54
One year since last post, but I think it might be for good on the filter.

Its actually 2 things. Im having some ghosting problems on an anime source. Its in the sides of black strokes in a fast motion scene, I discarded mask, radius,mode.... I can upload example if you want.
The second one is more a petition, since this dither is going to be encoded in some way, it will mostly convert into annoying blocking. Maybe it could better fit a film grain type of noise rather than the actual small random pixels, but I know that that doesn't depend on you since gradfun calls addgrain, but maybe adding the grain size parameter could help.

egrimisu
12th February 2011, 01:35
why addgrain and not grainfactroy3? grainfactory seems more nice.

Dogway
12th February 2011, 16:44
my bad, I just discovered grainfactory3 in the first page :o Im trying to pass it through mask=true, does it work?

SilaSurfer
12th February 2011, 17:01
With mask=true you are dihtering parts where there is susceptibility that banding will occur. Why use GrainFactory's silver grain affect only in those areas, when in my opinion should be used in whole picture since it really fools your eyes that there is more detail in it.

Dogway
12th February 2011, 18:46
Why bother dithering if compression will band it again? Answer would be, use a better/different dithering or use a better/different compressor. Well, at the moment I'm looking at the first, to use grainfactory for dithering, since my target is grain free anime.

Nekomander
25th April 2011, 07:36
any suggestion/s with this? the source itself has banding issues.

http://i.imgur.com/SdvzWs.jpg (http://i.imgur.com/SdvzW.jpg)

source: here (http://www.megaupload.com/?d=ORDS0RR1) or here (http://www.mediafire.com/?rrhwddajdg7nnc5)

Vitaliy Gorbatenko
26th April 2011, 03:48
Source practically perfect. Nothing you can do with it.

Nekomander
27th April 2011, 04:51
if you look closely (bottom right) theres banding. i just can't figure out a way to get rid of it without taking away too much details.

Vitaliy Gorbatenko
27th April 2011, 11:52
You want to disguise the noise using for this? By smoothing you get nothing, when coding, since color space contains only 8 bits.

Nekomander
27th April 2011, 13:03
i just want to remove the artifact and have a result from this>
http://img124.imageshack.us/img124/3313/broken21db.png
to this>
http://img124.imageshack.us/img124/9458/source24az.png

Vitaliy Gorbatenko
28th April 2011, 05:45
Then you need to store videos in lossless format. I'll say it again - can not save the video in h264 or divx and have the picture without this artifact. All you can do - to mask its noise and no more.

cretindesalpes
28th April 2011, 12:46
The picture is perfectly colorbanding-free in YV12 colorspace. The culprit is the final YUV to RGB converter in your player. See the difference:
AVCSource ("00005.dga")
Interleave (ConvertToRGB24 ().Subtitle ("ConvertToRGB24"),
\ yv12torgb24hq () .Subtitle ("yv12torgb24hq"))


To achieve a better result, all you have to do is just adding a bit of noise. This will smooth the steps created by the RGB conversion.
AddGrainC (var=1.2, uvar=1.2)

If adding noise makes your encode too big or too noisy, try this instead:
GradFun3 (thr=0.35, ampo=2.0)

Edit : typo

Nekomander
29th April 2011, 07:11
true. switched back to my usual renderer (madvr) and it was flawless, not so with evr custom. thanks for the script/s :)

DeNeDe
17th June 2013, 09:58
hey guys,i'm trying to use this script, but can't make Megui to load it. everytime it says that "Object reference is not set to an instance of an object"

the script that i use is:

LoadPlugin("C:\Users\DeNeDe\Downloads\MeGUI_2356_x86\tools\avs\directshowsource.dll")
DirectShowSource("C:\Users\DeNeDe\Downloads\RDG_2.ts", fps=29.970, audio=false, convertfps=true).AssumeFPS(30000,1001)
#deinterlace
#crop
LanczosResize(1280,720) # Lanczos (Sharp)
#denoise
#Trim
Trim(420, 8361) ++ Trim(10160, 21338) ++ Trim(23137, 48371) ++ Trim(50170, 50768)

ConvertToYV12()

#Debanding
Import("C:\Program Files (x86)\AviSynth 2.5\plugins\GradFun2DBmod.v1.5.avsi")
GradFun2DBmod(thr=3,str=0,mask=false)

and the plugins directory from avisynth looks like this


http://i.imgur.com/jNMVQV4.png

stax76
3rd November 2019, 17:31
Maybe somebody can help me with this error.

LoadPlugin("D:\Projekte\VB\staxrip\bin\Apps\Plugins\avs\AddGrainC\AddGrainC.dll")
LoadPlugin("D:\Projekte\VB\staxrip\bin\Apps\Plugins\avs\Average\Average.dll")
LoadPlugin("D:\Projekte\VB\staxrip\bin\Apps\Plugins\AVS\DCTFilter\DCTFilter.dll")
LoadPlugin("D:\Projekte\VB\staxrip\bin\Apps\Plugins\AVS\Deblock\Deblock.dll")
Import("D:\Projekte\VB\staxrip\bin\Apps\Plugins\avs\Deblock_QED\Deblock_QED.avsi")
LoadPlugin("D:\Projekte\VB\staxrip\bin\Apps\Plugins\avs\DFTTest\dfttest.dll")
LoadPlugin("D:\Projekte\VB\staxrip\bin\Apps\Plugins\avs\EEDI2\EEDI2.dll")
LoadPlugin("D:\Projekte\VB\staxrip\bin\Apps\Plugins\avs\FFT3DFilter\fft3dfilter.dll")
LoadPlugin("D:\Projekte\VB\staxrip\bin\Apps\Plugins\avs\FFT3DGPU\FFT3dGPU.dll")
LoadPlugin("D:\Projekte\VB\staxrip\bin\Apps\Plugins\AVS\GradFun2DB\gradfun2db.dll")
Import("D:\Projekte\VB\staxrip\bin\Apps\Plugins\AVS\GradFun2DB\GradFun2DBmod.avsi")
Import("D:\Projekte\VB\staxrip\bin\Apps\Plugins\avs\LSFmod\LSFmod.avsi")
LoadPlugin("D:\Projekte\VB\staxrip\bin\Apps\Plugins\avs\masktools2\masktools2.dll")
LoadPlugin("D:\Projekte\VB\staxrip\bin\Apps\Plugins\avs\mvtools2\mvtools2.dll")
LoadPlugin("D:\Projekte\VB\staxrip\bin\Apps\Plugins\avs\RgTools\RgTools.dll")
LoadPlugin("D:\Projekte\VB\staxrip\bin\Apps\Plugins\both\ffms2\ffms2.dll")
Import("D:\Projekte\VB\staxrip\bin\Apps\Plugins\avs\MCTemporalDenoise\MCTemporalDenoise.avsi")
FFVideoSource("D:\Samples\Test.mkv", cachefile="D:\Samples\Test_temp\Test.ffindex")
MCTemporalDenoise(settings="medium")


Script Error

Script error: expected "val", "bool", "int", "float", "string", "array", or "clip"
(D:\Projekte\VB\staxrip\bin\Apps\Plugins\AVS\GradFun2DB\GradFun2DBmod.avsi, line 137, column 0)
(D:\Samples\Test_temp\Test_new.avs, line 11)


AddGrainC 1.7.1
Average 0.94
DCTFilter 0.5.0
Deblock 2013-12-03
Deblock_QED 2011-11-29
DFTTest -
EEDI2 0.9.2.0
FFT3DFilter 2.6.7
FFT3DGPU 0.8.2.0
GradFun2DB 2010-03-29
GradFun2DBmod 1.5
LSFmod 1.9
masktools2 2.2.18
mvtools2 2.7.41
RgTools 0.98
ffms2 2019-08-30 StvG
MCTemporalDenoise 1.4.20