PDA

View Full Version : HD to SD. denoising filters


jordisound
20th April 2009, 23:54
Hello,
I am converting videos from HD (h264 1080p and 720p) to xvid SD (720*XXX). The quality of this videos is very good, for it, a strong denoising is not necessary, though a good denoising would improve very much the compressibility and would increase the percentage of seconds b-frames consecutive, saving in size of the XviD and preserving details.
Do you recommend me use very powerful denoiser like MCTempolralDenoise or TemporalDegrain or with something more simple (and faster) it would be sufficient?

Sagekilla
21st April 2009, 01:45
Source("...")
Spline36Resize(1280,720)
src = last

super = src.MSuper()
bvec2 = super.MAnalyse(isb=true, delta=2, overlap=4)
bvec1 = super.MAnalyse(isb=true, delta=1, overlap=4)
fvec1 = super.MAnalyse(isb=false, delta=1, overlap=4)
fvec2 = super.MAnalyse(isb=false, delta=2, overlap=4)

src.MDegrain2(super, bvec1, fvec1, bvec2, fvec2)


Use MDegrain1 if you want more speed (But less compressibility). MDegrain tends to do a nice job of improving compressibility without having a hugely noticeable smearing or grain removing effect if you prefer to have some graininess. MCTemporalDenoise and TemporalDegrain are very heavy weight denoisers that are more suitable for sources like 300 where the amount of grain present is absurd, and quite frankly too strong for standard denoisers to do have any noticeable effect.

Alternatively, you can try FFT3DFilter which also tends to do a nice job with controlled sigma values.

jordisound
21st April 2009, 20:58
I am in the habit of working with MVDegrain. Unfortunately my PC is very slow. I have tried with several filters and ultimately I have decided for using MVDegran1. The relation quality/speed is very good.
Thank you for your commentaries.

Blue_MiSfit
21st April 2009, 22:01
If you have a reasonable graphics card, fft3dgpu is basically free :)

Reasonable == anything with pixel shaders 2.0 that's got ~256mb of RAM and is kinda sorta fast. Radeon 9800 or faster I think.

~MiSfit

jordisound
24th April 2009, 00:03
No, I have not a good graphics card.

@Sagekilla
I've been doing some tests with MDegrain. The speed increase considerately when sets overlap=2.
MDegrain2 ovelap=2 is so fast as MDegrain1 overlap=4, and MDegrain3 overlap=2 is so fast as MDegrain2 overlap=4.
I think is better to choice the higher temporal radious though you have to use overlap=2. what do you think about this?

Marius-the-Mad
24th April 2009, 23:36
With overlap less than half of a block (defaults: blocks 8x8, so overlap needs to be set to 4), the result may become blocky - but doesn't have to. It all depends on the source. Compare carefully and choose what seems to be better for you.

Sagekilla
25th April 2009, 03:54
Personally, I'd prefer to use half block overlap. I would never use no overlap though. If it came down to it, I'd prefer MVDegrain2 with overlap=4 than MVDegrain3 and overlap=2. TBH, MVD2 + overlap(2|4) is a nice balance though.


If you -do- encounter blocking with overlap=2, you can try some very light deblocking and see if it helps any. But it'd probably be slower and lower quality than if you did just overlap=4 in the first place.

Chengbin
26th April 2009, 03:28
If you have a reasonable graphics card, fft3dgpu is basically free :)

Reasonable == anything with pixel shaders 2.0 that's got ~256mb of RAM and is kinda sorta fast. Radeon 9800 or faster I think.

~MiSfit

How's the quality compared to MVDegrain 3?

Sagekilla
26th April 2009, 04:57
Personally, I think the two are very comparable in denoising performance. The trick is finding the right sigma values to use for FFT3DFilter. I usually can do a simple MDegrain3() without having to think much about the parameters, whereas with FFT3DFilter I have to be a bit more careful so I denoise enough but not too much.

Blue_MiSfit
26th April 2009, 07:13
Yep. FFT3DFilter and FFT3DGPU both require careful tweaking of the 4 sigma values. Thankfully, it's pretty easy. Use this sample to do comparisons:

Using MPEG-2 source as an example, but any should work...

MPEG2Source("video.d2v")
a=last
fft3dgpu(plane=4, sigma=1, sigma2=2, sigma3=2, sigma4=1)
interleave(a,last)

histogram(mode="luma")


Load this into AvsP, and take a peek. As you step through, you'll see the luma histogram of the source and filtered versions. You can tweak the sigma values and see what the results will be.

After you settle on good values, remove the histogram and interleave lines, and add gradfunkmirror(1.51) after fft3dfilter / fft3dgpu. This will dither the output to fix any banding that the FFT filtering might introduce.

MVDegrain still gets a bigger compressibilty boost in most cases, and is easier to configure. Its results also end up looking more natural, in most cases. Unfortunately, it's very slow and can sometimes introduce motion issues (not bad though).

FFT denoisers are very powerful though, and fft3dgpu is very fast!!

Enjoy :)

~MiSfit

bazz
7th April 2011, 18:22
This is just what im looking for.
Ive been using FFT3dGPU on HD sources converting them to SD
Id like to try MVdegrain2 but i can not get my head around it.
would anyone give me a example script to try on a 720p source, give me a basic indiction of what the parameters are
Masktools Wiki on it just doesnt help
something that would lightly denoise and increase compression
id be using LSFmod or Limitedsharpenfaster along with it

thanks in advance for any help at all

kypec
8th April 2011, 15:13
Try MCTemporalDenoise (http://forum.doom9.org/showthread.php?t=139766) - easy to use and provides excellent results.

bazz
9th April 2011, 15:58
thank you kypec, much appreciated

bazz
13th April 2011, 14:09
i tried MCTD using setting=very low on a 720p source
ripped down to XviD to archive on my HHD, bitrate was just under 1000Kbps
but im seeing like a faint shadow around the edges in parts.
I need to find a filter that leaves clean sharp video when compressing HD to SD?

Didée
13th April 2011, 14:40
Id like to try MVdegrain2 but i can not get my head around it.
would anyone give me a example script to try on a 720p source, give me a basic indiction of what the parameters are

MVTools comes with documentation. R.T.F.M.

There even are practical examples!

To denoise by MDegrain2 with overlapped blocks (blksize=8) and subpixel precision:

AVISource("c:\test.avi") # or MPEG2Source, DirectShowSource, some previous filter, etc
super = MSuper(pel=2, sharp=1)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, overlap=4)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, overlap=4)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, overlap=4)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, overlap=4)
MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400)
You should be able to get your head around THAT. Try it.

kypec
13th April 2011, 16:23
i tried MCTD using setting=very low on a 720p source
ripped down to XviD to archive on my HHD, bitrate was just under 1000Kbps
but im seeing like a faint shadow around the edges in parts.
I need to find a filter that leaves clean sharp video when compressing HD to SD?
Are you sure that those "shadows" are not compression artifacts? Sort of halo/ringing effect that usually comes hand in hand with DCT compression as such?
Preview the output of your script (use AvsPMod or VirtualDub) and make sure that video quality is good before it is encoded by Xvid.

Ghitulescu
13th April 2011, 16:53
First of all, no sample, and noise can be of many types (and it's not the first time when a poster mistook one type of noise for another or compression artefacts for image noise). Most grain-type noises disappear itself during downconversion and reencoding.

On the other hand I don't understand why using 720 as width for xvid, when 640 is a submultiple of both and still correctly displayed by mediatanks on TVs (reducing the calculation duration and simplifying the rounding).