Log in

View Full Version : How to clean up noisy blocky TV captures?


Spuds
5th March 2007, 00:56
I have several of these files that I want to clean up as best I can. They also have some color problems that I'm fighting with. The files are all progressive but they are not in good shape, possibly bad conversion or just low resolution that was scaled up don't know.

Anyway here (http://rapidshare.com/files/19445742/getalife.avi.html)is an example it is 10Mb

I've done some combos with FFT3D and Fluxsmoother and deblock and certainly made improvements but wanted to get some additional thoughts / script concoctions on what to try. Also what should I do about the color, looks like some Jaundice may be setting in plus some what appears to be head noise.

R3Z
5th March 2007, 03:46
I have several of these files that I want to clean up as best I can. They also have some color problems that I'm fighting with. The files are all progressive but they are not in good shape, possibly bad conversion or just low resolution that was scaled up don't know.

Anyway here (http://rapidshare.com/files/19445742/getalife.avi.html)is an example it is 10Mb

I've done some combos with FFT3D and Fluxsmoother and deblock and certainly made improvements but wanted to get some additional thoughts / script concoctions on what to try. Also what should I do about the color, looks like some Jaundice may be setting in plus some what appears to be head noise.

Did you have a look here mate;

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

?

Spuds
5th March 2007, 19:22
Had not seen that thread in my searches, there were some interesting scripts there. For kicks here are some results.

Here is what we started with
http://img62.imageshack.us/img62/8372/originalws2.png

This was a Chainmax filter chain
http://img76.imageshack.us/img76/8831/chainebtwr7.png


This was another starter script from Chainmax
http://img76.imageshack.us/img76/4065/chaincommongn4.png

This was a *.mp4 guy script
http://img67.imageshack.us/img67/7848/mp4guynj0.png

Here is what DSP8000 settled on
http://img67.imageshack.us/img67/6194/dsp8000xl0.png

Here is where I am which is various parts of the above.
http://img67.imageshack.us/img67/6628/latestyt2.png

My latest one preserves some of the detail, what little there is of it but does leave some more blocking and noise. I think its a fair trade off but will continue to tweak some more.

Chainmax
5th March 2007, 20:59
That's pretty messed up. I can't see blocking, but if there is then it's likely that DeBlock_QED() can take care of it, especially if you follow it with DeGrainMedian() for denoising. As for the rainbowing, since they seem very strong and since the source is progressive anyway I'd recommend you to use TemporalSoften. There's also color bleeding too, so you might want to ask scharfis_brain about it. In short, my recommendation would be:

Source loading
Chroma Bleeding correction
TemporalSoften(4,0,65,scenechange=1,mode=2)
DeBlock_QED()
DeGrainMedian()
LimitedSharpenFaster(SMode=4,Strength=150)
Tweak(sat=1.2,bright=-10)
Levels(source dependant)
AddGrain(5,0,0)

In the TemporalSoften line, 4 is the radius and 65 is the strength, you might want to toy with those in order to best fit your source. As for what to put in the Levels line, follow this tutorial (http://www.x0project.com/articles.php?i=00016).

Spuds
6th March 2007, 17:02
Thanks for the suggestions and for that web site ... nice easy explanation of how to use levels, just what I needed.

For the chroma bleeding issue I added the FixChromaBleeding script with the suggested speed tweaks. Actually ran it twice with a turn180 that I added into the script, it helped in some areas.

I took your latest script and tweaked some settings in TemporalSoften and gave Spacialsoften a look as well. With that chain this was the best I could do.

http://img233.imageshack.us/img233/2254/c2ol9.png

With your suggestions I made some more tweaks to my test filter chain and now have this which is getting to soft now so it needs some more fine tunning.

http://img232.imageshack.us/img232/6307/tweak2ra7.png

The script is as follows, let me know what you think.

Import("C:\Program Files\AviSynth 2.5\plugins\DeHalo_Alpha.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\FixChromaBleeding.avs")
AVIsource("blabla.avi")

FixChromaBleeding()
DeHalo_Alpha()
Deblock(quant=35)
degrainmedian(mode=3, limity=16, limituv=8)

source = last
w = source.width
h = source.height

backward_vec2 = source.MVAnalyse(isb = true, delta = 2, pel = 2, overlap=4, sharp=2, idx = 1, truemotion=true)
backward_vec1 = source.MVAnalyse(isb = true, delta = 1, pel = 2, overlap=4, sharp=2, idx = 1, truemotion=true)
forward_vec1 = source.MVAnalyse(isb = false, delta = 1, pel = 2, overlap=4, sharp=2, idx = 1, truemotion=true)
forward_vec2 = source.MVAnalyse(isb = false, delta = 2, pel = 2, overlap=4, sharp=2, idx = 1, truemotion=true)

maskp1 = mvmask(kind=1, vectors=forward_vec1, ysc=255).UtoY()
maskp2 = mvmask(kind=1, vectors=forward_vec2).UtoY()
maskp3 = mvmask(kind=1, vectors=backward_vec1, ysc=255).UtoY()
maskp4 = mvmask(kind=1, vectors=backward_vec2).UtoY()
maskf = average(maskp1, 0.25, maskp2, 0.25, maskp3, 0.25, maskp4, 0.25).spline36resize(w, h)

smooth = source.fft3dfilter(bw=48, bh=48, bt=3, sigma=3.5, wintype=1, degrid=1,plane=3).fft3dfilter(bw=24, bh=24, bt=3, sigma=1.5, plane=0)
source2 = maskedmerge(source, smooth, maskf)

source3 = source2.MVDegrain2(backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=800,idx=2)
source3

aWarpSharp(depth=8.0,blurlevel=4,cm=1)
LimitedSharpenFaster(smode=4,strength=165)

Tweak(sat=1.1,bright=1.0,cont=1.05)
Levels(0,1,215,0,255)
AddGrain(4,0,0)

Crop(8,8,-8,-8,align=true)
Spline36Resize(640,480)

subtitle("latest tweaks")

*.mp4 guy
6th March 2007, 20:58
I don't see a lot of blocking in your source, you might want to try using fft3d(gpu/filter) with sigma=2 instead of deblock, you could also try calculating the mv's used by mvdegrain off of a smoothed version of the source, which will give stronger denoising.

for instance replace

Deblock(quant=35)
degrainmedian(mode=3, limity=16, limituv=8)

source = last
with
degrainmedian(mode=3, limity=16, limituv=8)
source = last.ttempsmooth().deblock(quant=28)

#place holder for the unchanged parts of the script

source2 = maskedmerge(last, smooth, maskf)


Which instead of directly deblocking/denoising the source calculates the motion vectors from the smoothed source, then aplies them to the non-smoothed source, which works better when you have unexploited temporal redundancy to work with. fft3dfilter(bw=16, bh=16, ow=8, oh=8, sigma=1, bt=0) also makes a good addition to motion compensated denoising, this uses Kalman filtering which works well at getting rid of the "fuzzy noise" that can be left behind after motion compensated denoising.

Spuds
7th March 2007, 16:06
Thanks for the tips on how how to play with the MV's, very very informative. It has given me some nice improvements but I'm still playing around with exactly what my final script will be. Right now I seem to have a good balance of remaining detail vs grain but will keep experimenting for a bit.