PDA

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


Pages : [1] 2 3

LaTo
23rd July 2008, 17: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, 17: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, 18: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, 21: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, 22: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, 23: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, 09: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, 09: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, 11: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, 16: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, 18: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, 01: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, 04: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, 11: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, 17:44
Update 2008.07.25
7.25a:
set chroma=false for light settings
added temporal limiter for sharpening

Ranguvar
25th July 2008, 20: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, 20: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, 20: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, 20: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, 21: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, 02: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, 09: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, 18: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, 11: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, 21: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, 01:07
http://www.mediafire.com/?ve3lxmm9j1f (50MB, telecined)

Enjoy.

Ranguvar
28th July 2008, 04: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, 15: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, 22: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, 17: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, 19: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, 22: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, 06: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, 07: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, 10: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, 11:55
v8.08a:
added mocomp contra-sharpening (basic contra-sharpening always usable) -> see readme for usage

Nikos
3rd August 2008, 13: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, 15: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, 20:05
Lato according to Didie's explanation i think for the "mocomp contra-sharpening" radius=2 it's enough.

buzzqw
4th August 2008, 14: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, 16:10
from another thread of mine : http://forum.doom9.org/showpost.php?p=1166451&postcount=4

any idea why ?

g-force
4th August 2008, 23: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, 10: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, 10: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, 17:46
Is this function suited to interlaced DV video?

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

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

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

~MiSfit

bairradino
25th August 2008, 21: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, 06: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 ;)

LaTo
26th August 2008, 06:58
Any chance of modifying this to work with the new fork of MVTools?

~MiSfit

Yes, why not, but only when it will be stable because at this time many changes occurs each week...

LaTo
27th August 2008, 10:38
v9.01a:
changed some default settings
added modX(=blocksize) checking
added adapt & SS for sharpening
added dering option (dering, DRGrad, DRGthr, RGmode)
added flat areas processing (flat, AGstr, GFthr, bias)
updated documentation in .avsi


All (new) options are documented in the .avsi ;)

Adub
27th August 2008, 17:54
Sweet! I'll get to looking at this thing right away!

blackpanther
6th September 2008, 11:48
Looks great, thanks for the effort. Have to test it some time, when get time.

Alain2
6th September 2008, 21:51
Really like this script (v8.08b), very effective and kills less details than a mvdegrain alone
Will try the new version as well :)

LaTo
7th September 2008, 11:23
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

:p

Adub
7th September 2008, 20:11
Man, this thing is just getting better and better!! I can't wait to play around with this. And with AA added as well!!

Woohoo, keep up the awesome work LaTo!!

mozzle
7th September 2008, 21:43
Yea, thanks a lot Lato. I'm starting to get the hang of tweaking this and getting some nice results. I've noticed very good detail retention.

:thanks:

LaTo
16th September 2008, 19:23
v1.0beta:
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)


Finish... 47ko -> 81ko, it's a big update :devil:

I wait after your comments/suggestions/improvements :cool:

Didée
16th September 2008, 20:53
I played a bit with it ... not bad, really not bad! A couple of points came up, but I'll need some time to describe them (have to do sth else right now). Will post a bit later about that.

Duke123
16th September 2008, 22:28
Megui hangs when i use the following setting:-

MCTemporalDenoise()

Any idea how to get out of it?

Nightshiver
16th September 2008, 23:33
lol, it seems Lato created a filter to awesome for any program to run it :)

Dreassica
17th September 2008, 01:14
Apparently, I get out of bounds memory errors with everythign I try, even settings="very low"

Lux Delux
17th September 2008, 02:35
Had problems with Josey's last mvtools but with fizick's last v.1.10.2.1 it works fine ;)

LaTo
17th September 2008, 08:18
Problems may occurs with FFT3Dgpu or MvToolsMULTI, try gpu=false & switch to MvTools 1.10.2.1 ;)

edit: If you try with MvToolsMULTI, don't use version higher than v1.9.7.1!

Megui hangs when i use the following setting:-

MCTemporalDenoise()

Any idea how to get out of it?

I have the same problem, gpu=false solve the problem... Or don't use Megui :p

Dreassica
17th September 2008, 14:32
Heh updating mvtools to 1.9.7.5 actally fixed the problem for me.

Duke123
18th September 2008, 06:02
Now i m getting the following error now --

This is not a MOD16 clip ! Please use crop() or addborders() before using MCTemporalDenoise()
(,line 141)

Lux Delux
18th September 2008, 06:25
If you're resizing then put it before the resize. If you're not resizing and just cropping then I guess one can put it before the cropping.

If the source is SD DVD like in my case where I used the above quick workarounds :):p

Duke123
18th September 2008, 19:59
If you're resizing then put it before the resize. If you're not resizing and just cropping then I guess one can put it before the cropping.

If the source is SD DVD like in my case where I used the above quick workarounds :):p

Tried it buddy...
But not working...:confused:

Didée
18th September 2008, 21:08
Then you tried it wrongly. If you first crop, then resize to a mod16 - resolution, it will definetly work.

However, what I don't understand is why the script is imposing such a restriction at all. The very first thing that is done in the script is to pad the input to the next mod16-resolution (or to the over-next one, the code is a bit loose). Due to the padding, the restriction is met in any case, so what's the point in forbidding not-mod16 input? Outcommented that Assert() line, threw a 404*404 clip at it (404 is 'only' mod4), and it just works ... is it about FFT3DGPU (have no GPU card, so I don't know), perhaps?

LaTo
18th September 2008, 21:29
Then you tried it wrongly. If you first crop, then resize to a mod16 - resolution, it will definetly work.

However, what I don't understand is why the script is imposing such a restriction at all. The very first thing that is done in the script is to pad the input to the next mod16-resolution (or to the over-next one, the code is a bit loose). Due to the padding, the restriction is met in any case, so what's the point in forbidding not-mod16 input? Outcommented that Assert() line, threw a 404*404 clip at it (404 is 'only' mod4), and it just works ... is it about FFT3DGPU (have no GPU card, so I don't know), perhaps?
it's a restriction for deblock_QED, it crash with not-MOD16 input...
(it's a forgotten, normally this restriction should be only effective when deblock=true)

Duke123
18th September 2008, 21:38
it's a restriction for deblock_QED, it crash with not-MOD16 input...
(it's a forgotten, normally this restriction should be only effective when deblock=true)

What sud i do ?
How to overcome this problem?

LaTo
18th September 2008, 21:41
3 solutions:
- Width & height must be divisible by 16
- Comment out with # the MOD16 Assert line in the function
- Wait the next update

Duke123
18th September 2008, 21:48
# Set DAR in encoder to 5 : 3. The following line is for automatic signalling
global MeGUI_darx = 5
global MeGUI_dary = 3

Didée
18th September 2008, 21:58
it's a restriction for deblock_QED, ...
Oh, THAT's the culprit. Ayyyyy! :eek:


http://img141.imageshack.us/img141/2673/kickasspj7.png (http://imageshack.us)

(left=me, right=you) :D

Duke123
18th September 2008, 22:34
Problems may occurs with FFT3Dgpu or MvToolsMULTI, try gpu=false & switch to MvTools 1.10.2.1 ;)

edit: If you try with MvToolsMULTI, don't use version higher than v1.9.7.1!



I have the same problem, gpu=false solve the problem... Or don't use Megui :p

gpu=false solve the problem

Where to use this setting?

Nightshiver
18th September 2008, 22:59
MCTemporalDenoise(gpu=false)

Vesi
20th September 2008, 00:24
When i'm adding the line MCTemporalDenoise() i get the error.
There is no function named "FFT3Dgpu"
and I have the FFT3DFilter already in my plugin.

Nightshiver
20th September 2008, 00:31
sheesh. FFT3DGPU. GPU. It's different from FFT3DFILTER. http://avisynth.org/warpenterprises/ has it.

Vesi
20th September 2008, 00:37
I know that, I go according to this

FFT3Dfilter (v2.1.1) or FFT3Dgpu (v0.8.2.7)

saint-francis
20th September 2008, 05:34
I know that, I go according to this

FFT3Dfilter (v2.1.1) or FFT3Dgpu (v0.8.2.7)


Up several posts. You need to specify that you want to use FFT3DFilter.

MCTemporalDenoise(gpu=false)

LaTo
22nd September 2008, 09:44
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



I played a bit with it ... not bad, really not bad! A couple of points came up, but I'll need some time to describe them (have to do sth else right now). Will post a bit later about that.

@Didée: I am still waiting after your ideas/comments/improvements :D

Duke123
26th September 2008, 21:28
Problems may occurs with FFT3Dgpu or MvToolsMULTI, try gpu=false & switch to MvTools 1.10.2.1 ;)

edit: If you try with MvToolsMULTI, don't use version higher than v1.9.7.1!



I have the same problem, gpu=false solve the problem... Or don't use Megui :p

It solved d problem..:)
Thanx a lot bro.:thanks:

Adub
23rd October 2008, 05:07
Yo LaTo!
Would it be possible for you to post your edgecleaner internals as a separate function I could call? I tried looking at it, but it looks pretty tied in with all of the other stuff, so it wouldn't be easy for me to extract.

LaTo
25th October 2008, 15:43
v1.0beta3:
all post-processing filters are now usable as a standalone function (MCTemporalDenoisePP)
added MC-antialiasing (see reduc parameter)

LaTo
25th October 2008, 15:46
Yo LaTo!
Would it be possible for you to post your edgecleaner internals as a separate function I could call? I tried looking at it, but it looks pretty tied in with all of the other stuff, so it wouldn't be easy for me to extract.

Hi!
I have released a new version with the separate function ;)
(it was ready since many weeks but I was waiting after Didée's improvements... never come, maybe for beta4, it would be cool :cool:)

Sagekilla
25th October 2008, 23:23
Awhat? Motion compensated antialiasing? Now I'm curious :) How'd you get this done?

Adub
26th October 2008, 00:54
Hi!
I have released a new version with the separate function ;)
(it was ready since many weeks but I was waiting after Didée's improvements... never come, maybe for beta4, it would be cool :cool:)

Maybe you should PM him to remind him. He may have forgotten.

Didée
26th October 2008, 02:11
Forgotten is nothing. I had started writing some comments, and got this far (http://www.mediafire.com/file/hdzawznmwle/Commenting MCTemporalDenoise~.txt) before I lost interest in doing so. The real technical details haven't even started, iirc.

Adub
26th October 2008, 02:24
Would you be interested in resuming your commenting of the script then? I only ask because you state that you had lost interest.

Adub
26th October 2008, 06:29
MCTemporalDenoise has now been added to the wiki!
http://avisynth.org/mediawiki/MCTemporalDenoise

LaTo
26th October 2008, 12:05
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)

@Didée: Thanks for the report, I expect that a day you will write technical details...

@Merlin777: Thanks for the wiki.

:thanks:

Didée
26th October 2008, 18:53
One more thing I planned to nag about is the sharpening part. The "MC temporal limiting" is only used together with LSF sharpening, which are pretty much counter-indicated (with LSF defaults). LSF *first* limits the sharpening results spatially. *After* that, there is not very much left back that could be temporally limited. This doesn't create artifacts or something, it's just much effort that achieves almost nothing. The basic idea is that spatial limiting of sharpening is too restrictive (at least for strong-grained sources), and MC-compensated temporal limiting loosens that restriction. Therefore, first doing spatial limiting, then the temporal one on top of that, won't achieve much benefit.
IIRC I have told that story before ... but can't find the post now, heh.

Anyhow, I'm not thrilled by analyzing a kilometers-long script that has not the tiniest amount of comments for what locally is done, and uses "smAD rgDL oCS" style for variable names. (Yeah, I do that style myself ... but my own scripts I don't need to analyse for the logic in the flow-of-processing.)

So - does it denoise? Yes. Does it create artifacts? No. Hence, everything's fine.

Scanning such a script for possible suboptimal-ities is an imposition, and I'm not going to do that. Lack of mood, time and energy.

LaTo
26th October 2008, 20:00
One more thing I planned to nag about is the sharpening part. The "MC temporal limiting" is only used together with LSF sharpening, which are pretty much counter-indicated (with LSF defaults). LSF *first* limits the sharpening results spatially. *After* that, there is not very much left back that could be temporally limited. This doesn't create artifacts or something, it's just much effort that achieves almost nothing. The basic idea is that spatial limiting of sharpening is too restrictive (at least for strong-grained sources), and MC-compensated temporal limiting loosens that restriction. Therefore, first doing spatial limiting, then the temporal one on top of that, won't achieve much benefit.
IIRC I have told that story before ... but can't find the post now, heh.
So, we need to use Smode=4 or overshoot=10&+ ?

Didée
26th October 2008, 21:00
Smode=4 on it's own won't do very much. It's the limiting which is cruicial. Allowing a big overshoot, eventually together with Lmode=3 to not over-enhance edges, would be more in line with the idea.

But then, this of course might bring up other issues again, when the sharpening settings as a whole are too aggressive.

... If one is going to just sharpen up a denoised clip, there's only so much you can do before running into problems. Perhaps it's not the actually used methods, but rather the overall strategy which is problematic? :)

---

Consider a chess game. You've like hundred(s) possibilities to make one move. Each of the possible moves has hundred(s) of possible next moves. And so on. The sheer number of possible moves explodes exponentially, faster than one could follow.

Humans won't calculate through each and every possible move to see what will happen. Human brain is very good at pattern reckognition, and instead of calculating all possibilities, a situation is assessed in its whole (more or less), and is judged by whether it seems promising or not.
As opposed to machines, which are pretty bad at pattern reckognition, hence have to bruteforce calculate immense amounts of positions to find the good moves.

Now, imagine you are asked if it's better to put bishop on C3, or knight on F6. Yes. No. Neither. Both. Anything.

See why I'm getting tired of answering "shall I make foo().bar() or rather bar().foo()?" questions? There are no such answers, at least no *good* ones. One needs to consider a problem in its whole complexity to make good decisions. "Butterfly effect" is another catchword that might fit here.

LaTo
3rd November 2008, 19:38
Allowing a big overshoot, eventually together with Lmode=3 to not over-enhance edges, would be more in line with the idea.

But then, this of course might bring up other issues again, when the sharpening settings as a whole are too aggressive.
Thanks for these ideas! :thanks:

Now by default (beta5), spatial limiting (Slimit) is OFF and temporal limiting (Tlimit) is ON...
If Tovershoot>0, Slimit=2 (limit only edges) is a good compromise to not over-enhance edges...

LaTo
3rd November 2008, 19:39
v1.0beta5: :cool:
added new sharpening routine & deleted LSF (SHmode,Slimit,Sovershoot,Tlimit,Tovershoot)
changed some code (cosmetic)

Adub
3rd November 2008, 19:51
I have mostly updated the wiki, I just haven't modified the sharpening parameter description yet.

totya
4th November 2008, 12:04
Hi!

My video source is very noised, which settings recommended with this filter? Or which other filter recommended?

This:
ConvertToYV12
MCTemporalDenoise(settings="HIGH")

works nothing with noised picture.

Sample (http://fapomatic.com/show.php?loc=0844&f=noise.png)

Thanks!

Leak
4th November 2008, 15:25
I would have said that you should post a video clip since temporal denoising obviously can't be tested on a single picture, but the amount of noise in your image makes me wonder if there even is anything that can clean up that mess...

alph@
4th November 2008, 18:10
this is the code of mctemporaldenoise , only this ?????

####################################################################################################################################
### ###
### Motion-compensated temporal denoise: MCTemporalDenoise() ###
### ###
### v1.0beta5 by "LaTo INV." ###
### ###
### 3 November 2008 ###
### ###
####################################################################################################################################
###
###
###
### /!\ Needed filters: Masktools (v2.0a35), MVTools (v1.10.2.1) or MVToolsMULTI (v1.9.7.1),
### ------------------- FFT3Dfilter (v2.1.1) or FFT3Dgpu (v0.8.2.7),
### TTempsmooth (v0.9.4), Removegrain + Repair (v1.0PR),
### Deblock (v1.2) or Deblock_QED (18.aug.2008),
### EEDI2 (v0.9.2) or Sangnom (v1.0beta),
### Gradfun2db (v1.0), Addgrain (v1.0).
###
###
###
### USAGE: MCTemporalDenoise(i, radius, sigma, twopass, useTTmpSm, limit, limit2, fixFFT3D, chroma, GPU, MT, idx, interlaced,
### sharp, adapt, strength, SHmode, 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,
### flat, GFthr, AGstr,
### bwbh, owoh, blksize, overlap,
### truemotion, safe, MVglobal,
### bt, ncpu, precision, mode,
### thSAD, thSAD2, thSCD1, thSCD2,
### pel, pelsearch, search, searchparam, MVsharp, DCT, p, settings,
### show, screenW, screenH)
###
###
###
### MCTemporalDenoisePP:
### --------------------
###
### USAGE: MCTemporalDenoisePP( denoised, source,
### sharp, adapt, strength, SHmode, Slimit, Sovershoot, Tlimit, Tovershoot,
### protect, cutoff, threshold, maxdiff,
### AA, useEEDI2, reduc, maxd, AAthr, method,
### edgeclean, ECrad, ECthr, ECmode,
### stabilize, maxr, TTstr,
### flat, GFthr, AGstr, bias,
### chroma, idx )
###
### Parameters are the same as MCTemporalDenoise.
###
### "Sharp" & "Protect" options need 2 inputs:
### EX: source=last
### denoised=source.FFT3Dfilter()
### MCTemporalDenoisePP(denoised,source,...)
### The others only need "denoised".
###
### By default, all filters are off! If you turn ON an option, you need to specify all parameters related.
### EXAMPLE: MCTemporalDenoisePP(denoised,source,sharp=2,adapt=true,strength=200,SHmode=3,Slimit=2,Sovershoot=0,Tlimit=true,Tovershoot=2)
### AND NOT: MCTemporalDenoisePP(denoised,source,sharp=2)
###
###########################################################################################################

LaTo
4th November 2008, 19:02
this is the code of mctemporaldenoise , only this ?????
Nooooo! Look at the first post!!!

alph@
4th November 2008, 19:22
ok , thanks lato:o

totya
4th November 2008, 19:42
this is the code of mctemporaldenoise , only this ?????

"#" = remark

Adub
4th November 2008, 20:49
Honestly, there is more noise than picture. My recommendation would be to find a different source.

totya
4th November 2008, 21:30
I would have said that you should post a video clip since temporal denoising obviously can't be tested on a single picture, but the amount of noise in your image makes me wonder if there even is anything that can clean up that mess...

Hi!

Sample (http://rapidshare.com/files/160675693/noise_example_2008-11-04_4sec.avi.html)

totya
4th November 2008, 21:31
Honestly, there is more noise than picture. My recommendation would be to find a different source.

Hi!

I know this. But about 1-2 month this analog signal is stay.

Thanks.

Mug Funky
7th November 2008, 07:28
had to use that image host... some of us are at work you know...

you'll probably want a degrainer designed with impulses in mind for that sample there. there's a pretty lightweight mc'd version of removedirt lying around somewhere. one day i'll merge it with my hardcore degrainer script (that gives similar results to this one but with much, much fewer tweakable settings. nothing but SAD thresh for strength of denoising, scenechange thresh and pel).

basically once you're rid of the big white bits a denoiser can make a bit more sense of the rest of the picture.

LaTo
11th November 2008, 16:11
v1.0.00:
first stable version
changed sharp=2, need LSFmod v1.0 (http://forum.doom9.org/showthread.php?t=142706) !
fix a bug introduced in beta5

totya
11th November 2008, 17:06
Honestly, there is more noise than picture. My recommendation would be to find a different source.

Signal is back, source is good again :)

Adub
11th November 2008, 20:16
@totya
Good to hear. Now you should actually be able to do some real work with your source.

@LaTo
Downloading and testing in progress. I will probably be able to report on things this weekend, as I have some midterms to be studying for.

LaTo
15th November 2008, 09:24
v1.0.01:
fixed a speed issue in MCTemporalDenoisePP (introduced in beta5)
changed documentation about MCTemporalDenoisePP

totya
15th November 2008, 11:20
v1.0.01:
fixed a speed issue in MCTemporalDenoisePP (introduced in beta5)

Thx!

Please tell me shortly if possible, what is the different between MCTemporalDenoise and MCTemporalDenoisePP.

Small remark:

1. Addgrain v1.0 need of MCTemporalDenoise, but I not found this file, I found only Addgrain v1.4 here (http://avisynth.org.ru/docs/english/externalfilters/addgrain.htm). This file is OK? If not, please put me link where I can download Addgrain v1.0

2. U wrote : "Needed filters...EEDI2 (v0.9.2) or Sangnom (v1.0beta)"

This is small error, because if (default) settings is VERY LOW or LOW this filter use EEDI2, but if settings is MEDIUM, HIGH, OR VERY HIGH, this filter use Sangnom, and I get error msg: "Script error: there is no function named "Sangnom".

I suggest, the old line:
EEDI2 (v0.9.2) or Sangnom (v1.0beta)
corrected line:
EEDI2 (v0.9.2), Sangnom (v1.0beta),

Thx!

Adub
15th November 2008, 22:43
I suggest, the old line:
EEDI2 (v0.9.2) or Sangnom (v1.0beta)
corrected line:
EEDI2 (v0.9.2), Sangnom (v1.0beta)

This isn't a bad point.

As to your first question, MCTemporalDenoise uses MCTemporalDenoisePP.

MCTemporalDenoise does most of the actual denoising, through the use of MVTools and so on. MCTemporalDenoisePP is the Post-Processor. Basically, it can do everything from sharpening to deblocking to dehaloing, etc, after the main denoising function (MCTemporalDenoise) has done it's job.

One reason why it is a separate function is because I had asked earlier on if it would be possible to call the dehaloing capabilities outside of the MCTemporalDenoise script. LaTo came up with the current implementation. Which is actually very cool, as we can now call ALL of the post-processing techniques outside of the main denoising function.

totya
16th November 2008, 00:54
Hi!

Thx for answer!

This isn't a bad point.

My verdict is different, but np.


As to your first question, MCTemporalDenoise uses MCTemporalDenoisePP (...)

OK, I Know, thx. I see headers in source. MCTemporalDenoisePP name is fake, because this function can't denoise.
Anyway... MCTemporalDenoise is denoiser with postprocessing, MCTemporalDenoisePP only postprocessor.

PP=PostProcessor

I think not bad idea, if this info present in nfo (avsi), but not only in changelog (1.0beta3).

Thanks again.

Adub
16th November 2008, 06:12
Hi!

My verdict is different, but np.

No, I was agreeing with you. Read my sentence again. I said that your point was not a bad one.

MCTemporalDenoise does all of the actual degraining. It calls MCTemporalDenoisePP when it wants to do some actual post-processing. You can look at the code yourself if you don't believe me.

MCTemporalDenoisePP name is fake, because this function can't denoise. I wouldn't quite call it fake. Essentially, it is the post-processor in the MCTemporalDenoise chain. Another way to look at the name is "MCTemporalDenoise's Post Processor".

I think not bad idea, if this info present in nfo (avsi), but not only in changelog (1.0beta3).
I will agree that MCTemporalDenoisePP could be slightly better labeled in the avsi. Right now it's just a description of parameters. It could have a line right above it saying, "MCTemporalDenoisePP: This is the post-processor used in MCTemporalDenoise after all denoising has been completed . It can also be called externally if the user desires some specific funtionality, such as the use of MCTemporalDenoisePP's dehaloing technique."

Or something like that.

LaTo
16th November 2008, 08:59
I suggest, the old line:
EEDI2 (v0.9.2) or Sangnom (v1.0beta)
corrected line:
EEDI2 (v0.9.2), Sangnom (v1.0beta),

I will agree that MCTemporalDenoisePP could be slightly better labeled in the avsi. Right now it's just a description of parameters. It could have a line right above it saying, "MCTemporalDenoisePP: This is the post-processor used in MCTemporalDenoise after all denoising has been completed . It can also be called externally if the user desires some specific funtionality, such as the use of MCTemporalDenoisePP's dehaloing technique."

Thanks, I will do that... ;)

EDIT: I have updated a little the documentation, you should re-download v1.0.01 if you want it :D

totya
17th November 2008, 14:08
Thanks, I will do that... ;)

EDIT: I have updated a little the documentation, you should re-download v1.0.01 if you want it :D

I see, now this correct. Thx!

steptoe
23rd November 2008, 11:52
Any chance of somebody linking to all the required plugins as I think I have them all, but making sure I have the specific versions as listed in the wiki is a bit hit and miss and getting the extra filters that some of the required filters need is getting confusing

Many thanks

Could the package link be added to the wiki or is that not allowed as it uses other peoples filters and work

LaTo
23rd November 2008, 19:06
v1.0.02:
changed defaults according to new LSFmod v1.2

Avisynth_challenged
24th November 2008, 08:28
I've been testing the latest version of MCTemporalDenoise (v1.0.02) on an analog capture of a laserdisc source. I've uploaded some screenshots for review, comments, and critique.

There are 16 images total, broken into groups of 4, as follows


SAMPLE 1: A frame from a daytime scene with lots of motion
Image01 = source (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_source_1.png)
Image02 = MCTemporalDenoise v1.0.02 (settings="low") (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_low_1.png)
Image03 = MCTemporalDenoise v1.0.02 (settings="medium") (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_med_1.png)
Image04 = MCTemporalDenoise v1.0.02 (settings="high") (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_high_1.png)

SAMPLE 2: A frame from a daytime scene very little motion
Image05 = source (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_source_2.png)
Image06 = MCTemporalDenoise v1.0.02 (settings="low") (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_low_2.png)
Image07 = MCTemporalDenoise v1.0.02 (settings="medium") (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_med_2.png)
Image08 = MCTemporalDenoise v1.0.02 (settings="high") (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_high_2.png)

SAMPLE 3: A frame from a nighttime scene with lots of motion
Image09 = source (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_source_3.png)
Image10 = MCTemporalDenoise v1.0.02 (settings="low") (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_low_3.png)
Image11 = MCTemporalDenoise v1.0.02 (settings="medium") (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_med_3.png)
Image12 = MCTemporalDenoise v1.0.02 (settings="high") (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_high_3.png)

SAMPLE 4: A frame from a nighttime scene very little motion
Image13 = source (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_source_4.png)
Image14 = MCTemporalDenoise v1.0.02 (settings="low") (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_low_4.png)
Image15 = MCTemporalDenoise v1.0.02 (settings="medium") (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_med_4.png)
Image16 = MCTemporalDenoise v1.0.02 (settings="high") (http://i252.photobucket.com/albums/hh18/FoolsTalk/mctdenoise_v1002_high_4.png)

*Note: The sample frames in the above links contain problems other than noise (mainly aliasing and edge ghosting), but I'm going to attack the task of denoising with MCTemporalDenoise first before moving on to the other problems.


The script I used was very basic:
##############
##############
###Import("C:\program files\avisynth 2.5\plugins\mctemporaldenoise.v1.0.01.avs")
###Import("C:\program files\avisynth 2.5\plugins\lsfmod.v1.1.avs")
Import("C:\program files\avisynth 2.5\plugins\mctemporaldenoise.v1.0.02.avs")
Import("C:\program files\avisynth 2.5\plugins\lsfmod.v1.2.avs")


### CHOOSE 1 SOURCE ONLY ###
#source=DirectshowSource("path\sample_dynamic_bright.avi")
#source=DirectshowSource("path\sample_static_bright.avi")
#source=DirectshowSource("path\sample_dynamic_dark.avi")
source=DirectshowSource("path\sample_static_dark.avi")


### CHOOSE 1 LINE ONLY ###
#final=source.mctemporaldenoise(gpu=false, settings="low")
#final=source.mctemporaldenoise(gpu=false, settings="medium")
final=source.mctemporaldenoise(gpu=false, settings="high")

return final
##############
##############


It appears that the optimum setting in all 4 samples is medium. However, I'd appreciate any comments or feedback from others before I start processing the entire source with MCTemporalDenoise. Thanks in advance to anyone who reads and responds. :) :) :)

Adub
24th November 2008, 09:40
I would have to agree with your choice of medium settings. Remember you can also use the post processing capabilities of MCTemporalDenoise to help with halo's, combing, blocking, and also to help sharpen up the image a bit.

Also, you can even fine tune your filtering even further using the strength and frames parameters, so you can get it exactly to your liking.

totya
24th November 2008, 11:31
Hi!

My favorit settings is "high", with noised TV source. But this settings is slow... about 2-3 fps.

My script:

AviSource("source.avi", true)
ConvertToYV12(interlaced=TRUE)
MCTemporalDenoise(settings="...", MT=TRUE, interlaced=TRUE)
#nnedi

without filter (http://i472.photobucket.com/albums/rr86/totyax/none.png)
medium settings (http://i472.photobucket.com/albums/rr86/totyax/medium.png)
high settings (http://i472.photobucket.com/albums/rr86/totyax/high.png)

Adub
24th November 2008, 20:42
Yes, high works quite well. For that source.

Note: You also have some interlacing, aliasing, and dot crawl artifacts on that source.

Note2: I have to admit, high works really well on that source. Cleans it right up just perfectly.

LaTo
30th November 2008, 15:58
Update MVT2alpha - 2008/11/30:

I have added the MvTools2 version of MCTemporalDenoise...

Please test & report ;)

moviefan
30th November 2008, 17:21
I experience CPU usage around 50% only with my E5200 CPU, using x264 to encode 1080p material. Can anyone explain this and tell me how to make the CPU work at maximum power? CPU0 and CPU1 are set in the task manager for the process...

Sagekilla
30th November 2008, 17:39
If that were the case, I'd be inclined to say MCTemporalDenoise is being a bottleneck for x264. You can either use slower settings on x264, or try to use the multithreaded MVtools built into MCTD.

moviefan
30th November 2008, 18:05
Hm, the multithreaded means the old MCTD (not the new alpha for MVTools 2) right? That one caused occasionally some artefacts... But I thought, MVTools 2 is multithreaded, so it should be a little faster. And how come that I have more or less exactly 50% usage? It's somehow weird... I use the up to date MT plugin with the attached avisynth.dll in mode 2. Is that a problem?

Edit: Okay, for tests I have now running two converts to lagarith lossless using VirtualDubMod in parallel. CPU usage is now at 100% and I have assigned each VirtualDubMod process one CPU core. Speed is the same as if I ran only one converting process... So encoding two clips in parallel has doubled the output... Any explanation?

Sagekilla
30th November 2008, 18:16
Nope. MVTools 2 isn't multithreaded. MVTools 2 is MVTools 1 without the idx and some other changes. Otherwise, neither are multithreaded. The builds by Josey_wells (MVAnalyseMulti, etc) is the multihreaded build.

It's fairly trivial to modify the code for the latest MCTemporalDenoise and have it use the MT'ed MVTools. Just download the latest build (which you'll have to dig around in the MVTools thread for) and replace the various functions with the MT'ed variants.

moviefan
30th November 2008, 18:27
Hm, concerning the MT'ed MCTD, the MVTools 1 version supports the MT'ed branch using parameter MT=true, but I got weird artefacts on some rare occasions... So as a workaround the only option seems to be a parallel encode to e.g. lagarith and then a simple encode using x264...

LaTo
30th November 2008, 19:36
Edit: Okay, for tests I have now running two converts to lagarith lossless using VirtualDubMod in parallel. CPU usage is now at 100% and I have assigned each VirtualDubMod process one CPU core. Speed is the same as if I ran only one converting process... So encoding two clips in parallel has doubled the output... Any explanation?

Maybe you forgot "--threads auto --thread-input" in x264 :confused:

Fizick
30th November 2008, 20:03
Hm, concerning the MT'ed MCTD, the MVTools 1 version supports the MT'ed branch using parameter MT=true, but I got weird artefacts on some rare occasions...

That is why MVTools v2 is developing....

LaTo
30th November 2008, 21:17
With MCTemporalDenoise @default:

Old MvTools v1.11.4.5 : 3.90fps
New MvTools v2.2.1 : 4.60fps

+20%... Great!

moviefan
30th November 2008, 22:25
No, I have set the x264 parameters correctly... The ~50% also apply to lossless conversion to lagarith...

Avisynth_challenged
30th November 2008, 23:29
I'm very impressed with LaTo's MCTemporalDenoise script function. It is so easy to use, and it just plain works if you take some time to optimize it for your particular source. I just thought I'd say thanks to LaTo for the script, to post some screenshots (and my Avisynth script which generated them) showing how effective MCTemporalDenoise is, and to see if everyone reading this thread agrees that I'm properly understanding and using MCTemporalDenoise (and MCTemporalDenoisePP) for my particular source, which is an analog capture of a movie off of laserdisc.

Thanks to anyone who reads and chimes in :) :) :)

Here is my Avisynth script using MCTemporalDenoise (v1.0.02):
##############
##############
###Import("C:\program files\avisynth 2.5\plugins\mctemporaldenoise.v1.0.01.avs")
###Import("C:\program files\avisynth 2.5\plugins\lsfmod.v1.1.avs")
Import("C:\program files\avisynth 2.5\plugins\mctemporaldenoise.v1.0.02.avs")
Import("C:\program files\avisynth 2.5\plugins\lsfmod.v1.2.avs")


source=DirectshowSource("path\source1.avi")
#source=DirectshowSource("path\source2.avi")
############


### CHOOSE 1 LINE ONLY ###
######final=source.mctemporaldenoise(gpu=false, settings="low")
denoised=source.mctemporaldenoise(gpu=false, settings="medium")
#denoised=source.addborders(0,0,0,2).mctemporaldenoise(gpu=false, settings="medium").crop(0,0,-0,-2)
######denoised=source.mctemporaldenoise(gpu=false, settings="high")
############


denoisedpp=MCTemporalDenoisePP(denoised, source, protect=true, cutoff=64, threshold=16, maxdiff=4)
############
### COMMENTS ON USAGE
### sharp, adapt, strength, SHmode, SHmethod, Slimit, Sovershoot, Tlimit, Tovershoot,
### protect, cutoff, threshold, maxdiff,
### AA, useEEDI2, reduc, maxd, AAthr, method,
### edgeclean, ECrad, ECthr, ECmode,
### stabilize, maxr, TTstr,
### flat, GFthr, AGstr, bias,
### chroma, idx )
###
### This is the post-processor used internally in MCTemporalDenoise.
### It can be called externally if you want some specific functionality.
###
### Parameters are the same as MCTemporalDenoise.
###
### "Sharp" & "Protect" options need 2 inputs:
### EX: source=last
### denoised=source.FFT3Dfilter()
### MCTemporalDenoisePP(denoised,source,...)
### The others only need "denoised".
###
### By default, all filters are off! If you turn ON an option, you need to specify ALL parameters related.
### EXAMPLE: MCTemporalDenoisePP(final,source,sharp=2,adapt=true,strength=200,SHmode=3,SHmethod=1,Slimit=2,Sovershoot=0,Tlimit=true,Tovershoot=2)
### AND NOT: MCTemporalDenoisePP(denoised,source,sharp=2)
############


############
function antialiasing( clip orig, int "th_luma", int "th_croma", string "type", int "order", int "aath", bool "HQedge")
{

# "th_luma" and "th_croma" affect directly the edge detection: higher values = more edges filtered
# set "order = 0" for Top Field First; order = 1 --> Bottom Field First
# aath = anti-aliasing strenght (default should be fine)


th_luma = Default(th_luma, 20)
th_croma = Default(th_croma, 20)
type = Default(type, "sobel")
order = Default(order, 1)
aath = Default(aath, 48)
HQedge = Default(HQedge, false)
ox = orig.width
oy = orig.height
dx = orig.width * 2
dy = orig.height * 2

orig.convertToYV12()
a=last
b=spline36resize(dx, dy).TurnLeft().SangNom(order,aath).TurnRight().SangNom(order,aath)
###b=spline36resize(dx, dy).turnright().nnedi(dh=true, field=1).turnleft()

# native chroma edges:
#c=b.lanczosresize(ox,oy).EdgeMask(0, th_luma, 0, th_croma, type,Y=3,U=3,V=3)

# use luma edges for chroma:
c=b.spline36resize(ox,oy).EdgeMask(0, th_luma, 0, th_croma, type,Y=3,U=1,V=1).FitY2UV()

d= logic( b.DEdgeMask(0,255,0,255,"5 10 5 0 0 0 -5 -10 -5", divisor=4,Y=3,U=1,V=1)
\ ,b.DEdgeMask(0,255,0,255,"5 0 -5 10 0 -10 5 0 -5", divisor=4,Y=3,U=1,V=1)
\ ,"max").greyscale.levels(0,0.8,128,0,255,false).FitY2UV().spline36resize(ox,oy)
b=b.spline36resize(ox,oy)

HQedge ? MaskedMerge(a,b,d,Y=3,U=3,V=3) : MaskedMerge(a,b,c,Y=3,U=3,V=3)
}
############


denoisedppaa=denoisedpp.antialiasing(th_luma=20, th_croma=20, type="sobel", order=1, aath=18, HQedge=false)

denoisedppaasharp1=denoisedppaa.sharpen(0.25)

denoisedppaasharp=MCTemporalDenoisePP(denoisedppaa, denoisedppaasharp1, sharp=2, adapt=true, strength=100, SHmode=3, SHmethod=3, Slimit=0, Sovershoot=0, Tlimit=true,Tovershoot=0)
#interleave(source,denoised,denoisedpp,denoisedppaa,denoisedppaasharp)
#return last


image1=source
image2=denoised
image3=denoisedpp
image4=denoisedppaa
image5=denoisedppaasharp

#stackvertical(image1,image2,image3,image4,image5)
interleave(image1,image2,image3,image4,image5)
return last
##############
##############

Notes on the 5 images in the following screenshot links:

Image1 (http://i252.photobucket.com/albums/hh18/FoolsTalk/denoisetest1.png) = SOURCE

Image2 (http://i252.photobucket.com/albums/hh18/FoolsTalk/denoisetest2.png) = Image1.MCTemporalDenoise(settings="medium")

Image3 (http://i252.photobucket.com/albums/hh18/FoolsTalk/denoisetest3.png) = MCTemporalDenoisePP(Image2, Image1, protect=true, cutoff=64, threshold=16, maxdiff=4)
Note: Bright points protection - demonstrated by the restoration of the white spot behind the bearded man's head.

Image4 (http://i252.photobucket.com/albums/hh18/FoolsTalk/denoisetest4.png) = Image3.antialiasing(th_luma=20, th_croma=20, type="sobel", order=1, aath=18, HQedge=false)
Note: Function Antialiasing is in the script above

Image5 (http://i252.photobucket.com/albums/hh18/FoolsTalk/denoisetest5.png) = MCTemporalDenoisePP(Image4, Denoisedppaasharp1, sharp=2, adapt=true, strength=100, SHmode=3, SHmethod=3, Slimit=0, Sovershoot=0, Tlimit=true,Tovershoot=0)
Note: MCTemporalDenoise sharpening function call, where Denoisedppaasharp1=Image4.sharpen(0.25) -- see script above

Adub
1st December 2008, 05:15
You do know that MCTemporalDenoise already calls MCTemporalDenoisePP for you? Essentially, all your processing could be done in your Image2 line. In fact, you are OVER processing your source, with the extraneous call to MCTemporalDenoisePP.

LaTo
2nd December 2008, 21:14
No, I have set the x264 parameters correctly... The ~50% also apply to lossless conversion to lagarith...

Strange, try gpu=false...



Notes on the 5 images in the following screenshot links:

Image1 (http://i252.photobucket.com/albums/hh18/FoolsTalk/denoisetest1.png) = SOURCE

Image2 (http://i252.photobucket.com/albums/hh18/FoolsTalk/denoisetest2.png) = Image1.MCTemporalDenoise(settings="medium")

Image3 (http://i252.photobucket.com/albums/hh18/FoolsTalk/denoisetest3.png) = MCTemporalDenoisePP(Image2, Image1, protect=true, cutoff=64, threshold=16, maxdiff=4)
Note: Bright points protection - demonstrated by the restoration of the white spot behind the bearded man's head.

Image4 (http://i252.photobucket.com/albums/hh18/FoolsTalk/denoisetest4.png) = Image3.antialiasing(th_luma=20, th_croma=20, type="sobel", order=1, aath=18, HQedge=false)
Note: Function Antialiasing is in the script above

Image5 (http://i252.photobucket.com/albums/hh18/FoolsTalk/denoisetest5.png) = MCTemporalDenoisePP(Image4, Denoisedppaasharp1, sharp=2, adapt=true, strength=100, SHmode=3, SHmethod=3, Slimit=0, Sovershoot=0, Tlimit=true,Tovershoot=0)
Note: MCTemporalDenoise sharpening function call, where Denoisedppaasharp1=Image4.sharpen(0.25) -- see script above


As Merlin7777 said, you can simply try this:

MCTemporalDenoise(settings="medium",protect=true,aa=true,sharp=2)



OR, if you want to use your own antialiasing script:

source=last

MCTemporalDenoise(settings="medium",protect=true,sharp=0)

Antialiasing(th_luma=20, th_croma=20, type="sobel", order=1, aath=18, HQedge=false)

MCTemporalDenoisePP(last, source, sharp=2, adapt=true, strength=100, SHmode=3, SHmethod=3, Slimit=0, Sovershoot=0, Tlimit=true,Tovershoot=0)

Avisynth_challenged
3rd December 2008, 17:40
Thank you Merlin7777 and LaTo. I've modified my script according to your suggestions. I appreciate the feedback :)

LaTo
7th December 2008, 20:47
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

steptoe
11th December 2008, 01:29
Any chance of creating a link to something that has a package of all filters and functions that are used as its now getting quite complex to get them all and make sure you have the right versions

Even an archive with all filters in their archived forms is better than nothing as I'm not sure if I have all the correct versions any more and trying to find some of the filters turns up that they also need other filters to run themselves

Adub
11th December 2008, 06:03
Damn, the new version is way faster. I was getting about 3.98fps. Now I am getting 5.5fps. On one thread. If I use setmtmode(2), I get over 20fps. This is on 720x480 footage. Hell yes for MVtools2!! Now, I just need MC_Spuds to update as well and I will be one happy camper.

mozzle
11th December 2008, 07:53
Just to echo Merlin's sentiments, I'm thoroughly enjoying around a 20% speed improvement when using MCTemporalDenoise 1.1.23 along with MVTools 2.3.0.0

Major kudos to LaTo and fizick!!!

:thanks:

totya
11th December 2008, 16:06
If I use setmtmode(2), I get over 20fps

lol

MCTemporalDenoise support this?

moviefan
11th December 2008, 22:56
There seems to be an issue with "edgeclean=true". When I used it (the MVTools2 version), some frames were OK (no comment about the actual edge cleaning here), but some other frames were bleached... When I turned it off, the colors were fine again. I hope this bug report helps to further improve your amazing script, LaTo! Thanks for your efforts!

Adub
11th December 2008, 23:05
lol

MCTemporalDenoise support this?

Yep, it runs just fine. I just ran it on Constantine last night using MeGUI, and this morning I have a nice little mkv waiting for me. Works 100% okay.

I will test the edgeclean=true bug.

pdadi
11th December 2008, 23:17
Hi, Great work. I am getting there is no function named Msuper (line,650) with following settings

MCTemporalDenoise(settings="medium",gpu=false)

I appreciate your help

thetoof
12th December 2008, 00:01
MCTemporalDenoise support this?sure does! MVTools2 is even more stable than v1 with setmtmode

Hi, Great work. I am getting there is no function named Msuper (line,650) with following settingsDo you have the latest version of MVTools2?

pdadi
12th December 2008, 00:44
Do you have the latest version of MVTools2?

Thanks works now. Can I delete mvtools v1 then?

thetoof
12th December 2008, 01:42
Unless you still use scripts that use mvtools1, yes. It'll take some time for the old scripts to be adapted to the new syntax (especially since it has just changed), so I think you'll still need v1 for a little while.

pdadi
12th December 2008, 01:53
Thanks thetoof, I am not seeing any performance improvments with setmtmode(2,0). Mine is a quadcore 9400 with 8 GB RAM. CPU is at 30%.

setmtmode(2,0)
MCTemporalDenoise(settings="high",gpu=false,truemotion=false,sharp=0,ncpu=4)

Getting around 3FPS on x264 HQ profile first pass.

LaTo
12th December 2008, 08:17
There seems to be an issue with "edgeclean=true". When I used it (the MVTools2 version), some frames were OK (no comment about the actual edge cleaning here), but some other frames were bleached... When I turned it off, the colors were fine again. I hope this bug report helps to further improve your amazing script, LaTo! Thanks for your efforts!
Thanks for report, should be fixed in v1.1.24 :)

For edgeclean=true, I recommend to try another thing that ECmode's default : it's a simple RemoveGrain by default... (dfttest is great but slow)



EDIT: Update 12/12/2008
v1.1.24:
fixed a chroma bug with PP

sho_t
12th December 2008, 18:48
For edgeclean=true, I recommend to try another thing that ECmode's default : it's a simple RemoveGrain by default... (dfttest is great but slow)


I think that TBilateral() is better than dfttest() for animation source. (I tried only by the animation source)
LaTo may have already tried it too...

steptoe
13th December 2008, 11:42
Thanks thetoof, I am not seeing any performance improvments with setmtmode(2,0). Mine is a quadcore 9400 with 8 GB RAM. CPU is at 30%.

setmtmode(2,0)
MCTemporalDenoise(settings="high",gpu=false,truemotion=false,sharp=0,ncpu=4)

Getting around 3FPS on x264 HQ profile first pass.



If that is your script, then you are missing the important MT command that is needed to multi-thread filters

Try this :

MT("MCTemporalDenoise(settings="high",gpu=false,truemotion=false,sharp=0,ncpu=4)")

or

MT("""
MCTemporalDenoise(settings="high",gpu=false,truemotion=false,sharp=0,ncpu=4)
""")


The 2nd one just lets you run MT on a block of filters instead of applying it per filter or function

Not forgetting to copy the patched avisynth.dll to your windows\system32 folder in your C:\ drive or where you have Windoze installed

Otherwise nothing will happen again, and bear in mind that this patch only currently works on AviSynth 2.57, maybe he's waiting for a stable 2.58 to release the update


Also, try SETMTMode(2,4) to force is to use 4 threads, for a quad core, that way you know its running on 4 threads instead of letting the software decide how many threads to run on. Some also run it with SETMTMode(2,8) to force 8 threads with success

Gavino
13th December 2008, 19:05
If that is your script, then you are missing the important MT command that is needed to multi-thread filters. Try this :
MT("MCTemporalDenoise(settings="high",gpu=false,truemotion=false,sharp=0,ncpu=4)")
or
MT("""
MCTemporalDenoise(settings="high",gpu=false,truemotion=false,sharp=0,ncpu=4)
""")
The 2nd one just lets you run MT on a block of filters instead of applying it per filter or function
The first one will give you a syntax error because the opening quote of "high" is taken as the closing quote of "MCTemporal...".
The second (triple-quote) form is required, to allow a string literal inside the complete string. It is unconnected with using a block of filters, since ordinary (single-quote) strings can also contain line breaks.

Bear in mind also that MT splits each frame in two and processes each half in a separate thread. Not all filters will work correctly doing this - I don't know enough about MCTemporalDenoise to say whether this is appropriate or not, but my instinct would say no (eg the clip could contain motion between the two halves).

It is not necessary to use the MT filter to get multi-threading, its action is complementary to SetMtMode.

thetoof
13th December 2008, 19:47
Exactly, setmtmode splits the clip temporally to multithread it, while mt splits it spatially. You do NOT want the latter with mo-comped processing.
Possible issues:
-Encoder is the bottleneck
-You could/should use more/less threads (check which # is faster (not higher CPU usage, faster)
-You don't have enough memory (use a higher SetMTmode, you can even go up to 1900... though I don't fully know the issues that could come up if the setting is too high)
Please post your full script and the CPU/speed results you get by varying the # of threads. Remember that x264 also works with many threads, so it's all about balancing which step gets more threads for optimal efficiency.

steptoe
13th December 2008, 21:32
I stand corrected, I always thought you had to use MT("") to get the filter to work with multi-threaded

Maybe I need to go back and study the MT docs on the wiki again and again to try and understand how it really works and when or when not to try and use it

Digitals
6th January 2009, 15:10
i am getting this error

"Msuper" (line 652),i hav installed mvtools2 still same prob

thetoof
6th January 2009, 20:15
Do you have MVTools 2.3.1?

Digitals
7th January 2009, 05:02
^ yes i hav installed MVtools 2.3.1 only

Sagekilla
7th January 2009, 05:36
Also, another issue is where you place SetMTMode.

Good:
SetMTMode()
Source("...")
MCTemporalDenoise()

Bad:
Source("...")
SetMTMode()
MCTemporalDenoise()

rkalwaitis
24th January 2009, 10:17
Lato or another person in the know :)

I keep getting the following error.

Avisynth open failure:
Script error: there is no function named "FFT3dGPU"
(C:\Users\baba\Desktop\MCTemporalDenoise\McTemporalDenoise.v1.1.24.avsi, line 645)
(C:\Users\baba\Desktop\MCTemporalDenoise.avs, line 12)

I have loaded all of the appropriate dll files as per the instructions at the top of the script.

I probably missed something simple. Any ideas.

jeffy
24th January 2009, 13:08
set GPU=false or get FFT3DGPU filter: http://forum.doom9.org/showthread.php?t=89941

rkalwaitis
24th January 2009, 14:26
Thanks Jeffy,

I updated my directx and it works. slow though. But Ill figure it out. I see it works with MT. Ill give that a shot.

Gorgeous video though.

rkalwaitis
25th January 2009, 00:03
Jeffy,

good call on the gpu=false. gained me almost 2 fps. I can live with that :) I thought FFT3dgpu supported my system. I may have read something wrong. Of course my blazing speed (haha) is using SetMTMode(2,0). Without MT mode I loose about 1fps with gpu set to false. So MT Mode helps some as well.

Lato thanks for this outstanding tool. I enjoy seeing what your scripts can do.

k

McCauley
28th January 2009, 13:20
Hi LaTo,

have you ever thought about implementing MoComped scratch removal? That would be great!

Also i found this post (http://forum.doom9.org/showpost.php?p=1070478&postcount=5), i assume you know that already, but in case you don't it might of use for MCTemporalDenoise.

Regards
McCauley

LaTo
28th January 2009, 17:51
v1.1.26:
changed "flat" post-processing to use GradFun2DBmod
changed int->float for AGstr
fixed a small bug in AA

LaTo
28th January 2009, 18:21
Hi LaTo,

have you ever thought about implementing MoComped scratch removal? That would be great!

Also i found this post (http://forum.doom9.org/showpost.php?p=1070478&postcount=5), i assume you know that already, but in case you don't it might of use for MCTemporalDenoise.

Regards
McCauley
Lack of time... Added to my "towatch list" :p

totya
29th January 2009, 11:14
v1.1.26:
changed "flat" post-processing to use GradFun2DBmod
changed int->float for AGstr
fixed a small bug in AA

Hi, thx!

But v1.1.26 version (2.3 fps) slower than v1.0.02 version (2.9 fps)

v1.0.02 script:
MCTemporalDenoise(settings="HIGH", MT=TRUE, interlaced=FALSE)

v1.1.26 script:
MCTemporalDenoise(settings="HIGH", interlaced=FALSE)

LaTo
29th January 2009, 13:01
Hi, thx!

But v1.1.26 version (2.3 fps) slower than v1.0.02 version (2.9 fps)

v1.0.02 script:
MCTemporalDenoise(settings="HIGH", MT=TRUE, interlaced=FALSE)

v1.1.26 script:
MCTemporalDenoise(settings="HIGH", interlaced=FALSE)

Maybe... but v1.0.02 with MT=true is a bit unstable and out of date.

LaTo
29th January 2009, 19:52
A small comparison with the new "enhance" option:

Source (http://latoninf.free.fr/d9/GF/original.png)
MCTemporaldenoise(deblock=true,enhance=false,chroma=true) (http://latoninf.free.fr/d9/GF/flatoff.png)
MCTemporaldenoise(deblock=true,enhance=true,chroma=true) (http://latoninf.free.fr/d9/GF/flaton.png)

I like it :cool:

Adub
30th January 2009, 00:11
Ooh, I like it too. It really helps to calm the tiny microblocks that you can see if you zoom in. Nice work there LaTo.

morsa
30th January 2009, 17:27
Is there any way for using the script in MT mode?

It always throws an exception to me.

MCTemporalDenoise(settings="low",GPU=false,stabilize=true, flat=true)

rkalwaitis
30th January 2009, 19:17
The only way I could get it to work for me was to make my first line of my script. SetMTMode(2,0)

SetMTMode(2,0)
DGDecode_mpeg2source("C:\Users\baba\Desktop\Your Project\VTS_01_1.d2v",info=3)
ColorMatrix(hints=true)
#deinterlace##I deinterlace before I use MCTemporalDenoise. Lagarith lossless set you YV12 and I crop and resize at the same time.

Import("C:\Users\baba\Desktop\MCTemporalDenoise\Deblock_QED.avs")
Import("C:\Users\baba\Desktop\MCTemporalDenoise\LSFmod.v1.3.avsi")
Import("C:\Users\baba\Desktop\MCTemporalDenoise\MCTemporalDenoise.v1.1.24.avsi")
Import("C:\Users\baba\Desktop\MCTemporalDenoise\MCTemporalDenoise.v1.1.26.avsi")
Import("C:\Users\baba\Desktop\MCTemporalDenoise\GradFun2DBmod.v1.0.avsi")
Import("C:\Users\baba\Desktop\MCTemporalDenoise\GradFun2DBmod.v1.2.avsi")
Import("C:\Users\baba\Desktop\MCTemporalDenoise\GradFun2DBmod.v1.1.avsi")

I know they autoload, I just keep mine in a folder not in the Avisynth Plugin Directory. Helps me keep track of what script needs what filters and versions........

MCTemporalDenoise(settings="medium", gpu=false)

morsa
2nd February 2009, 06:38
Have you tried my settings posted above?

Because if I use yours it works...

thanks.

Adub
2nd February 2009, 09:12
@rkalwaitis

Why load all different versions of the same script? It just takes more time to load as it sorts through the versions. You should always point to the latest version and leave it at that.

rkalwaitis
2nd February 2009, 21:24
Merlin7777

You are right, It was not working correctly for me for some reason at the time. I have since done as you suggested.

rkalwaitis
2nd February 2009, 21:29
Morsa,

Using your settings this worked for me.

SetMTMode(2,0)
DGDecode_mpeg2source("C:\Users\baba\Desktop\The Movie\VTS_01_1.d2v", info=3
ColorMatrix(hints=true, threads=0)
#deinterlace

#denoise

Import("C:\Users\baba\Desktop\MCTemporalDenoise\MCTemporalDenoise.v1.1.26.avsi")

Import("C:\Users\baba\Desktop\MCTemporalDenoise\GradFun2DBmod.v1.2.avsi")

crop( 0, 64, 0, -64)

MCTemporalDenoise(settings="low",GPU=false,stabilize=true, flat=true)

If you noticed my scripts are not in the plugins folder for avisynth. I was having problems with the various versions of MVTools (v2.3.0), Masktools (v2.0a35). So I keep both versions of both in seperate directories. Im not as smart as some of these guys who can make it work from the same directory. I had to seperate them sometimes for various scripts of things I want to do.

Any ways the script above worked for me :)
k

wyti
4th February 2009, 23:40
Thanks very nice script, i can completely get rid of ringing + high nose with this script and it don't take me 3 days to get a good result ;)

McCauley
5th February 2009, 13:29
Also i found this post (http://forum.doom9.org/showpost.php?p=1070478&postcount=5), i assume you know that already, but in case you don't it might of use for MCTemporalDenoise.
Another potentially useful post: click (http://forum.doom9.org/showthread.php?p=1153664#post1153664)

Just in case you haven't seen it yet.
Keep up your good work!

Regards
McCauley

PS: I hope it's okay to post such links in your thread. I don't want to bother you, or coerce you to further develop this script.

McCauley
9th February 2009, 12:41
Damn, i just accidentally deleted the last post....Sorry!

However i wanted to fix the typo, because it wasn't the cause of the error:
See here: new screenshots, fixed the copy pasta mess:
MPEG2Source("HM.d2v", cpu=0).tfm().tdecimate()
MCTemporalDenoise(edgeclean=true,ECmode="dfttest().dehalo_alpha()",gpu=false)
Crop(1150, 86, -152, -382)
http://img134.imageshack.us/img134/2374/newmcfh5.th.png (http://img134.imageshack.us/my.php?image=newmcfh5.png)

versus
MPEG2Source("HM.d2v", cpu=0).tfm().tdecimate()
dfttest().dehalo_alpha()
Crop(1150, 86, -152, -382)
http://img264.imageshack.us/img264/6803/newdffuf4.th.png (http://img264.imageshack.us/my.php?image=newdffuf4.png)

MPEG2Source("HM.d2v").tfm().tdecimate()
MCTemporalDenoisePP(edgeclean=true,ECmode="dfttest().dehalo_alpha()")
Crop(1150, 86, -152, -382)
http://img209.imageshack.us/img209/6360/newerrorcq0.png (http://imageshack.us)

Regards
McCauley

PS: Just a minor thing, but maybe it would be better to change the default for FFT3DGPU to false, on lower end cards it's a showstopper on HD content, took me a while to figure it out that this is the reason for beeing extremely slow.

LaTo
9th February 2009, 19:44
v1.1.27 :
fixed a bug in MCTemporalDenoisePP with chroma=false
adapted for LSFmod v1.5



MPEG2Source("HM.d2v").tfm().tdecimate()
MCTemporalDenoisePP(edgeclean=true,ECmode="dfttest().dehalo_alpha()")
Crop(1150, 86, -152, -382)
http://img209.imageshack.us/img209/6360/newerrorcq0.png (http://imageshack.us)

Fixed in v1.1.27 ;)

For edgeclean: try to increase ECrad (like 6-10) and maybe try to decrease ECthr too

McCauley
9th February 2009, 20:21
Thank you LaTo!

Regards
McCauley

LaTo
14th February 2009, 18:29
v1.2.20 :
adapted for LSFmod v1.6 & GradFun2DBmod v1.3
changed sharp int->bool (deleted sharp=1)

mozzle
14th February 2009, 23:44
Hi.

I recently built a new machine an now I'm having a problem when attempting to set gpu=false.

When I try to preview the following script

DGDecode_mpeg2source("C:\Documents and Settings\My Documents\DVDFab\MainMovie\BOURNE_IDENTITY\VIDEO_TS\VTS_01_1.d2v", info=3)
ColorMatrix(hints=true, threads=0)
crop( 0, 62, 0, -66)

MCTemporalDenoise(settings="low", gpu=false)

in AvsP, I get this error:

http://img177.imageshack.us/img177/2589/95334948iq9.gif

The script will not load in MEGUI, either.

I'm using MCTemporalDenoise.v1.2.00.avsi with MVTools 2.3.1.0
I have FFT3dGPU 0.8.2.0 installed and I have FFT3DFilter.dll (2.1.1.0) and fftw3.dll (no version info) in my AviSynth plugins folder.

System:

Microsoft Windows XP Pro SP3
CPU: Q6600 @ 2.40GHz
3.25 GB RAM
GPU: EVGA GeForce 8600 GTS (256MB/128-bit)

Let me know if you need more info.

:thanks:

XhmikosR
15th February 2009, 00:06
You should place fftw3.dll in your system32 directory in order to get FFT3DFilter to work. More info here (http://forum.doom9.org/showthread.php?t=85790).

mozzle
15th February 2009, 00:32
@XhmikosR

Thanks!

It's been about a year since I first set that up so I forgot. Thanks for the reminder.

zilog jones
16th February 2009, 17:49
Just discovered this filter yesterday - have to say I'm very impressed by what it can do with my VHS captures (using chroma=true of course :) ). Thanks!

McCauley
18th February 2009, 11:32
Hi LaTo,

would it be possible to implement a switch to denoise chroma ONLY? So one could call it twice, for example one for the luma with moderate settings and one for the chroma with higher settings or vice versa.
Maybe with a nice amplified view when show=true like with histogramm(mode="luma), so it is easier to spot the the small differences in the final output.
That would be terrific!

Regards
McCauley

Sagekilla
18th February 2009, 15:34
CDenoised = MCT() # Settings for chroma
LDenoised = MCT() # Settings for luma.
MergeLuma(CDenoised, LDenoised) ?

McCauley
18th February 2009, 20:38
Hi Sagekilla,

i thought about doing it that way, BUT if i do so i'm unnecessarily denoising the luma plane twice (or at all, if i just want to denoise the chroma plane).
If i just want to denoise the chroma plane(which i do), this workaround should approximatelly double the rendering time (correct me if i'm wrong?!).

Regards
McCauley

LaTo
18th February 2009, 20:39
Hi LaTo,

would it be possible to implement a switch to denoise chroma ONLY? So one could call it twice, for example one for the luma with moderate settings and one for the chroma with higher settings or vice versa.
Maybe with a nice amplified view when show=true like with histogramm(mode="luma), so it is easier to spot the the small differences in the final output.
That would be terrific!

Regards
McCauley
Good idea, in the next version... ;)

Didée
18th February 2009, 21:00
i thought about doing it that way, BUT if i do so i'm unnecessarily denoising the luma plane twice (or at all, if i just want to denoise the chroma plane).
If i just want to denoise the chroma plane(which i do), this workaround should approximatelly double the rendering time (correct me if i'm wrong?!).
If you want to denoise only the chroma planes, you can do MCT(parms).mergeluma(last) - no need to use two instances of the function.

If you want to denoise both luma and chroma, but each with different "strengths", then your suggestion is far, far suboptimal, since calling MCT two times creates *huge* overload: two times searching (the very same) vectors, two times creating (the very same) subpel-clips, etc.
In this case it would be better to modify the script internally so that it allows different strengths for luma and chroma.

LaTo
19th February 2009, 21:25
v1.2.02 :
changed default gpu=true to gpu=false (set gpu=true if you want speed!!!)
adapted to LSFmod v1.7

Great Dragon
22nd May 2009, 17:48
what MCTemporalDenoise() settings are equal to LSFmod() slow mode?
It seams i can't manage "soothe" via MCTemporalDenoise() script...

Adub
22nd May 2009, 19:51
Wait what? If you want to use LSFmod() then use LSFmod(). MCTemporalDenoise is a denoiser package, while LSFmod is just a sharpener.

If you want to achieve that same / similar settings as the slow mode, then enter the same values as found in LSFmod()'s slow mode into these parameters:
### +-------+
### | SHARP |
### +-------+-----------------------------------------------------------------------------------------------------------------------------+
### | sharp : Enable Post-Sharpening (Spatial-Sharpening + Motion-compensated temporal limiting) |
### | adapt : Adaptative sharpening --> sharp only static & detailed areas, prevents grain sharpening & save much bitrate (+-10/15%) |
### | strength : Sharpening strength ( see LSFmod: strength ) |
### | SHmode : Sharpening mode ( see LSFmod: Smode ) |
### | SHmethod : Sharpening method ( see LSFmod: Smethod ) |
### | Slimit : Spatial limiting ( see LSFmod: Lmode ) |
### | Sovershoot : Spatial overshoot ( see LSFmod: overshoot ) |
### | Tlimit : Temporal limiting (Motion compensated, clamp output to Tovershoot) |
### | Tovershoot : Temporal overshoot +-= Maximum sharpening excess allowed (If overrange=0, don't sharpen more than the original clip.) |
### | /!\ If you set Tovershoot>0, be sure that Slimit!=0 (to not over-enhance edges... Slimit=2 is a good compromise) |
### +-------------------------------------------------------------------------------------------------------------------------------------+
###

Great Dragon
22nd May 2009, 20:30
If you want to achieve that same / similar settings as the slow mode, then enter the same values as found in LSFmod()'s slow mode into these parameters:
This is what i mean to say.
But it seems there are not all LSFMod features implemented in MCTemporalDenoise. Like "soft", "soothe", "edgemode".
Maybe it better to disable MCTemporalDenoise Post-Sharpening and use LSFMod separately...

Adub
22nd May 2009, 21:14
If you want exactly the same settings as LSFmod() then I suggest you completely disable sharpening in MCTemporalDenoise and just append your own line of LSFmod() with your desired settings.

LaTo
22nd May 2009, 21:14
This is what i mean to say.
But it seems there are not all LSFMod features implemented in MCTemporalDenoise. Like "soft", "soothe", "edgemode".
Maybe it better to disable MCTemporalDenoise Post-Sharpening and use LSFMod separately...
No!

If these features are not in MCTD, it's just because they are usefulness with MCTD...

MCTD use some motion compensated stuff which are more or less the same:
- adapt replace edgemode
- Tlimiter replace soothe

Great Dragon
23rd May 2009, 06:49
LaTo, thanks for explanation.

Added: Multithread don't work with MCTD if stabilize=true. Tested with SetMtMode(2) and (5).

Chiba
30th May 2009, 23:48
Some results :
Core2Duo 3.0Ghz + 4Gb ram
High => 2.1fps @ 1280*720 (film)
Vhigh=> 1.3fps @1280*720 (film)

Very good filter ! Thank you LaTo

LaTo
12th June 2009, 19:19
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

:devil:

@Tron@
15th June 2009, 10:37
Thx LaTo!!!

I like MCTemporalDenoise in begining and work only with him.

Wery B Iiiiiii G THX for update !! !!

PS and for LSFmod thx - cool sharp )))

mozzle
17th June 2009, 20:06
Thanks for the update and continued work on all of your scripts.

:thanks:

fleon
19th June 2009, 20:35
Hi, I am sorry but I have no idea in how to use your script, and it seems very good,so could you help me with a guide on how to use it with megui?

I have downloaded all the needed filters and I have put them in the avisynth plugin directory.

I know the basics of megui, by that I mean that I know that I have to index the dvd with the d2v creator and then open the d2v file with the avs script editor, but I am stuck there, I dont know how I can use MCTemporalDenoise from there, I wanna try the medium global setting..., or I guess I can submit a sample if anyone wants to help me out:)

lych_necross
17th July 2009, 09:09
Damn LaTo, MCTemporalDenoise is awesome! I used it with setmtmode(2,0), settings="medium", and gpu=true to encode Star Trek 3 last night with excellent results. :)

nitinpushpan
25th July 2009, 13:11
I noticed that none of the output shown in the thumbnails are resized. Do you apply this before or after resizing? If its before resizing then how is the quality after resizing it also?

nitinpushpan
25th July 2009, 13:30
If you're resizing then put it before the resize. If you're not resizing and just cropping then I guess one can put it before the cropping.

If the source is SD DVD like in my case where I used the above quick workarounds :):p

Will this avsi help if I apply it to a DVD video source and encode it using Gordian Knot with Xvid? I noticed that the thumbnails are 720p resolution. How is it going to help the final quality if I apply it before resizing? Am I supposed to apply other filters also after resizing?
Also am I suppose to enter all the paramters to get the quality or is "MCTemporalDenoise(settings="very low")" enough?
Here is the sample of the source I'm working on...

http://rapidshare.com/files/259775529/VTS_01_3.demuxed.m2v.html

Plus I noticed that LaTo's source video has a very good quality, then why would he wanna apply MCTemporalDenoise on it in the first place that too without resizing? I had to strain my eyes to notice the difference...

LaTo
25th July 2009, 16:14
Will this avsi help if I apply it to a DVD video source and encode it using Gordian Knot with Xvid? I noticed that the thumbnails are 720p resolution. How is it going to help the final quality if I apply it before resizing? Am I supposed to apply other filters also after resizing?
Test by yourself and pick the best to your eyes.

Also am I suppose to enter all the paramters to get the quality or is "MCTemporalDenoise(settings="very low")" enough?
Yes it's enough, but you can try with enhance=true and chroma=true...


Plus I noticed that LaTo's source video has a very good quality, then why would he wanna apply MCTemporalDenoise on it in the first place that too without resizing?
300 has strong grain and the 2nd has bad noise in the background.

I had to strain my eyes to notice the difference...
Maybe it's time to change your display :p

Caroliano
6th August 2009, 05:16
In the wiki (http://avisynth.org/mediawiki/MCTemporalDenoise), in the top right box the version number still 1.2.02, and in the required filters there is the following:

MVTools (v1.10.2.1) or MVToolsMULTI (v1.9.7.1)
MVTools (v2.3.1) (both MVTools filter needed!!!)

In the end of the page there is already information about the post-denoising stage and a link to the current version 1.3.00. Can I, or someone faster than me, update this and remove the old MVtools as requeriments?

canuckerfan
6th September 2009, 10:12
anyone got a mirror to ttempsmooth?

shoopdabloop
6th September 2009, 10:15
http://bengal.missouri.edu/~kes25c/

it's one of tritical's.

canuckerfan
6th September 2009, 10:29
thanks

canuckerfan
6th September 2009, 22:00
whenever I try to adjust the owoh and overlap parametres it tells me it doesn't know what bwbh and blocksize means... should there be a default value for theses parametres as well?

edit: anyone got a mirror for addgranc? this one, http://avisynth.org.ru/docs/english/externalfilters/addgrain.htm, doesn't seem to work for me.

GDAce
7th September 2009, 07:37
http://avisynth.org/warpenterprises/files/addgrainc_25_dll_20060610.zip

canuckerfan
7th September 2009, 22:04
cool. i finally got everything working now... just wanted to say how dynamic this script is!! good stuff!

Boulder
13th September 2009, 18:13
A small suggestion: internal padding to mod-16 before processing (or whatever is the most convenient and avoids error messages regarding illegal values for Crop) and then returning the original resolution.

tengo6dedos
14th September 2009, 18:13
Hello, is there an internal problem on using MVTools 2.5.3? it loads fine

LaTo
16th September 2009, 12:31
Hello, is there an internal problem on using MVTools 2.5.3? it loads fine

Yes, I haven't tested but it should be ok... Test and report please.

LaTo
17th September 2009, 08:05
I saw on some websites/pages that MCTD creates blur sometimes... So, I you want to eliminate most of the blur:

You should tweak the sigma parameter for each of your video if you want the best quality!

Personally when I use MCTD, it's 70% of the time: preset="low" with tweaked sigma value. (20% "medium", 10% "high", I never use "very low" and "very high"... Yes, my pourcentaces are perfectly calculated :D)

On top of that, I always use enhance=true because it finishes very well (http://forum.doom9.org/showthread.php?p=1243335#post1243335)... So you should try it :p

PS: remember to use chroma=true when it's necessary (and "post" parameter is also useful when you want tweak a little the denoising)

canuckerfan
19th September 2009, 20:05
using the flat=true option in the post-processing filter... should it be called after my sharpening routine or before?

LaTo
20th September 2009, 08:33
using the flat=true option in the post-processing filter... should it be called after my sharpening routine or before?

Always at the end.

canuckerfan
20th September 2009, 11:50
Always at the end.
that's what I thought. thank you.

Boulder
27th September 2009, 10:48
LaTo, there seems to be something in MCTemporalDenoise which makes a certain script cause an access violation with the 2.5.x branch of MVTools2: http://forum.doom9.org/showthread.php?p=1329180#post1329180 . Do you have any ideas where to start investigating further?

Arshad07
28th September 2009, 00:10
Does MCTemporalDenoise support Multi-Threading?

For example this script

SetMtMode(5)
import("D:\Encode\LSFmod.v1.8.avsi")
import("D:\Encode\MCTemporalDenoise.v1.3.00.avsi")
Import("D:\Encode\YLevels_mt.avsi")
Import("D:\Encode\plugins\plugins\MCBob.avsi")
LoadPlugin("D:\Encode\mvtools-v1.11.4.5\mvtools.dll")
LoadPlugin("D:\Encode\fft3dfilter211\FFT3DFilter.dll")
LoadPlugin("D:\Encode\MaskTools.dll")
LoadPlugin("D:\Encode\gradfun2db_25_dll_20060315\gradfun2db\gradfun2db.dll")
LoadPlugin("D:\Encode\medianblur084\medianblur.dll")
LoadPlugin("D:\Encode\ReduceFlicker\ReduceFlicker.dll")
LoadPlugin("D:\Encode\ReduceFlicker\ReduceFlickerSSE2.dll")
LoadPlugin("D:\Encode\ReduceFlicker\ReduceFlickerSSE3.dll")
LoadPlugin("D:\Encode\EEDI2v092\EEDI2\EEDI2.dll")
LoadPlugin("D:\Encode\mvtools2.dll")
Load_Stdcall_Plugin("C:\Program Files (x86)\megui\tools\yadif\yadif.dll")
AVCSource("C:\Users\Arshad\Desktop\TROTF.dga")
Addborders(0,94,0,94)
Spline64Resize(720,480)
SetMtMode(2)
YLevels(6, 1, 255, 0, 255)
Tweak(hue=0.0, sat=1.2, bright=0, cont=.97, coring=true, sse=false)
MCTemporalDenoise(settings="very low")
LimitedSharpenFaster(ss_x=1.5, ss_y=1.5, dest_x=last.width, dest_y=last.height, Smode=3, strength=60, radius=2, Lmode=1, wide=false, overshoot=1, edgemode=0, special=false, exborder=0)

it doesnt seem to work :confused: It crashes in CCE SP2.

Arshad07
28th September 2009, 00:20
http://i33.tinypic.com/2iu6hc1.jpg

thewebchat
28th September 2009, 01:20
Your crash dialog says that the fault is in mt_masktools-26.dll! MaskTools2 is used in both MCTD and in LSF, and you should figure out which it is that is causing the crash. Also, mt_masktools-26.dll is for AviSynth 2.6!

Arshad07
28th September 2009, 01:29
When i removed mt_masktools_26.dll from my plugins folder, the error comes to masktools2 :confused:

thewebchat
28th September 2009, 02:03
Uh... Well, of course you'd get an error related to MaskTools2 if you remove it from your plugins folder.

LaTo
28th September 2009, 07:39
When i removed mt_masktools_26.dll from my plugins folder, the error comes to masktools2 :confused:

Remove mt_masktools_26.dll and put mt_masktools_25.dll in your plugins folder

LaTo
28th September 2009, 07:51
Hello, is there an internal problem on using MVTools 2.5.3? it loads fine

The last version working with MCTD is v2.4.7

If you want to use v2.5.x you should look at this (http://forum.doom9.org/showthread.php?p=1329353#post1329353)

Arshad07
28th September 2009, 10:11
Remove mt_masktools_26.dll and put mt_masktools_25.dll in your plugins folder

Can u upload it to sendspace for me plz? I cant seem to find it.

Didée
28th September 2009, 10:32
No. Really not. Primary home of the MaskTools package is here (http://manao4.free.fr/). The latest version is v20a36.

The content of the package:
http://i35.tinypic.com/2vcjdj9.png

If you managed to find the -26, but can't find the -25, then it's ... a serious case. ;)

Arshad07
28th September 2009, 11:13
No no no. I thought i'd seen somewhere but coundnt recall where exactly. Ohhh, now i see, its in the masktools folder ;)

LaTo
29th September 2009, 18:04
v1.3.09:
added MOD4 restriction
updated MVTools version

No problem with MVTools v2.5.5 ;)

Arshad07
29th September 2009, 19:57
No problem with MVTools v2.5.5 ;)

thank you :D

Magix_995
6th October 2009, 20:51
Hello

A problem here after complete re-setup of Avisynth and plugins/scripts :

http://nsa09.casimages.com/img/2009/10/06/mini_091006085828277411.png (http://www.casimages.com/img.php?i=091006085828277411.png)
in AVSP

Any idea ?
(excuse for my english)

Didée
6th October 2009, 21:19
http://forum.doom9.org/showthread.php?p=976573#post976573

canuckerfan
8th October 2009, 00:52
just curious if RemoveGrainHD (http://www.removegrainhd.de.tf/) is beneficial enough for HD content to warrant its implementation in MCTD?

byme
18th October 2009, 17:04
Can you tell me where is the fftw3.dll compatible with Avisynth 2.5 for FFT3DFilter?

http://i.imagehost.org/t/0055/av1.jpg (http://i.imagehost.org/view/0055/av1)

http://i.imagehost.org/t/0520/av2.jpg (http://i.imagehost.org/view/0520/av2)

canuckerfan
18th October 2009, 19:31
^put fftw3.dll in your system32 folder

byme
5th November 2009, 15:37
^put fftw3.dll in your system32 folder

I had already done ... still gives me error :(

I downloaded from here: http://avisynth.org/warpenterprises/

Didée
5th November 2009, 16:08
WinXP -> /system32
Vista -> /syswow64
Win7 -> like Vista

Nobody can know this, there never was big talk about it, except for a few hundred or thousand times. :rolleyes:

byme
6th November 2009, 15:56
WinXP -> /system32
Vista -> /syswow64
Win7 -> like Vista

Nobody can know this, there never was big talk about it, except for a few hundred or thousand times. :rolleyes:

thanks
I put it does not work anyway
continues to give error

http://www.picamatic.com/show/2009/11/06/05/56/5804710_bigthumb.PNG (http://www.picamatic.com/view/5804710_sys/)

there is something wrong with the script?

LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\DVD2AVI MPEG2DEC3\DGDecode.dll")
##
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\DeBlock\deblock.dll")
##
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\FFT3dGPU\FFT3dGPU.dll")
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\FFT3DFilter\FFT3DFilter.dll")
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\FFT3DFilter\fftw3.dll")
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\TTempSmooth\TTempSmooth.dll")
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\RemoveGrainHD\RemoveGrainHD.dll")
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\EEDI2\EEDI2.dll")
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\SangNom\SangNom.dll")
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\AddGrainC\AddGrainC.dll")
import("C:\Users\Propietario\Documents\Edit Video\Filtri\Deblock_QED\Deblock_QED.avsi")
import("C:\Users\Propietario\Documents\Edit Video\Filtri\MCTemporalDenoise\MCTemporalDenoise.avsi")
##
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\MVTools2\mvtools2.dll")
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\MVTools\mvtools.dll")
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\MaskTools\mt_masktools.dll")
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\RemoveGrain\RemoveGrain.dll")
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\DctFilter\DctFilter.dll")
##
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\RemoveGrain\Repair.dll")
import("C:\Users\Propietario\Documents\Edit Video\Filtri\LimitedSharpenFaster MOD\LimitedSharpenFaster MOD.avsi")
##
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\DB_LSF\MaskTools.dll")
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\Deen\Deen.dll")
import("C:\Users\Propietario\Documents\Edit Video\Filtri\HQDering\HQDering.avsi")
##
LoadPlugin("C:\Users\Propietario\Documents\Edit Video\Filtri\GradFun2db\gradfun2db.dll")
Import("C:\Users\Propietario\Documents\Edit Video\Filtri\GradFun2db\GradFunkMirror.avs")

####

AviSource("E:\Capture\Capture8.avi").ConvertToYV12()
Deblock()
BlindPP(cpu=4)
MCTemporalDenoise()
###LSFmod()
HQDering()
GradFunkMirror()
ConvertToRGB()

Didée
6th November 2009, 16:31
You must not load fftw3.dll via LoadPlugin(). (English "must not" means "forbidden!".)

fftw3.dll --> put in system path, usually system32/syswow64. After that, just forget about it.
fft3dfilter.dll --> load with LoadPlugin()

That's all.

byme
7th November 2009, 13:38
:thanks:

If were to recommend ... recommend me the MCTemporalDenoise or Mc_Spuds?

LaTo
25th November 2009, 18:44
:thanks:

If were to recommend ... recommend me the MCTemporalDenoise or Mc_Spuds?

We are on MCTD thread, so I recommend MCTemporalDenoise :p


Denoising part is more or less the same between the two (MCTD has also a protection against banding, Spuds not), but MCTD has a better sharpening routine.
On top, MCTD has "enhance" option which is really useful ;)

Undead Sega
20th December 2009, 03:29
I dont know fi anyone is having this problem, but im using:

ECmode="dfttest().dehalo_alpha()"

and im getting an error stating that there is no such function as 'dfttest' in the avsi script, which i find very strange, i even looked at it and even if thre was such function, and i never modified anything on it either.

Can anyon help me on this please?

LaTo
20th December 2009, 08:01
I dont know fi anyone is having this problem, but im using:

ECmode="dfttest().dehalo_alpha()"

and im getting an error stating that there is no such function as 'dfttest' in the avsi script, which i find very strange, i even looked at it and even if thre was such function, and i never modified anything on it either.

Can anyon help me on this please?

This code is just an example, not an universal solution :)
But if you really want this, you need to download dfttest and dehalo_alpha and put them in your avisynth's folder (search in the forum).

Undead Sega
21st December 2009, 02:47
downloaded dfttest and dehalo_alpha, i put dfttest in the plugins folder and libfftw3f-3.dll in the systems folder (actually in SysWOW64 as i am using Win7 64bit), and while i thought it was about to work, i am getting an error message saying "there is no named fucntion called 'expand'". Ive done everything correctly and i cant even find any function (after a quick search) called 'expand'. What could i be doing wrong with time? :(

MatLz
21st December 2009, 02:55
Expand is a filter present in masktools plugin.