View Full Version : MDegrain2 v. MDegrain3
CarlEdman
22nd November 2011, 01:10
One empirical test:
I ran the same set of 1080p24 a season of broadcast shows through both MDegrain2 and MDegrain3 at x264 --veryslow --crf 21. The results were that the MDegrain3 versions were between 10% smaller and 1% bigger at (to my eyes) at least as good quality, with most at 5%-10% size reductions.
Bottom Line:
The conventional wisdom that MDegrain3 is only marginally better seems to be wrong. I won't degrain with anything less and eagerly await MDegrain4.
Keiyakusha
22nd November 2011, 01:14
You can use even MDegrain5 if you want. There was solutions for that. The point is that this number is not a strength of denoising but how many frames included in denoising. anything more than 3 produces artifacts. Maybe even 3 can produce some. But if you want to turn every frame in a mixture of all nearby frames, then yeah its the way to go.
CarlEdman
22nd November 2011, 01:28
Interesting. The manual for MVTools2 only mentions MDegrain1, 2, and 3.
Keiyakusha
22nd November 2011, 02:01
I said "there was solutions for that", I never said that MVTools2 alone is enough.
Didée
22nd November 2011, 12:04
anything more than 3 produces artifacts.
You shouldn't put that as such a general statement. If you're dealing with Anime/cartoon/etc, then, maybe, yes. Animated content and motion compensation are not the best-possible friends.
With realworld sources, you can use mdegrain3, or a cobbled-up mdegrain7 or mdegrain256 without getting artifacts. Or you can get artifacts with a simple mdegrain1. It's mostly a matter how aggressive the settings are.
@ CarlEdman
First, think of a simple TemporalSoften as an analogy.
temporalsoften(1,8,8) [1+1+1 = 3 frames]
is weaker than
temporalsoften(2,8,8) [1+2+2 = 5 frames]
, and
temporalsoften(3,8,8) [1+3+3 = 7 frames]
is even stronger, and so on.
However,
temporalsoften(3,2,2) [1+3+3 = 7 frames]
may come out weaker than
temporalsoften(2,20,20) [1+2+2 = 5 frames]
because of the thresholds.
That's two important points, both must be considered. Including more frames into the averaging will effect more flattening on the noise floor, but only if the thresholds are sufficiently big for the actually present noise level.
In any case, beyond some given point it doesnt make sense to include more and evenmore frames into the averaging, because it is just enough and won't improve anymore. (Using toothpaste is more efficient than not using toothpaste. But you'll use only a small amount at once .... you can use all of the tube at once, but your teeth won't get any cleaner than "already clean".)
That's some very basics about temporal filtering in general. For MDegrain in particular, there's plenty of additional factors to consider. Some of importance:
- "threshold" is the "thSAD" parameter. It's not per-pixel as in temporalsoften, but per-area, in respect to blocksize.
- if noise level is rather low, then controlling via thSAD should be sufficient, and you shouldn't need more than Mdegrain3.
- if noise level is bigger, then using more frames could be considered ... however, chances are that it's better to use a pre-filtered clip for the motion search, since this causes a more stable vector field, and also causes lower SAD values. (In case of strong noise, the SAD values induced by the noise itself is what can hinder MDegrain from being as efficient as it could be.)
- blocksize can be quite important, in particular for 1080p content. The default blocksize is blksize=8 (8x8 blocks), which in many cases is too small for 1080p. You might find that MDegrain2 with blksize=16 (during MAnalyse) is more efficient on denoising than MDegrain3 with blksize=8. And surely it is noticeably faster.
It's not about fiddling with some knobs, it's about fiddling with the right knobs.
You might want your car to run faster, okay. But cutting a hole in the floor (to have more space to push the pedal) is .... not the best way, usually. ;)
Overdrive80
22nd November 2011, 20:31
As Didée says the variables are many. Currently, I am filtering a anime video and I had to adjust the value of THscd2 to 68, because blurred lines in dark areas. I have observed that there is a reason of proportionality between thscd1 and thscd2. For example, if thscd1 = 200, the value of thscd2 must be 48, to prevent blurring. And for example, I found better results than the other options mvdegrain1.
In this post you can see the difference http://forum.doom9.org/showthread.php?p=1540482#post1540482
Bye
SSH4
22nd November 2011, 21:36
CarlEdman
use MVTools 16bit mod from dither package http://forum.doom9.org/showthread.php?p=1386559#post1386559
o denoise by MDegrainN with a large radius:
AVISource("c:\test.avi") # or MPEG2Source, DirectShowSource, some previous filter, etc
tr = 6 # Temporal radius
super = MSuper ()
multi_vec = MAnalyse (super, multi=true, delta=tr)
MDegrainN (super, multi_vec, tr, thSAD=400, thSAD2=150)
SSH4
22nd November 2011, 21:37
but after my comparsion between mdegrainN and dfttestMC, last one made better results with less blending artifacts
cretindesalpes
22nd November 2011, 23:27
Actually you shouldn't use such high thSAD with a long MDegrainN radius. You're almost sure to get blurring and blending. You have to make first a calm search clip as Didée explained previously, then use it to feed MAnalyse or MRecalculate in the real filtering pass. Here I usually use thSAD/thSAD2 values in the ranges 64–96/32–48. It's very effective. However the search clip quality is critical. It's not an easy task, it highly depends on the source and may use more processing power than the final filtering…
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.