View Full Version : New very slow FFT denoiser
Pages :
1
2
3
4
5
6
7
[
8]
9
10
11
12
13
14
15
16
17
DarkFoon
19th August 2005, 06:25
Hmm, I don't know what to say. Perhaps Fizick will be able to better help you.
sorry :(
videoFred
19th August 2005, 14:16
Thank you all for the feedback!
@Krieger:
No, I can not use another sharpener, because limitedsharpen() gives me this:
(I don't think any sharpener can beat this!)
Fuji Single-8 film, 1972, remember this is real film. Frame size 6x4mm.
http://users.telenet.be/ho-slotcars/testmap/horse2.jpg
@Darkfoon:
Backwoods and I are both working with real film...maybe...
@CWK:
Changing blocksize helps a bit, changing from luma to chroma also.
But low setting sigma=1 or 2 and heavy degrainmedian() before FFT3D()seems to be the best solution so far.
I tried other denoisers, like MVdenoise(). This is a very 'heavy' denoiser, but objects begin to move... I do not have this effect with FFT3D().
Fred.
DarkFoon
22nd August 2005, 20:45
how are you getting your film digitized videoFred? Are you sure that those wierd artifacts in dark areas aren't just from the original film or the digitization process and are being amplified by FFT3D?
If you can post an original frame and a processed frame for comparison that would help much!
Pookie
22nd August 2005, 20:59
What about the VirtualDub Plugin - Shadow Smoother v0.7
http://timsara.zetafleet.com/vdub/ss/shadowsmoother0.7.zip
Here's the code to make it work in AviSynth, but try it in VirtualDub first so you can see the areas it will affect.
Function Written by D Graft (I believe, apologies if I got it wrong)
#############################################
# Shadow smoother by Valentim Batista, v0.7 #
# threshold (0-8), strength (1-23), #
# difference (0-6) #
#############################################
function VD_ShadowSmoother(clip clip, int "threshold", int "strength",
\ int "difference", bool "pixellock", bool "noiselock", bool "postsmooth")
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\shadowsmoother07.vdf", "_VD_ShadowSmoother")
return clip._VD_ShadowSmoother(default(threshold,4), default(strength,15), default(difference,2),
\ default(pixellock,false)?1:0, default(noiselock,false)?1:0, default(postsmooth,false)?1:0)
}
# example:
# ConvertToRGB()
# VD_ShadowSmoother(4, 1, 3, true, true, true)
# ConvertToYUY2()
videoFred
23rd August 2005, 06:31
@Darkfoon:
No, the artifacts are not on the original, they are caused by FFT3D.
And limitedsharpen() makes them more visible.
Here is some more info about my system, and some pictures, too.
http://forum.doom9.org/showthread.php?t=84196&page=9&pp=20&highlight=limitedsharpen%28%29
@Pookie:
Thank you, I try this plugin.
Fred.
Fizick
25th August 2005, 20:18
I can not reproduce these intensity "quantization" (discretization) artifactes.
Post your FULL script.
videoFred
26th August 2005, 07:40
OK, here is my script:
The original is 1024 x 768, progressive, 15 FPS, Huffyuv.
I also use depan followed by fps2to3() panning now is * S M :p :p T H *
But the original filmtransfer must be frame accurate: no duplicates, no pulldown patterns.
inkort=6 degran=2 denoise2=2 blok=12 sharp1=0 plan=0 damp=0.3 asum=16.6666
oversam=1.0 radi=2 scherpsterk=650 piks=0 overscherp=50
over=0.6 britt=20 kontt=0.4 satru=1.5
film="D:\films\VideoFred\steam.avi"
function fps2to3(clipYV12)
{
# change FPS from 2 to 3 (or 16.66 to 25, or 20 to 30 and so on), i.e. with factor=3/2
# uses global motion compensation
# input must be YV12 progressive (or separated fields probably ?)
data = DePanEstimate(clipYV12,trust=0)
f1_3 = DePan(clipYV12, data, offset=1./3)
b1_3 = DePan(clipYV12, data, offset=-1./3)
Interleave(f1_3, clipYV12, b1_3)
SelectEvery(6, 0, 1, 2)
}
SetMemoryMax(128)
W=800 H=616 CL=40 CT=20 CR=-40 CB=-20
#W=320 H=240 CL=0 CT=0 CR=-0 CB=-0
Loadplugin("Depan.dll")
Loadplugin("degrainmedian.dll")
loadplugin("fft3dfilter.dll")
Loadplugin("Masktools.dll")
Loadplugin("Warpsharp.dll")
Import("limitedsharpen.avs")
avisource(film).assumefps(asum).trim(inkort,0).Lanczos4Resize(W,H)
i=converttoYV12()
mdata=DePanEstimate(i,trust=0)
clip1=DePanStabilize(i,data=mdata,cutoff=0.2,damping=damp).crop(CL,CT,CR,CB)
clipD=DeGrainMedian(clip1,limitY=5,limitUV=10,mode=degran)
clipD2=FFT3DFilter(clipD,sigma=denoise2,sharpen=sharp1,plane=plan,bw=blok,bh=blok)
clipS=limitedsharpen(clipD2,pixo=piks,ss_x=oversam,ss_y=oversam,lmode=1,smode=1,radius=radi,
\strength=scherpsterk,special=true,soft=true,wide=true,overshoot=overscherp)
clip3=tweak(clipS,bright=britt,cont=kontt,sat=satru)
mask=Greyscale(invert(clipS)).tweak(bright=-80,cont=1.5)
eindclip=overlay(clipS,clip3,mask=mask,opacity=over,mode="add")
frameclip=fps2to3(eindclip)
stacko=stackhorizontal(clip1,eindclip)
#eindclip
#frameclip
stacko
It produces this:
http://users.telenet.be/ho-slotcars/testmap/erik3.jpg
Full size BMP: http://users.telenet.be/ho-slotcars/testmap/erik3.bmp
Fred.
Mug Funky
26th August 2005, 08:08
those look like quantization error from having only 8 bits. try ease limitedsharpen off a little. fft3dfilter isn't necessarily causing this problem, rathe r it's just the difference between luma=1 and luma=0 being amplified by limitedsharpen. you could lower the overshoot in limitedsharpen and it will probably help.
videoFred
26th August 2005, 08:21
fft3dfilter isn't necessarily causing this problem, rathe r it's just the difference between luma=1 and luma=0 being amplified by limitedsharpen. you could lower the overshoot in limitedsharpen and it will probably help.
OK, but I do not have it with other denoisers....
But fft3dfilter works the best for me.
So it must be the combination fft3dfilter - limitedsharpen.
But I'm very happy with this combination, and the artifacts are only in scenes with very dark parts, and only visible if I tweak brightness-contrast-gamma.
Fred.
krieger2005
26th August 2005, 13:45
I used this little script:
PixieDust2(4)
LanczosResize(720,576)
VagueDenoiser(threshold=2,method=3, nsteps=8,chromaT=0.8)
limitedsharpen(ss_x=1.0,ss_y=1.0,lmode=1,smode=1,radius=2,
\strength=650,special=true,soft=true,wide=true,overshoot=50)
and got also strange lines... These lines were not produced by fft but by vaguedenoiser... these lines were also not "quadratic" like in your picture but like forms (like forms of cloads ro such forms)... it is just the denoising-algorithm of vaguedenoiser to denoise big flat areas more than complex little areas. This is why i get with your LS-Settings such "forms".
The same now for FFT. It used "quadratic" shapes to denoise the picture. If you use such strong settings you see just how the denoiser work.
I think you can reporoduce this effect with quite every denoiser (more or less visible).
BTW: You can see these artifacts also in bright parts of the movie... the are, which is "sharpened" by LS must be only flat... I want to say, that these artifacts were produced if there is an flat area which is sharpened.
videoFred
26th August 2005, 16:46
I think you can reporoduce this effect with quite every denoiser (more or less visible).
BTW: You can see these artifacts also in bright parts of the movie... the are, which is "sharpened" by LS must be only flat... I want to say, that these artifacts were produced if there is an flat area which is sharpened.
Yes, it must be this.......
I must fine-tune my settings.
Thank you all for testing and feedback!
Fred.
TheBashar
29th August 2005, 04:59
@Fizik,
I've recently started using FFT3dFilter with great success. There is a faint grid pattern in my test clip with my original parameters, so I started tweaking the block dimensions and overlaps to try and remove it. Unfortunately, I started getting repeated system lockups when I tried some parameters. Do you think the filter is probably exposing a flaw in my hardware or could there be a parameter dependant bug in the code that's causing the problem?
I'm using a Shuttle SN45G with Athlon XP 3200+ and 1GB RAM.
The original settings that do not seem to cause a problem are:
FFT3DFilter(sigma=4,plane=0,ow=24,oh=24,kratio=0.75,sharpen=0.3)
FFT3DFilter(sigma=4,plane=1,ow=24,oh=24,kratio=0.75,sharpen=0.3)
FFT3DFilter(sigma=4,plane=2,ow=24,oh=24,kratio=0.75,sharpen=0.3)
However, when increased the block dimensions and overlap, I experience a system lockup about 1 out 3 times I run through my test clip. Those settings are:
FFT3DFilter(sigma=4,plane=0,bw=64,bh=64,ow=32,oh=32,kratio=0.75,sharpen=0.3)
FFT3DFilter(sigma=4,plane=1,bw=64,bh=64,ow=32,oh=32,kratio=0.75,sharpen=0.3)
FFT3DFilter(sigma=4,plane=2,bw=64,bh=64,ow=32,oh=32,kratio=0.75,sharpen=0.3)
Finally, I speculated that perhaps the grid pattern was reinforced by using the same block dimensions in all 3 planes. I tried these settings which cause my system to lock up 4 out 5 runs through the test clip:
FFT3DFilter(sigma=4,plane=0,bw=64,bh=64,ow=32,oh=32,kratio=0.75,sharpen=0.3)
FFT3DFilter(sigma=4,plane=1,bw=60,bh=60,ow=30,oh=30,kratio=0.75,sharpen=0.3)
FFT3DFilter(sigma=4,plane=2,bw=56,bh=56,ow=28,oh=28,kratio=0.75,sharpen=0.3)
Any ideas where this might be coming from? Has any other FFT3D user experienced anything like this?
Thanks!
Fizick
30th August 2005, 05:23
TheBashar,
i can not reproduce faults.
Version 1.7 - August 29, 2005 - changed sharpening to Gaussian filter with new parameter scutoff;
added SSE version for sharpen mode and pattern modes bt=2,3 ;
restuctured and released code under GNU GPL v.2.
(mirror does not work)
cwk
30th August 2005, 07:47
this man is my hero.
TheBashar
3rd September 2005, 04:35
i can not reproduce faults.
Hmmm... I wish I could find a way to get some useful debug output. I found a new BIOS update for my computer, but that didn't affect the problem. I tried another test with block dimensions 48,50,60 and my system locked up within 5 seconds of starting to run in throuh VDM. I have been able to run 24 hours worth of encodes using dimensions 48,40,40.
The only correlation I can see is that the larger the block dimension the quicker the problem seems to occur.
DarkFoon
3rd September 2005, 07:28
i seem to remember that FFTW requires some special math DLL or something.
like iamath32.dll or something.
that could be the problem.
Pookie
3rd September 2005, 07:42
There are a few applications which could be of use for troubleshooting. They are both located at http://www.sysinternals.com . One is ProcessExplorer, which will allow you too see things like dependencies, and also pretty specific memory load statistics. The second is Filemon, which will allow you to see file activity in realtime.
To do actual debugging, look at this page: http://www.sysinternals.com/Utilities/LiveKd.html
I'll bet there is a support DLL somewhere in your system that is either the wrong version, or is corrupt.
TheBashar
3rd September 2005, 07:49
@DarkFoon
Yeah, I thought about that too. I had been using the mingw version of fftw.dll so I tried the ICC compiled version of the dll. Unfortunately, same system lockup happened.
@Pookie
Thanks, I've got both apps open. I don't know what I'm looking for, but hopefully something will make itself obvious.
Thanks!
Pookie
3rd September 2005, 08:07
In ProcessExplorer, click on "System Information". Check and see if your free memory starts shrinking as your encode progresses. Perhaps some file has a memory leak, and those block sizes exhaust the system quicker.
Good luck. Esoteric problems like these can be hard to track down.
TheBashar
8th September 2005, 11:20
Good luck. Esoteric problems like these can be hard to track down.
Argh. Sorry to waste everybody's time with this. Prime95 spit up within one second on my machine. Bumping VCore a notch let it run for an at least an hour and coincidentally so far no system freezes with fft3dfilter.
Since I'm not overclocking I never thought about having to check the voltages. Sorry for the line noise!
DarkFoon
14th September 2005, 00:58
@Fizick
has there been any development with FFT3d?
TheBashar
14th September 2005, 01:05
I'd still like to get rid of the gridding from FFT3D. Does anyone know of a different filter that would be good to handle that? Is there some filter that is able to detect a static noise pattern (the grid) and subtract it out?
foxyshadis
14th September 2005, 01:29
I assume by grid you mean the sharp block edge transitions fft3d creates? You can search for deblock(), mdeblock(), blindpp(), and other deblockers; some have settings specifically recommended for fft3d but I don't recall them.
Revgen
14th September 2005, 01:34
I'd still like to get rid of the gridding from FFT3D. Does anyone know of a different filter that would be good to handle that? Is there some filter that is able to detect a static noise pattern (the grid) and subtract it out?
Do you have a recent GPU? Like something that supports Pixel Shader 2.0 like a GeForce 6xxx series or a Radeon 95xx series card?
If so try using FFT3DGPU (http://forum.doom9.org/showthread.php?t=89941) instead. It works much the same way as FFT3DFilter but doesn't suffer as much from "griding" artifacts.
Fizick
14th September 2005, 19:06
I work on FFT cache.
DarkFoon
18th September 2005, 06:31
Fizick, which is fastest?
Wintype=0, wintype=1, or wintype=2?
Or is there almost no difference?
I ask because it is not mentioned in the readme.
Fizick
18th September 2005, 08:58
IMHO, multilication by any value take the same time :)
Revgen
21st September 2005, 04:07
@Fizick
Your first post still mentions that FFT3DFilter only works with progressive sources. You might want to update it. ;)
Fizick
3rd October 2005, 21:55
Revgen,
No, we may not to rewrite the history. :)
But we can write it:
Version 1.8 - October 3, 2005 - improved internal FFT cache; added degrid=1.0 parameter as default; changed default wintype=0.
But FFT cache is still not very clever (for depaninterleave, etc).
degrid - weigthing window compensation degree for grid decreasing (float>0, default=1.0)
I recommend to use the weigthing window compensation with degrid=1, it improves the denoise quality and decreases the grid artifactes, especially for 2D.
FFT3D was the best temporal denoiser, now it is the best spatial too (IMHO) :)
Pookie
4th October 2005, 04:03
Just when I thought it couldn't get any better.... :)
Revgen
4th October 2005, 04:11
...added degrid=1.0 parameter...
FINALLY! :D
Now hopefully I can use LimitedSharpen after FFT3DFilter at high sigma values without too much griding.
If so I can then stop using PixieDust once and for all!
Fizick
4th October 2005, 04:42
Revgen,
No, we now hopefully can use sharpen=1.0 without too much griding
and stop using LimitedSharpen too ;)
(of couse, it is a joke, PixeDust and LS on some sources may be better)
Boulder
4th October 2005, 08:19
Hmm, looks like I'll have to try the filter with my next capture:)
Thanks!
Didée
4th October 2005, 09:12
No, we now hopefully can use sharpen=1.0 without too much griding
and stop using LimitedSharpen too ;)
Well, let's see how things will go on ... if too many people stop using LimitedSharpen due to FFT3D, I will release CrystalitySharpen. ;)
Seed
4th October 2005, 11:13
Well, let's see how things will go on ... if too many people stop using LimitedSharpen due to FFT3D, I will release CrystalitySharpen. ;)
iiP (with pixiedust) and LS are a bit long in tooth, but remain excellent in many circumstances.
FFT3d gets more and more robust and versatile and artefactless!
Bring it on, folks! I love healthy competition. We end users benefit from all you gurus. TQ, TQ, TQ...
E-Male
4th October 2005, 11:57
Well, let's see how things will go on ... if too many people stop using LimitedSharpen due to FFT3D, I will release CrystalitySharpen. ;)
i really hope that's a promise
hannah
12th October 2005, 11:59
Am trying to load fft3dfilter.dll
this is my .avs script:
Loadplugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
Loadplugin("C:\Program Files\AviSynth 2.5\plugins\LeakKernelDeint.dll")
Loadplugin("C:\Program Files\AviSynth 2.5\plugins\fft3dfilter.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpen.avs")
MPEG2Source("G:\dvd\Pamela\Pamela.d2v")
LeakKernelDeint(Order=1,threshold=5)
ColorMatrix()
Crop(8,0,-8,0,true)
Lanczos4resize(720,480)
#LimitedSharpen(ss_x=1.0,ss_y=1.0,Smode=3,strength= 40)
FFT3DFilter(sigma=3, plane=0,ow=8,oh=8)
I am using the 1.8 version of fft3dfilter (fft3dfilter18.zip). I am getting the following error:
Can some one please help? I run win2000 on a 900Mhz Celeron machine.
Many thanks
Boulder
12th October 2005, 13:16
You need to download the fftw3 package and extract fftw3.dll to \Windows\System32. The download link is ftp://ftp.fftw.org/pub/fftw/fftw3win32mingw.zip .
hannah
12th October 2005, 21:35
hey thanks for that.. will try it tonight. Now for future I believe it's helpful if there is a readme.txt file in fft3dfilter18.zip stating that one needs to download fftw3 package as well in order for fft3dfilter.dll to work.
Backwoods
12th October 2005, 22:04
From the readme (titled FFT3dFilter.html)
Features and limitations
Filter works only in YV12 or YUY2 color format.
Only specified single color plane is processed (Y, U or V).
Since v1.3 it works with both progressive and interlaced clips.
Tested with Avisynth v2.55, v2.56beta.
Filter uses fast external FFTW library version 3 (http://www.fftw.org)
as Windows binary DLL (compiled with gcc under MinGW by Alessio Massaro), which support for threads and have AMD K7 (3dNow!) support in addition to SSE/SSE2.
It may be downloaded from ftp://ftp.fftw.org/pub/fftw/fftw3win32mingw.zip
You MUST put FFTW3.DLL file from this package to some directory in path (for example, C:\WINNT\SYSTEM32).
Filter will NOT work without it!
FFTW works most efficiently for arrays whose size (bw, bh) can be factored into small primes (2, 3, 5, and 7), and otherwise it uses a slower general-purpose routine.
First versions were really slooow! But recent versions are simple slow :-).
Algorithm is improved and assembler 3DNow! and SSE instruction are used for some modes
Algorithm is optimized by speed for forward sequential frames access only.
The sharpening method is experimental, however is quite good since v1.1 (and v1.7).
The noise pattern method is experimental too.
hannah
13th October 2005, 01:20
My humble apologies then...
Backwoods
13th October 2005, 23:12
Happens, there aren't many filters with HTML readmes. They are much nicer though.
hannah
20th October 2005, 05:00
videoFred writes:
.....
mdata=DePanEstimate(i,trust=0)
clip1=DePanStabilize(i,data=mdata,cutoff=0.2,damping=damp).crop(CL,CT,CR,CB)
clipD=DeGrainMedian(clip1,limitY=5,limitUV=10,mode=degran)
clipD2=FFT3DFilter(clipD,sigma=denoise2,sharpen=sharp1,plane=plan,bw=blok,bh=blok)
clipS=limitedsharpen(clipD2,pixo=piks,ss_x=oversam,ss_y=oversam,lmode=1,smode=1,radius=radi,
\strength=scherpsterk,special=true,soft=true,wide=true,overshoot=overscherp)
.....
What is that parameter "pixo=piks" under limitedsharpen? I am getting an exception due to this. I have read Didee description of Limitedsharpen however could not find any reference of "pixo".
Can someone please explain?
videoFred
20th October 2005, 06:43
Hello Hannah,
Please remove this 'pixo'.
I forgot to remove it....
I changed the original Limitedsharpen()
But I changed it back to the original.
It was an experiment.
Fred.
hannah
20th October 2005, 12:41
Hello Hannah,
Please remove this 'pixo'.
I forgot to remove it....
I changed the original Limitedsharpen()
But I changed it back to the original.
It was an experiment.
Fred.
Yeah done that already..just wanted to know if there is anything I was missing. Mate this script is slow as..though I only have a 900Mhz Celeron.
mumdigaueln
21st October 2005, 13:37
Hi,
read trough this thread, and just tried to use FFT3D for the first time. Unfortunately, I can't get it to run. For shure, it's an install and/or syntax error on behalf of me. The script looks like this:
AVISource("F:\Video\Movie1\movie1.avi")
loadplugin("E:\Programs\AviSynth\plugins\FFT3DFilter\fft3dfilter.dll")
Crop(0,0,320,240)
FFT3DFilter(sigma=2.5, sharpen=0)
limitedsharpen(ss_x=2.0,ss_y=2.0,strength=70)
BicubicResize(528,480,0.33,0.33,0,0,320,240)
AddBorders(96,0,96,0)
ConvertToYUY2()
CCE doesn't recognize the source-avi, and Windows Media Player says it can't load fftw3.dll even though the file lies in system32. I tried to move it to the plugin directory, but that didn't help either.
Can anybody point me to where I'm wrong? Many thanks in advance for any help.
mumdigaueln
videoFred
21st October 2005, 14:11
You also need the ffw3.dll...
Is this one in your plugin directory, too?
You do not have to load it..
But it must be there.
Fred.
mumdigaueln
21st October 2005, 14:32
You also need the ffw3.dll...
Is this one in your plugin directory, too?
You do not have to load it..
But it must be there.
Fred.
It's missing. Where to get it from? I searched the Web, but didn't find it.
mumdigaueln
videoFred
21st October 2005, 14:53
It's missing. Where to get it from? I searched the Web, but didn't find it.
mumdigaueln
Go to the top of this thread :D
Fred.
mumdigaueln
21st October 2005, 15:28
You also need the ffw3.dll...
Is this one in your plugin directory, too?
You do not have to load it..
But it must be there.
Fred.
I already downloaded ftp://ftp.fftw.org/pub/fftw/fftw3win32mingw.zip, but that only contained fftw3.dll, not ffw3.dll. So where to get it from?
Additional question: Do I have to change the colorspace to YV12 before applying the filter?
mumdigaueln
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.