Log in

View Full Version : Strong denoising and flattening a cartoon source


Homei
3rd July 2012, 00:19
I'm trying to filter Invader Zim which seems to be very poorly mastered to the DVDs and thus poses a very difficult source to filter. I tried filtering it for countless hours, but it never pleased me, so I seek your advice.

Here's a short sample that shows some artifacts that are the most difficult to get rid of for me: Mediafire (33MB zipped m2v and d2v) (http://www.mediafire.com/?6xwmb309aa4wdw0)

http://www.abload.de/img/019ejcs.png
The ground is the biggest problem here. It was impossible for me to get a nice and flat area. When filtering, it would smoothen the areas, but create edge noise.
I also see some haloing in the top left part of the image, but I can live with that. Additionally, one can observe aliasing. I was able to anti-aliase it.

http://www.abload.de/img/020ekf2.png
The problem here is the heavy blocking that destroys details. Look to the right of the lightning. After filtering, that area was muddy.

http://www.abload.de/img/037ikvu.png

http://www.abload.de/img/04t4jt4.png
This part seems to be suffering from MPEG2 bitrate starvation. Again, I was not able to clean the areas.

This is what I did:

MPEG2Source("G:\Zim\01 - The Nightmare Begins.d2v", cpu=0, info=3) # I also played around with cpu=0, 2, 4, 6
ColorMatrix(hints=true, interlaced=true, threads=0)
tfm(d2v="G:\Zim\01 - The Nightmare Begins.d2v")
tdecimate(mode=1) # The last two lines are immaculate inverse telecining

UnDot() # Used sometimes and sometimes not
Toonlite() # To strengthen the lines for denoising afterwards

sourceclip=last

MCTD(\
sharp=false, \
protect=false, \
AA=true, useEEDI2=true, maxd=24, AAthr=32, method=2, \
deblock=false, \
edgeclean=false, \
stabilize=false, \
enhance=false, \
GPU=false, \
settings="high") # I tried out a lot of settings. Sharpening is off because it
# would cause aliasing. EEDI2 is preferred over SangNom because
# the latter would cause artifacts.

LSFmod(strength=75,source=sourceclip,Lmode=0,soft=0,ss_x=2.0,defaults="slow")


The result is O.K., but not quite what I want.

I mostly want to flatten the areas like in the first image. Filtering the blocky parts would be just a bonus because they appear sporadically.

I don't mind if it takes a 3fps script to filter this, but I would be very glad to hear your suggestions.

Chainmax
3rd July 2012, 00:34
Well, filtering heavy noise and blocking might result in some smudging. I would suggest you to try MDeGrain3 with dfttest in it, like so:

source=last
preNR=source.dfttest(sigma=1.25,tbsize=3)
preNR_super=preNR.MSuper(pel=2, sharp=1)
source_super=source.MSuper(pel=2, sharp=1)
backward_vec3 = MAnalyse(preNR_super,isb = true, delta = 3, overlap=4)
backward_vec2 = MAnalyse(preNR_super,isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(preNR_super,isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(preNR_super,isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(preNR_super,isb = false, delta = 2, overlap=4)
forward_vec3 = MAnalyse(preNR_super,isb = false, delta = 3, overlap=4)
source.MDegrain3(source_super,backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=350)


That shoulddo some nice denoising and even hide the blocking. I would also invoke GradFunkMirror as the very last line in your script, as it will introduce some dithering which should help masking artifacts. I am also very partial to aWarpSharp (the latest revision by SEt), but its usage is open to debate.

Anyway, here's a thread with more filter recommendations: http://forum.doom9.org/showthread.php?t=149919

sumawo13
3rd July 2012, 00:39
You might wanted to try something like what's posted here. http://forum.doom9.org/showthread.php?p=1091171#post1091171

lansing
3rd July 2012, 02:44
correct me if i'm wrong, i thought mctd was use mainly for grainy source, it's an overkill for a clean source like this.

For the mosquito noise, I will use nonlinear smoothing loss-free from virtualdub, as it's pretty effective most of the time.