Log in

View Full Version : Need help to denoise PAL/YV12 movies and series


DVDBob
26th October 2010, 21:25
Hello.

Anyone can recommend me one or more filters to denoise PAL/YV12 movies and series???

And help me going.

Wilbert
31st October 2010, 13:22
Moved upon request.

nurbs
31st October 2010, 14:08
Depends. Is there a lot of noise or only some noise? How fast should the filter be? Are you using Avisynth or something else to do the preprocessing?

DVDBob
31st October 2010, 18:57
I use AviSynth and it does not matter how fast the various Denoise filters are as long as they are thorough.
I have different files with little and much noise.

Hagbard23
1st November 2010, 11:21
Post a sample - or at least, a screenshot.

It is impossible to give a correct advice, without knowing the exact type of noise you want to remove...

Sorry ;)

nurbs
1st November 2010, 11:31
There is a list of denoisers (http://avisynth.org/mediawiki/External_filters#Denoisers) in the avisynth wiki and there is also information about their strength (http://avisynth.org/mediawiki/Denoisers). Usually the stronger a denoiser the more likely that it destroys actual detail. They are also slower since there is more processing involved trying to avoid destroying detail.

DVDBob
1st November 2010, 14:54
I've seen that other users are using MediaFire to Samples, so I just strap the same

http://www.mediafire.com/?zumongaqqy68xyx

Hagbard23
1st November 2010, 16:23
I've watched your sample ... thanks for providing... ;)

Just a quick shot:


MPEG2Source(.....,iPP=true,CPU=4)
TDeint()
Crop(x1,y1,-x2,-y2) # Crop the image correctly
ColorYUV(off_y=OFF1,gain_y=OFF2) #for luma correction, see ** for details
DeblockQED() #only use if you HAVE NOT set CPU=4 inside MPEG2Source
#FFT3DGPU(precision=2) #Use this by your own flavour
LSFMod(dest_x=X, dest_y=Y)
RemoveGrain(mode=5) #Simple and very decent Denoiser for leftovers of LSF-MOD (if there are some, you can leave this out, if you want to)
Limiter() #Safety First...if you have used ColorYUV Correction, you better set limiter() for luma peaks, which are out of Spec
Histogram() #Only for Analysis - comment it out for final encoding


Edit the RED Values:

OFF1: Luma Offset
OFF2: Luma Gain
x1,y1,x2,y2: Number of Pixel-Lines to crop (keep at mod2!!)
dest_x,dest_y: Destination Resolution (if your source is 2,35:1 use 720x304, if 16:9 use 704x400, if 4:3 use 720x544 and so on..)

YOU DON'T NEED TO RESIZE - LSFMOD will do it for you. (Spline36)

I am at work currently, that's the reason i can't play with avisynth right now. Some short words:

You haven't got THAT big noise problem - i see mostly Macroblocking/Compression-Artifacts and a little Interlacing - nearly no grain/dot-Noise. You can come by this with either Deblock_QED (google) or with the integrated Denoise-Fuctions of DGINDEX (set CPU=4 - look at documentations for more info).

The Interlacing is fixed here with TDEINT, which i like most ATM. You also can use Yadif.

I am not quite sure about some OFF-Luma, but i think the video is a bit too bright (black is too gray). To check this, i have set the HISTOGRAM() Function. The histogram is only for you to pre-estimate, if there is luma offset. For the final Encoding process, you have to comment it out.

See, that -in dark areas (ideally BLACK) the lower limit is equal to the border-line. If the Black Values are not equal to this line you can tweak them down with the OFF1 Parameter (set it to -lets say- "-4"). After that you have to compensate this action by gaining the white values again. You have to gain until the (ideally) WHITE Values touch the right borderline (set it to -lets say- "4").

After that you fiddle through the movie and look, if your settings are correct. No Black value should cross the lower border, and no white value should cross the upper border (yellow lines). If you achieved that, luma correction is OK.

P.S.: Color/Luma Correction is not always needed, and -just as said- i have no opportunity to check your sample at the moment.
P.P.S: Fiddle with LSF-MOD (there are various parameters to tweak), Fiddle with FFT3DGPU(IF you use it) but leave precision=2, Fiddle with DeBlockQED/Deblock, DO NOT Fiddle with removegrain, Mode=5 is the best option for you.
P:P:P:S: FIDDLE WITH TDEINT!!!

DVDBob
1st November 2010, 16:58
How many of the plugins can find in New Plugins and Utilities?? or should I find them on google??

nurbs
2nd November 2010, 13:13
The wiki has a very comprehensive plugins list (http://avisynth.org/mediawiki/External_filters) and includes links for most of them. Apart from that you can look in the Avisynth subforums here or google them.

DVDBob
2nd November 2010, 14:25
Ok. i trying later

DVDBob
2nd November 2010, 15:33
MPEG2Source("G:\Taxa.E02.d2v",iPP=true,CPU=4)
TDeint()
Crop(12,58,-12,-58) # Crop the image correctly
ColorYUV(off_y=OFF1,gain_y=OFF2) #for luma correction, see ** for details
#FFT3DGPU(precision=2) #Use this by your own flavour
LSFMod(dest_x=704, dest_y=400)
RemoveGrain(mode=5) #Simple and very decent Denoiser for leftovers of LSF-MOD (if there are some, you can leave this out, if you want to)
Limiter() #Safety First...if you have used ColorYUV Correction, you better set limiter() for luma peaks, which are out of Spec
Histogram() #Only for Analysis - comment it out for final encoding

I can't find out what i should write in off1 and off2, but i hope the rest is Ok.

I am new to external plugins and filters

Hagbard23
3rd November 2010, 00:24
You only need to set those 2 variables (better: to set ColorYUV), when you notice luma offset. It was just a simple thought, that your source CAN have this offset.

To figure out wether this is truly the case i suggested to use the histogram function. Try this:


MPEG2Source("G:\Taxa.E02.d2v",iPP=true,CPU=4)
TDeint()
Crop(12,58,-12,-58) # Crop the image correctly
#ColorYUV(off_y=OFF1,gain_y=OFF2) #for luma correction, see ** for details
#FFT3DGPU(precision=2) #Use this by your own flavour
#LSFMod(dest_x=704, dest_y=400)
#RemoveGrain(mode=5) #Simple and very decent Denoiser for leftovers of LSF-MOD (if there are some, you can leave this out, if you want to)
#Limiter() #Safety First...if you have used ColorYUV Correction, you better set limiter() for luma peaks, which are out of Spec
Histogram() #Only for Analysis - comment it out for final encoding

And open the resulting AVS File in virtual dub or via media player classic. The movie should run.
After that, you go through the movie and look carefully on the diagram on the right side. The lower values (left side of diagram) should NOT cross the yellow border, but they SHOULD touch it. That means: The Values which should mean a dark "black" are correctly the lowest possible values of the Colorspace. If they tend to be to high (black becomes gray) then you have to correct this, by shifting the movie-color-space(setting a negative value for OFF1 [-4 for example]). That means: You make the "grayish" Values more dark. Unfortunately you shift the "white" values down too, and this is corrected via the "luma-gain" parameter. That means: After putting the gray-values down to black you overdrive the white values (with a positive OFF2 parameter) , so that it fits again in the global colorspace (represented by the two yellow lines in the histogram). In short words: With that you "expanded" (or "compressed" in seldom cases) the Colorspace of the Source to the ColorSpace of the Medium you want to use. (mostly TV Levels: 16-235 / 16-240)

(The result should be:

Black scenes are touching the left yellow borderline.
White scenes are touching the right yellow line.

If that is the case color correction is either done or not needed anymore. You can set "limiter()" for absolute safety - this function crops all overshooting luma values, so that they fit in the color-space. It is important to understand the "Colorspace-Thing" when juggling movies through different formats. So you are best off, if you read a littlebit about that, since my words are far to dumb for that topic.

After setting the Colors you use the following script:


MPEG2Source("G:\Taxa.E02.d2v",iPP=true,CPU=4)
TDeint(order=1)
Crop(12,58,-12,-58) # Crop the image correctly
ColorYUV(off_y=OFF1,gain_y=OFF2) #read my post for details
#FFT3DGPU(precision=2) #Use this by your own flavour
LSFMod(smode=4,smethod=4,lmode=4,soothe=true,ss_x=1.5,ss_y=1.5,dest_x=704, dest_y=400)
RemoveGrain(mode=5) #Simple and very decent Denoiser for leftovers of LSF-MOD (if there are some, you can leave this out, if you want to)
Limiter() #Safety First...if you have used ColorYUV Correction, you better set limiter() for luma peaks, which are out of Spec
#Histogram() #Only for Analysis - comment it out for final encoding


EDIT:
Yeah....I've turned up my Avisynth here at work and checked your sample again with the histogram... :))) don't mind color correction, your source is absolutely in Spec you can leave out the COLORYUV() function. But better use Limiter() because some values are weirdly overshooten...

DVDBob
3rd November 2010, 15:51
I get an AviSynth error in VirtualDub with the last script:

I Don't know why.

http://img51.imageshack.us/img51/3421/lsfmoderror.jpg

Hagbard23
4th November 2010, 00:50
because you didn't load masktools...you need this plugin (as well as removegrain and repair) for the LSF.Mod function... read here:

http://avisynth.org/mediawiki/MaskTools

it is an external plugin and you load it normally via LoadPlugin()...

DVDBob
4th November 2010, 03:44
Now it looks like this:
MPEG2Source("G:\Taxa.E02.d2v",iPP=true,CPU=4)
TDeint(order=1)
Crop(12,60,-12,-60) # Crop the image correctly
ColorYUV(off_y=4,gain_y=-4) #read my post for details
FFT3DGPU(precision=2) #Use this by your own flavour
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\MaskTools.dll")
LSFMod(smode=4,smethod=4,lmode=4,soothe=true,ss_x=1.5,ss_y=1.5,dest_x=704, dest_y=400)
RemoveGrain(mode=5) #Simple and very decent Denoiser for leftovers of LSF-MOD (if there are some, you can leave this out, if you want to)
Limiter() #Safety First...if you have used ColorYUV Correction, you better set limiter() for luma peaks, which are out of Spec
#Histogram() #Only for Analysis - comment it out for final encoding

But does not work.

I have these plugins and filters in my AviSynth folder:
MaskTools
RemoveGrain+Repair (RemoveGrain.dll, RemoveGrainS.dll, RemoveGrainSSE2.dll, RemoveGrainSSE3.dll, Repair.dll, RepairS.dll, RepairSSE2.dll, RepairSSE3.dll)
TDeint
LSFmod
FFT3dGPU

If i not have all the required plugins and filters, may you tell me it.

Hagbard23
5th November 2010, 10:20
Don't let them autoload .... do it like this:

delete the files inside plugins directory...except tcpdeliver.dll
Make a folder, for example C:\New\
Copy the needed Plugins to this directory (you only need one version of Removegrain.Dll in the Directory...Choose SSE,SSE2,SSE3 or S or the native version)

Loadplugin("C:\New\DGDecode.dll")
Loadplugin("C:\New\RemoveGrain.dll")#Use RemovegrainS.dll if you encounter problems
Loadplugin("C:\New\Repair.dll")#Use RepairS.dll if you encounter problems
Loadplugin("C:\New\FFT3DGPU.dll") #You have to copy FFTW.dll into System32 Directory of Windows see here for details: http://avisynth.org.ru/docs/english/externalfilters/fft3dgpu.htm
Loadplugin("C:\New\Tdeint.dll")
Loadplugin("C:\New\MT_Masktools-26.dll")
Import("C:\New\lsfmod.avsi")
MPEG2Source("G:\Taxa.E02.d2v",iPP=true,CPU=4)
TDeint(order=1)
Crop(12,60,-12,-60) # Crop the image correctly
FFT3DGPU(precision=2) #Use this by your own flavour
LSFMod(smode=4,smethod=4,lmode=4,soothe=true,ss_x=1.5,ss_y=1.5,dest_x=704, dest_y=400)
RemoveGrain(mode=5) #Simple and very decent Denoiser for leftovers of LSF-MOD (if there are some, you can leave this out, if you want to)
Limiter() #Safety First...if you have used ColorYUV Correction, you better set limiter() for luma peaks, which are out of Spec

Gavino
5th November 2010, 13:31
delete the files inside plugins directory...except tcpdeliver.dll
You should also keep DirectShowSource.dll and colors_rgb.avsi, which are part of the standard Avisynth installation (like TCPDeliver.dll).

Also, if you are using the standard Avisynth, you should be using mt_masktools-25.dll, not mt_masktools-26.dll.

Hagbard23
5th November 2010, 13:50
Yeah ...you were right... i am using AVS Alpha 2.6...therefor i use the newer Masktools Edition.

Directshowsource and colorsRGB are not really needed but you are right in keeping those files for other tasks....

i personally do not let Directshowsource.dll autoload, but its a matter of taste... ;)

DVDBob
5th November 2010, 23:11
Now I've done what you described in your post and now it works.

So I would say many thanks for your help and thanks for your patience.

Hagbard23
6th November 2010, 11:45
You're welcome...if you encounter further problems, just post here...

if your experience rises, please stay here at Doom9 and help our community... ;)

bye bye...and happy encoding..