Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
23rd November 2004, 19:28 | #1 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
New very slow FFT denoiser
I make experimental very slow FFT denoiser.
FFT3DFilter - 3D Frequency Domain filter-denoiser FFT3DFilter uses Fast Fourier Transform method for frequency selecting an removing. The algorithm is based on the 3D IIR/3D Frequency Domain Filter from: MOTION PICTURE RESTORATION. by Anil Christopher Kokaram. Ph.D. Thesis. May 1993. http://www.mee.tcd.ie/~ack/papers/a4ackphd.ps.gz It is a spatial-temporal (3D) filter, and works as follows: 1) get 3 frames (previous, current, and next); 2) divide every frame to small overlapped blocks; 3) get frequency spectrum by windowed forward 3D FFT transform of every block of 3 frames; 4) reduce weak frequencies (with small power spectral density) by optimal Wiener filter with some given noise value; 5) make inverse 3D FFT transform of cleaned spectrum for every block; 6) do windowed summation of cleaned overlapped blocks to output frame. Features: 1. Works only in YV12 color format. 2. Directly works with progressive clips. For interlaced sources, probably you must use SeparateFields etc. 3. Tested with Avisynth 2.55. 4. 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). Filter will NOT work without it! 5. It is slooow! EDIT: New versions are not so slow now and have some other features and restrictions. See updated doc included with filter! I do not want to change this first post by historical reasons
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. Last edited by Fizick; 22nd November 2005 at 22:49. |
23rd November 2004, 23:28 | #3 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
link fixed
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
24th November 2004, 00:42 | #5 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
blocks are overlapped, so in theory there shouldn't be much difference?
small blocks might give less spatial smearing (what's the image equivalent of pre-echo?). i gotta try this filter now [edit] on large values of sigma, on bw=bh=16, i get a strange screen pattern. increasing the blocksize to something large fixes it. interesting filter. it removes a lot of the subtle crap in a picture. also seems to stabilize edges somewhat. too large values of sigma cause ringing, of course.
__________________
sucking the life out of your videos since 2004 Last edited by Mug Funky; 24th November 2004 at 00:52. |
24th November 2004, 16:14 | #8 | Link |
Registered User
Join Date: Nov 2004
Posts: 2
|
Can you please post the link to the filter plugin and to the 3dFFT dll again? The current FTP address requires a password authentification :-/
The principle sounds good to me, at least in music restoration FFT filtering is the only proper way to do the job - and the same method should give superior results, although finding the right FFT filter parameters is mostly a painstakingly time-consuming job, and the results of a slight overprocessing are received as "very artificial" by the human eye, so conservative settings are a must. Bernard (having done a lot of FFT filtering on "pictures" of particle physics detectors, but with hardware DSP solutions of the first generation in 1994) |
25th November 2004, 23:21 | #9 | Link | |
Professional Lemming
Join Date: Dec 2003
Location: Stuttgart, Germany
Posts: 359
|
Quote:
bis besser, Tobias
__________________
projects page: ELDER, SmoothD, etc. |
|
3rd December 2004, 11:09 | #13 | Link | |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
Quote:
in images, at least with this filter, larger blocks give more severe ringing. seeing as human eyes are less discerning than ears as far as frequency goes, i'd say it's safe to use smaller blocks and keep the edges happy
__________________
sucking the life out of your videos since 2004 |
|
3rd December 2004, 12:28 | #15 | Link |
Professional Lemming
Join Date: Dec 2003
Location: Stuttgart, Germany
Posts: 359
|
Thanks for your explanation Mug Funky.
What about correlating the results of smaller and larger blocks? If, like in audio, there are only so many things happening at the same time (per block) then use small blocks to determine where and correlate with the result of larger blocks to get more exact frequencies. Is the above nonsense? bis besser, Tobias
__________________
projects page: ELDER, SmoothD, etc. |
3rd December 2004, 16:42 | #16 | Link |
Registered User
Join Date: Oct 2003
Location: Germany
Posts: 377
|
Does someone noticed, that the border on the right and at the bottom where not proceeded by the filter, when the last block (in the image) is smaller that the block needed by the filter... I use then Addborders(0,0,X,X).FFT...().crop(0,0,-X,-X)
|
3rd December 2004, 16:57 | #17 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
@ tobias:
i'm not sure how useful that would be, but then Fizick is the programmer, not me i've also noticed that larger blocks require smaller values of sigma. i guess this makes sense, as the larger the FFT, the lower the energy of each measured frequency. i've been playing with 64x64, and that seems to be giving nice results. using varying block sizes sounds interesting though - it could be used to allow higher denoising but protect the edges. but i think if we're going that far, we should be using a wavelet-based denoiser like Vague. i'm liking the results this filter gives. definitely worth the wait @ krieger2005: cool. i'll try that, as i just noticed the problem i suppose a small wrapper function could be made that adds borders to pad the input clip out to the nearest mod(blocksize) number, then crop after.
__________________
sucking the life out of your videos since 2004 |
3rd December 2004, 17:49 | #18 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
I release version 0.2
Add BETA parameter to low ringing beta - noise margin (float?1.0, default=1.0 for no noise left) control noise amount left in the restoration, max filter noise attenuation = (beta-1)/beta (see Kokaram doc for detail). I also know about border feature
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. Last edited by Fizick; 3rd December 2004 at 19:29. |
20th December 2004, 06:36 | #19 | Link |
Awakened to video Dec2003
Join Date: Dec 2003
Location: US West
Posts: 191
|
A few ideas...
I was wondering what you guys would think if this filter had control over the temporal filtering. So that it could be user defined,
for example: temp=<value> where <value> could be, -n, where it only processes previous N number of frames (and current) 0, temporal off n, where it does previous and future N number of frames. i.e if N = 2, then it would do 2 previous frames and 2 future frames, greatly slowing it all down, of course. I like the filter, but the reason I suggest this is because my experiences with big or small values of sigma and bh/bw, I get horrible ghosting on my anime images (they're rather grainy CATV captures from live broadcast). Perhaps this filter is bad for anime? I know that temporal is a strong point of this filter, however, there are situations where temporal filtering can be undesireable. I also thought that if there was a parameter to make the filter run all three planes (or a combination thereof) with only one filter instance in the script. I think this would be good because the user could, for example, turn off temporal and turn on all three planes and there would be no gain/loss in filter speed; it would still be processing three planes, but all within the same frame, as opposed to the current way things are. let me know what you guys think of all this. By the way, I like the idea of dynamic block sizing. The arguments for dynamic block sizing are compelling. |
20th December 2004, 08:05 | #20 | Link |
the dumbest
Join Date: Oct 2002
Location: Malvinas
Posts: 494
|
My experience has been fantastic using this filter!!!
Complete noise removal with a lot of subtle details preversed at the same time!! I use it with its default values, just changing sigma on color planes. (red higher than Y and blue higher than red..) after it I just add a little temporal and ready.. |
Thread Tools | Search this Thread |
Display Modes | |
|
|