Log in

View Full Version : MCTemporalDenoise [v1.4.20 - Update 2010/07/02]


Pages : [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

LaTo
23rd July 2008, 16:14
####################################################################################################################################
### ###
### Motion-Compensated Temporal Denoise: MCTemporalDenoise() ###
### ###
### v1.4.20 by "LaTo INV." ###
### ###
### 2 July 2010 ###
### ###
####################################################################################################################################
###
###
###
### /!\ Needed filters: MVTools (v2.5.10), MaskTools (v2.0a43),
### ------------------- LSFmod (v1.9), FFT3Dgpu (v0.8.2.7) or FFT3Dfilter (v2.1.1),
### TTempsmooth (v0.9.4), RemoveGrain + Repair (v1.0PR),
### Deblock (v1.2), Deblock_QED (25.may.2010), DctFilter (v0.0.1.4),
### EEDI2 (v0.9.2), SangNom (v1.0beta),
### GradFun2DBmod (v1.5), GradFun2db (v1.0), AddGrainC (v1.5).
###
###
###
### USAGE: MCTemporalDenoise(i, radius, sigma, twopass, useTTmpSm, limit, limit2, post, chroma, interlaced,
### sharp, adapt, strength, SHmode, SHmethod, Slimit, Sovershoot, Tlimit, Tovershoot,
### protect, cutoff, threshold, maxdiff,
### AA, useEEDI2, reduc, maxd, AAthr, method,
### deblock, useQED, quant1, quant2,
### edgeclean, ECrad, ECthr, ECmode,
### stabilize, maxr, TTstr,
### enhance, GFthr, AGstr, bias, temp,
### bwbh, owoh, blksize, overlap,
### GPU, fixband, bt, ncpu, precision,
### thSAD, thSAD2, thSCD1, thSCD2,
### truemotion, MVglobal, pel, pelsearch, search, searchparam, MVsharp, DCT,
### p, settings,
### show, screenW, screenH)
###
###
###
### MCTemporalDenoise's Post Processor :
### ------------------------------------
###
### USAGE: MCTemporalDenoisePP( denoised, source,
### sharp, adapt, strength, SHmode, SHmethod, Slimit, Sovershoot, Tlimit, Tovershoot,
### protect, cutoff, threshold, maxdiff,
### AA, useEEDI2, reduc, maxd, AAthr, method,
### deblock, useQED, quant1, quant2,
### edgeclean, ECrad, ECthr, ECmode,
### stabilize, maxr, TTstr,
### enhance, GFthr, AGstr, bias, temp,
### chroma, settings )
###
### This is the post-processor used internally in MCTemporalDenoise.
### It can be called externally if you want some specific functionality without denoising.
###
### Parameters & defaults are the same as MCTemporalDenoise.
### By default, all filters are OFF!
###
### "Sharp" & "Protect" options need 2 inputs:
### EX: source=last
### denoised=source.FFT3Dfilter()
### MCTemporalDenoisePP(denoised,source,...)
### The others only need "denoised".
###
####################################################################################################################################


Update 2010.07.02 : MCTemporalDenoise v1.4.20 (http://latoninf.free.fr/d9/MCTD/MCTemporalDenoise.v1.4.20.avsi)


v1.4.20 :
tweaked some settings
updated QED_Deblock version

v1.4.18 :
fixed anti-aliasing PP (was broken since v1.4.07)
updated MVTools-MaskTools-AddgrainC version

v1.4.16 :
added switch to avoid loading of unused filters
fixed a bug in anti-aliasing part

v1.4.08 :
fixed MOD16 warning when deblock=true

v1.4.07 :
improved masking in PP-stage
cleaned code (cosmetic)

v1.4.00 :
fixed bug with maxdiff=0
fixed speed issue in MCTemporalDenoisePP (+20%)
added "deblock" to MCTemporalDenoisePP
changed "flat" to "enhance"
cleaned and optimized all the code
changed some settings
updated documentation

v1.3.09 :
added MOD4 restriction
updated MVTools version

v1.3.00 :
added a post-denoising stage (see "post")
fixed a bug with fixFFT3D and defined p clip
changed "very high" to be less insane
renamed fixFFT3D to fixband
cleaned some stuff
adapted to LSFmod v1.8

v1.2.02 :
changed default gpu=true to gpu=false (set gpu=true if you want speed!!!)
adapted to LSFmod v1.7

v1.2.00 :
adapted for LSFmod v1.6 & GradFun2DBmod v1.3
changed sharp int->bool (deleted sharp=1)

v1.1.27 :
fixed a bug in MCTemporalDenoisePP with chroma=false
adapted for LSFmod v1.5

v1.1.26:
changed "flat" post-processing to use GradFun2DBmod
changed int->float for AGstr
fixed a small bug in AA

v1.1.24:
fixed a chroma bug with PP

v1.1.23:
adapted script for MvTools v2.3.0 (deleted MT & idx parameters)
changed MCTemporalDenoisePP's defaults (now the same as MCTD)
deleted safe parameter (slow & useless)
changed some minor things

v1.0.03:
fixed a bug in MCTemporalDenoisePP

v1.0.02:
changed defaults according to new LSFmod v1.2

v1.0.01:
fixed a speed issue in MCTemporalDenoisePP (introduced in beta5)
changed documentation about MCTemporalDenoisePP

v1.0.00:
first stable version
changed sharp=2, need LSFmod v1.0 !
fix a bug introduced in beta5

v1.0beta5:
added new sharpening routine & deleted LSF (SHmode,Slimit,Sovershoot,Tlimit,Tovershoot)
changed some code (cosmetic)

v1.0beta4:
changed some descriptions & blksize default (submitted by Didée)
added auto blksize setting (16:HD & 8:SD, if you want speed use 16)

v1.0beta3:
all post-processing filters are now usable as a standalone function (MCTemporalDenoisePP)
added MC-antialiasing (see reduc parameter)

v1.0beta2:
fixed MOD16 restriction (effective only if deblock=true)
small speedup/fix with limit>0 and/or protect=true&maxdiff>0
added warning about GPU & MT in the documentation

v1.0beta1:
changed name Udegrain --> MCTemporalDenoise (to be more specific and avoid confusion with chroma)
added the choice to use MVDegrain instead of MVCompensate+TTempSmooth (since the chroma bug in MVDegrain is fixed)
added twopass option to do the denoising job in two stage (very effective but slow)
added MT parameter for MVTools (be careful +- unstable)
added fixFFT3D parameter to prevent banding/posterize with limit=-1
added stabilize options (stabilize,maxr,TTstr)
added deblock options (deblock,useQED,quant1,quant2)
added new presets "light"(=low)/"heavy"(=medium) --> 5 presets (very high is 'a bit' extrem)
added check/warning for some settings
added thSAD2 & limit2 parameters for twopass=true
added overrange parameter for controling sharpness (useful for sharpening more than the source)
changed +- much code to implement twopass/MVdegrain/MT, should be bug free (I hope)
changed sharp->MVsharp & post->sharp
changed "light Smode4" --> LimitedSharpenFaster for sharp=2 (strength,Smode,soft,overshoot)
reduce max radius to 6
optimize chroma in PP stage (+20% with all PP on)
fix a bug with external p clip
fix a bug in Star&Bright Point Protection with maxdiff>0
added YV12&MOD16 restriction
changed some settings due to new presets
restriction when using MT=true: bt=1 in FFT3Dgpu & plane=4 in MVDegrainMulti (will be removed when fixed)

v0.9.05a:
changed version number: vX.XX branch -> v0.X.XX branch
added AA options (AA,useEEDI2,maxd,AAthr,method)
changed dering --> edgeclean: you can now use your own script (see docs)
fix bug with show=true
fix bug with chroma in PP stage
fix omission with chroma=false in MVanalyse
changed some settings
added changelog in .avsi

v0.9.01a:
added adapt & SS for sharpening
added dering option (dering, DRGrad, DRGthr, RGmode)
added flat areas processing (flat, AGstr, GFthr, bias)
added modX(=blocksize) checking
changed some default settings
updated documentation in .avsi

v0.8.08c:
fix bug with chroma=false & interlaced=true

v0.8.08b:
added mocomp contra-sharpening (basic contra-sharpening always usable)

v0.7.29a:
added star & bright points protection
changed some default options
added more options for FFT3D
added YV12 checking

v0.7.25a:
set chroma=false for light settings
added temporal limiter for sharpening

v0.7.24a:
replace blankclip by nop

v0.7.23a:
first public release


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

LaTo
23rd July 2008, 16:14
Speed comparison: (with blocksize=8 & overlap=4)

MCTemporalDenoise(settings="very low") : 9.4fps
MCTemporalDenoise(settings="low") : 4.8fps
MCTemporalDenoise(settings="medium") : 3.4fps
MCTemporalDenoise(settings="high") : 2.6fps
MCTemporalDenoise(settings="very high") : 0.5fps

GTDegrain() @default : 4.1fps
MC_Spuds() @default : 3.6fps
TemporalDegrain() @default : 2.8fps



Comparison on "normal" movie : (v1.0.00)

Source (http://latoninf.free.fr/d9/MCTD/movie_0SRC.png)

MCTemporalDenoise(settings="very low") (http://latoninf.free.fr/d9/MCTD/movie_1MCTDverylow.png)

MCTemporalDenoise(settings="low") (http://latoninf.free.fr/d9/MCTD/movie_2MCTDlow.png)

MCTemporalDenoise(settings="medium") (http://latoninf.free.fr/d9/MCTD/movie_3MCTDmedium.png)



Comparison on "300" : (v1.0.00)

Source (http://latoninf.free.fr/d9/MCTD/300_0SRC.png)

MCTemporalDenoise(settings="medium") (http://latoninf.free.fr/d9/MCTD/300_1MCTDmedium.png)

MCTemporalDenoise(settings="high") (http://latoninf.free.fr/d9/MCTD/300_2MCTDhigh.png)

MCTemporalDenoise(settings="very high") (http://latoninf.free.fr/d9/MCTD/300_3MCTDveryhigh.png)


Feedback please ;)

g-force
23rd July 2008, 17:47
Wow! beats the crap out of mine, and gives Didée's a run for it's money!

So let me get this straight. You are getting speed improvement by not doing a second degrain stage. So you've compensated the decreased degraining by either turning off truemotion and repairing the compensated frames (light mode) or not post sharpening (heavy mode). Am I reading the script correctly? If so, these are great ideas!

Some thoughts: might want to put some more options in to do the second degrain stage (I know it will slow it down, just don't make it the default)

Also, and this is more a question than anything, isn't "NOP()" faster than "BlankClip"? Seems like it should be, but I don't know for sure. It also seems like it would use less memory, since if a variable isn't needed, it isn't stored as a blank clip. Probably nothing, but might be worth looking into.

One more question. Is the Mask really necessary? isn't everything taken care of by the THSAD in MVCompensate already? I could see this if you weren't repairing after the degrain, but since you are (in the last part of your "Degrain" section) choosing either the degrained output or the prefilter depending on which is closest to the source, you really shouldn't need the mask.

These are just thoughts off the top of my head, and I love this contribution you have made!

-G

LaTo
23rd July 2008, 20:49
So let me get this straight. You are getting speed improvement by not doing a second degrain stage. So you've compensated the decreased degraining by either turning off truemotion and repairing the compensated frames (light mode) or not post sharpening (heavy mode). Am I reading the script correctly? If so, these are great ideas!
Yes, it's correct.

Some thoughts: might want to put some more options in to do the second degrain stage (I know it will slow it down, just don't make it the default)
Maybe, if some people request this... (because it's enough for my use)

Also, and this is more a question than anything, isn't "NOP()" faster than "BlankClip"? Seems like it should be, but I don't know for sure. It also seems like it would use less memory, since if a variable isn't needed, it isn't stored as a blank clip. Probably nothing, but might be worth looking into.
I don't know, some other people could help for this... (I will test tomorrow)

One more question. Is the Mask really necessary? isn't everything taken care of by the THSAD in MVCompensate already? I could see this if you weren't repairing after the degrain, but since you are (in the last part of your "Degrain" section) choosing either the degrained output or the prefilter depending on which is closest to the source, you really shouldn't need the mask.
Yes but repair with prefilter is off by default because it make some artefacts on my stuff.


Let me know if you have any suggestions ;)

Gavino
23rd July 2008, 21:37
Also, and this is more a question than anything, isn't "NOP()" faster than "BlankClip"? Seems like it should be, but I don't know for sure. It also seems like it would use less memory, since if a variable isn't needed, it isn't stored as a blank clip.
I don't know, some other people could help for this.
g-force is correct. Each use of BlankClip will use up memory.
You could assign a single instance of BlankClip to a variable and use that instead, but g-force's suggestion of NOP is the best solution. It also has the merit that if there is something wrong with your logic and the variable ends up getting used as a clip, you will get an error message.

g-force
23rd July 2008, 22:25
Yes but repair with prefilter is off by default because it make some artefacts on my stuff.



Oh, just noticed that. I hate to put the burden back on you, because it really should be up to me to see if I can break your script, but I'd be curious to see an example of the artifacts that the "choose between prefilter or degrain according to whichever is closest to the source" that your approach helps. I'm not saying that you're wrong, I'm just surprised and curious, that's all.

Okay, another suggestion: I just noticed that you have "bt" set to 1 on the fft filter. Just to warn you, Didée's gonna come down hard on you for this one. Might want to put an option in to allow switching this to the other temporal settings as well. This will help with low-frequency flickering due to heavy grain. I only know this by the experience of hounding by Didée. Plus, it seems that changing "bt" to 5 doesn't slow down the filter much.

Yet another suggestion: how about adding a temporal based limiter for the sharpening? Like this:

pshrp = last
pmax = source.MT_Logic(b1c,"max").MT_Logic(f1c,"max")
pmin = source.MT_Logic(b1c,"min").MT_Logic(f1c,"min")
RemoveGrain(3,-1)
MT_MakeDiff(last,last.RemoveGrain(12,-1))
MT_lutxy(pshrp,last,"y 128 - 1.5 * x +",U=2,V=2)
MT_Clamp(pmax,pmin,1,1,U=2,V=2)

That's all for now... Nice work!

-G

LaTo
24th July 2008, 08:22
Oh, just noticed that. I hate to put the burden back on you, because it really should be up to me to see if I can break your script, but I'd be curious to see an example of the artifacts that the "choose between prefilter or degrain according to whichever is closest to the source" that your approach helps. I'm not saying that you're wrong, I'm just surprised and curious, that's all.
it's appear with high sigma value for fft3d, it's like a flat solid color (because of heavy filtering)... I will make screenshot later. (the best is to use another clip for this job and not the prefilter clip)

Okay, another suggestion: I just noticed that you have "bt" set to 1 on the fft filter. Just to warn you, Didée's gonna come down hard on you for this one. Might want to put an option in to allow switching this to the other temporal settings as well. This will help with low-frequency flickering due to heavy grain. I only know this by the experience of hounding by Didée. Plus, it seems that changing "bt" to 5 doesn't slow down the filter much.
So, enable it by default for you... As I said, for me it's enough... :cool:


Yet another suggestion: how about adding a temporal based limiter for the sharpening? Like this:

pshrp = last
pmax = source.MT_Logic(b1c,"max").MT_Logic(f1c,"max")
pmin = source.MT_Logic(b1c,"min").MT_Logic(f1c,"min")
RemoveGrain(3,-1)
MT_MakeDiff(last,last.RemoveGrain(12,-1))
MT_lutxy(pshrp,last,"y 128 - 1.5 * x +",U=2,V=2)
MT_Clamp(pmax,pmin,1,1,U=2,V=2)
Why not...

LaTo
24th July 2008, 08:25
g-force is correct. Each use of BlankClip will use up memory.
You could assign a single instance of BlankClip to a variable and use that instead, but g-force's suggestion of NOP is the best solution. It also has the merit that if there is something wrong with your logic and the variable ends up getting used as a clip, you will get an error message.

Thanks :thanks:

Didée
24th July 2008, 10:39
Didée's gonna come down hard on you for this one.
Not at all. Right now I'm leaving for holiday:p -- Bye! :)

g-force
24th July 2008, 15:46
(the best is to use another clip for this job and not the prefilter clip)


I'd love to see that screenshot, but I agree that that heavy of a prefilter is not the best choice to use as the output sometimes.

-G

LaTo
24th July 2008, 17:45
I'd love to see that screenshot

Here with high sigma value:

Limit = -1 (http://latoninf.free.fr/udegrain/sigma20.limitON.png)
Limit = 0 (http://latoninf.free.fr/udegrain/sigma20.limitOFF.png)

Amrit
25th July 2008, 00:05
WOW

this is amazing, I might start denoising a little bit more now

check this out

Before
http://latoninf.free.fr/udegrain/movie_SRC.png
After (Light)
http://latoninf.free.fr/udegrain/movie_UDlight.png

SOME details are lost but compared to other denoisers this has preserved more than them.

CHEERS!!

Ranguvar
25th July 2008, 03:57
The only complaint I have is that eyes are messed with... When there's a very small white point in someone's eye? With chroma on, it seems to turn blue. With chroma off, it swells.

Otherwise, nice work :)

ficofico
25th July 2008, 10:12
My eyes can see only lost of detail, the above source for me it's quite perfect, no need to use any filter

LaTo
25th July 2008, 16:44
Update 2008.07.25
7.25a:
set chroma=false for light settings
added temporal limiter for sharpening

Ranguvar
25th July 2008, 19:01
Some notes for anyone trying to multithread this script with SetMTMode(). This is current as of v7.25a. LaTo, feel free to add this to the OP.


Call UDegrain from your script in mode 2.

If GPU=true (which is default), you must SetMTMode(4) before the PREFILTER block. You can SetMTMode(2) after it. Note that this is after I modified bt=1 in the fft3dgpu line to bt=3; if bt=1 you may have no problems running without mode 4. I don't know.

Under the DEGRAIN block, if limit==-1 (which is default), the lines:
DD = (limit==-1) ? mt_lutxy(pD,smD,"x 128 - abs y 128 - abs < x y ?",U=3,V=3)
\ : (limit>0) ? mt_lut(smD,"x 128 "+string(limit)+" - < 128 "+string(limit)+" - x 128 "+string(limit)+" + > 128 "+string(limit)+" + x ? ?",U=3,V=3)
\ : NOP()
must run in mode 3. You can go back to mode 2 after.

Two further notes... Some lines might run in mode 1, which uses even less RAM but should be the same speed as mode 2. I have plenty of RAM, so I haven't tested that. Also, I did not test very many features of UDegrain, some might require additional tuning... I only used light settings, radius=1, chroma, and GPU.

martino
25th July 2008, 19:10
The only complaint I have is that eyes are messed with... When there's a very small white point in someone's eye?
I think that's just how MVDegrain works. Try to apply it on some anime with scenes from space and you'll see most of the stars gone.

Ranguvar
25th July 2008, 19:13
I think that's just how MVDegrain works. Try to apply it on some anime with scenes from space and you'll see most of the stars gone.

MC_Spuds has a parameter called starfield that tries to preserve such bright points, though... adding something similar to UDegrain would be fantastic :)

martino
25th July 2008, 19:29
It shouldn't be hard, since what it basically does is create a mask (plus that you'd have to hunt down the other functions that it uses from the script and the required variables). I don't particularly remember why, but when I was writing a function of my own it didn't work as I expected it to have, so I ended up doing a crappy one for my own need. I wish I could remember a bit more about it now...

FUNCTION Starmask(clip input, bool anime, clip nullclp, float thstar, int lumathres)
...
maskstar = ConditionalFilter(maskstarvalidate, nullclp.mt_binarize(upper=false), maskstar.mt_inflate().mt_inflate, "AverageLuma()", "<", string(thStar),false)

LaTo
25th July 2008, 20:44
MC_Spuds has a parameter called starfield that tries to preserve such bright points, though... adding something similar to UDegrain would be fantastic :)
Maybe in the next version ;)

foxyshadis
26th July 2008, 01:22
Curious, if it's titled Ultimate Degrain, why not just call it UltimateDegrain() instead of UDegrain? UDegrain kind of connotates something that works with the chroma channels.

LaTo
26th July 2008, 08:33
Curious, if it's titled Ultimate Degrain, why not just call it UltimateDegrain() instead of UDegrain? UDegrain kind of connotates something that works with the chroma channels.
Ultimate? Xtrem? Awesome? Of Death?

UXADdegrain :eek: :rolleyes:

if someone have a better name... :D

(MCdegrain/MCttempsmooth?)

sarmano
26th July 2008, 17:54
LaTo
Good job!
This script much better then another in public zone, but a few moment:
- too slow on heavy mode
- didn't working with 1080p video with radius more then 2 (with x264)

LaTo
27th July 2008, 10:36
- didn't working with 1080p video with radius more then 2 (with x264)
maybe you don't have enough GPUram (memory) for 1080p, try with gpu=false...

from fft3dgpu readme:
Q: What does it mean when I get a popup box Unexpected error encountered with Error Code: D3DERR_OUTOFVIDEOMEMORY.

A: It means that fft3dgpu needs more memory than there are availebol on the graphics card. So either you will have to upgrade or try lowering the resolution, precision, bt,bh,bw,ow,oh or use usefloat16=true or mode 0 or 2

LaTo
27th July 2008, 20:46
I think that's just how MVDegrain works. Try to apply it on some anime with scenes from space and you'll see most of the stars gone.

can you provide a sample to test this? :thanks:

martino
28th July 2008, 00:07
http://www.mediafire.com/?ve3lxmm9j1f (50MB, telecined)

Enjoy.

Ranguvar
28th July 2008, 03:23
Feature request, a simple parameter to control how many motion vectors are used :) Also parameters for controlling bt, precision, and ncpu in FFT3DFilter/FFT3DFilter, but those are easy to set manually.

LaTo
29th July 2008, 14:15
v7.29a:
added star & bright points protection (default: off, see "protect")
changed some default options
added more options for FFT3D
added YV12 checking
For star & bright points protection:

Source (http://latoninf.free.fr/udegrain/starSRC.png)
Protect=false (default) (http://latoninf.free.fr/udegrain/starOFF.png)
Protect=true (http://latoninf.free.fr/udegrain/starON.png)

I haven't tested much this option (only on this source), so default settings need to be tweaked a little... I haven't be abble to reproduce the star loss with martino's sample, maybe with very high settings :confused:
Moreover I have not watched at MC_Spuds starfield parameter, maybe it's different but it works well (screenshot above) ;)

g-force
30th July 2008, 21:56
LaTo,

I see you added the temporal Min/Max limiting to the sharpening. I don't think you should limit with both "contra" and the temporal min/max, it really should be one or the other. Otherwise, after "contra" limiting, the temporal min/max limit rarely does anything because the contra limits much more than the min/max.

-G

Nikos
2nd August 2008, 16:03
LaTo, with MoComp'ed Contra-Sharpening we must use advanced sharpening routines, not just the simple 3x3 kernel Contra-Sharpening.
Read Didie's long explanation here (http://forum.doom9.org/showthread.php?p=1104251#post1104251[/url)

In my opinion, the Smode 4 from LSF is more suited.

strength = default(strength, 100)
Str=string(float(strength)/100.0)
mt_lutxy(clp, clp.RemoveGrain(11,-1), "x y == x x x y - abs 16 / 1 2 / ^ 16 * "+Str+"
\ * x y - 2 ^ x y - 2 ^ "+Str+" 100 * 25 / + / * x y - x y - abs / * + ?")


In any case thanks for your hard work.

LaTo
2nd August 2008, 18:00
LaTo, with MoComp'ed Contra-Sharpening we must use advanced sharpening routines, not just the simple 3x3 kernel Contra-Sharpening.
Read Didie's long explanation here (http://forum.doom9.org/showthread.php?p=1104251#post1104251[/url)

In my opinion, the Smode 4 from LSF is more suited.

strength = default(strength, 100)
Str=string(float(strength)/100.0)
mt_lutxy(clp, clp.RemoveGrain(11,-1), "x y == x x x y - abs 16 / 1 2 / ^ 16 * "+Str+"
\ * x y - 2 ^ x y - 2 ^ "+Str+" 100 * 25 / + / * x y - x y - abs / * + ?")


In any case thanks for your hard work.
Yes, it was already on my todo list... Thanks ;)

Honeyko
2nd August 2008, 21:22
For a real torture test, try it on this clip (http://tinyurl.com/5646r2).

...Can it remove all the grain in the second scene without introducing artifacts in the dark color-gradient area over the guy's left shoulder in the first scene?

LaTo
3rd August 2008, 05:56
For a real torture test, try it on this clip (http://tinyurl.com/5646r2).

...Can it remove all the grain in the second scene without introducing artifacts in the dark color-gradient area over the guy's left shoulder in the first scene?

udegrain(radius=3,settings="heavy") remove most of the grain...

Honeyko
3rd August 2008, 06:45
udegrain(radius=3,settings="heavy") remove most of the grain...

After finishing, is there any garbage over the guy's left shoulder in the first scene?

(How about radius=7? That is some fat-ass grains.... ;-)

LaTo
3rd August 2008, 09:28
After finishing, is there any garbage over the guy's left shoulder in the first scene?

(How about radius=7? That is some fat-ass grains.... ;-)

I don't know, test by yourself...

LaTo
3rd August 2008, 10:55
v8.08a:
added mocomp contra-sharpening (basic contra-sharpening always usable) -> see readme for usage

Nikos
3rd August 2008, 12:42
In my opinion the s4R = (post==2) ? repair(s4,smB,1,-1,-1).Mergechroma(s4) : NOP() line is not suited because now we have almost the same effect as simple contra-sharpening.
If you want to repair a little try another mode, not the 1.
The soothe(xx) is more appropriate here.

LaTo
3rd August 2008, 14:03
In my opinion the s4R = (post==2) ? repair(s4,smB,1,-1,-1).Mergechroma(s4) : NOP() line is not suited because now we have almost the same effect as simple contra-sharpening.
fixed.

Nikos
3rd August 2008, 19:05
Lato according to Didie's explanation i think for the "mocomp contra-sharpening" radius=2 it's enough.

buzzqw
4th August 2008, 13:52
Hi LaTo

i would like to add your Udegrain script to automkv, so first of all i will ask permission to include

second question: could you suggest 4 default parameters usage (light grain/medium/heavy/sharp/... whatelse this script is capable...) ?

thanks

BHH

ankurs
4th August 2008, 15:10
from another thread of mine : http://forum.doom9.org/showpost.php?p=1166451&postcount=4

any idea why ?

g-force
4th August 2008, 22:23
LaTo,

You're re-introducing a lot of unnecessary noise with your MCsharpen routine. You really should do a minblur before the difference blur. Like this:

pshrp = last
pmax = source.MT_Logic(bw1,"max").MT_Logic(fw1,"max")
pmin = source.MT_Logic(bw1,"min").MT_Logic(fw1,"min")

rg11d = MT_MakeDiff(pshrp,pshrp.RemoveGrain(12,-1))
MT_MakeDiff(pshrp,pshrp.RemoveGrain(4,-1))
MT_LUTxy(rg11d,last,"x 128 - y 128 - * 0 < 128 x 128 - abs y 128 - abs < x y ? ?")
MT_MakeDiff(pshrp,last)
MT_MakeDiff(last,last.RemoveGrain(12,-1))
MT_LUTxy(pshrp,last,"y 128 - 1.5 * x +",chroma="copy first")

#mt_lutxy(last,last.removegrain(11,-1), "x y == x x x y - abs 16 / 1 2 / ^ 16 * "+string(strength)+" * x y - 2 ^ x y - 2 ^ "+string(strength)+" 100 * 25 / + / * x y - x y - abs / * + ?", U=2, V=2)

MT_Clamp(last,pmax,pmin,0,0,chroma="copy first")

The commented out line is what you have currently.

-G

LaTo
10th August 2008, 09:06
Hi LaTo

i would like to add your Udegrain script to automkv, so first of all i will ask permission to include

No problem ;)

second question: could you suggest 4 default parameters usage (light grain/medium/heavy/sharp/... whatelse this script is capable...) ?
light = Udegrain(settings="light")
heavy = Udegrain(settings="heavy")
:devil:

After you only need to tweak the radius...

LaTo
10th August 2008, 09:07
You're re-introducing a lot of unnecessary noise with your MCsharpen routine. You really should do a minblur before the difference blur. Like this:
The old mode is always here, the 2 method are different... So don't expect the same result between these.

bairradino
25th August 2008, 16:46
Is this function suited to interlaced DV video?

LaTo
25th August 2008, 16:56
Is this function suited to interlaced DV video?
yes, just set interlaced=true

Soulhunter
25th August 2008, 19:45
Nice function! :]

Blue_MiSfit
25th August 2008, 20:03
Any chance of modifying this to work with the new fork of MVTools?

~MiSfit

bairradino
25th August 2008, 20:56
I'm trying this function with the following codeloadplugin("c:\program files\avisynth 2.5\plugins\mvtools.dll")

AviSource("c:\temp\x.avi")

ConvertToYV12()
UDegrain(settings="light",interlaced=true)
and it gives me the following error:
"MergeChroma:Images must have same with and height".

If I don't use the switch "interlaced=true" there's no error.

LaTo
26th August 2008, 05:55
I'm trying this function with the following codeloadplugin("c:\program files\avisynth 2.5\plugins\mvtools.dll")

AviSource("c:\temp\x.avi")

ConvertToYV12()
UDegrain(settings="light",interlaced=true)
and it gives me the following error:
"MergeChroma:Images must have same with and height".

If I don't use the switch "interlaced=true" there's no error.

The fix is in v8.08c, redownload this version ;)