View Full Version : New very slow FFT denoiser
Fizick
23rd November 2004, 19:28
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 :)
Soulhunter
23rd November 2004, 21:57
Sounds nice, but for some reason I cant download it... :(
Bye
Fizick
23rd November 2004, 23:28
link fixed
Soulhunter
23rd November 2004, 23:57
Question...
Smaller blocks should give better results, no ???
Bye
Mug Funky
24th November 2004, 00:42
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.
Soulhunter
24th November 2004, 01:07
Originally posted by Mug Funky
On large values of sigma, on bw=bh=16, i get a strange screen pattern...
Looks it like a grate/grid or so ???
Guess I got the same effect...
Bye
SirCanealot
24th November 2004, 03:31
I was going to try, but the link seems to be down again :(
Is it just me?
hampel
24th November 2004, 16:14
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)
708145
25th November 2004, 23:21
Originally posted by Soulhunter
Question...
Smaller blocks should give better results, no ???
WIMNI, larger blocks give higher precision to the fft, thus better decision about what is unneccessary.
bis besser,
Tobias
Soulhunter
26th November 2004, 01:15
Originally posted by 708145
WIMNI, larger blocks give higher precision to the fft, thus better decision about what is unnecessary.
Interesting, thanks for the info... :)
Bye
oledoe
28th November 2004, 18:33
I've been looking for a filter to get the best possible results on a very noisy CATV signal, with lots of noise in the Y channel.
This is by far the best one I have found.
Thanks!
morsa
30th November 2004, 23:58
Yes, it is real good, I tried it on a noisy DV source and I made miracles.Removed all the noise keeping perfect quality.
YOU DID IT AGAIN, FIZICK!!!!!!!
Mug Funky
3rd December 2004, 11:09
WIMNI, larger blocks give higher precision to the fft, thus better decision about what is unneccessary.
actually, it's a trade-off between spatial (transient in audio) accuracy and frequency accuracy. this is why (good) audio codecs based on frequency transforms will have 2 or more block-lengths. short blocks for sharp transients (where time is more important than freq, like percussion, applause, impulses) and long blocks (where freq is more important than time, like highly tonal instruments, etc).
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 :)
Soulhunter
3rd December 2004, 11:39
Would a variable block-size improve this filter ???
Bye
708145
3rd December 2004, 12:28
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
krieger2005
3rd December 2004, 16:42
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)
Mug Funky
3rd December 2004, 16:57
@ 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.
Fizick
3rd December 2004, 17:49
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 ;)
DarkFoon
20th December 2004, 06:36
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.
morsa
20th December 2004, 08:05
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..
DarkFoon
20th December 2004, 08:58
@morsa
what kind of sourse do you use these settings on?
analog capture? DV capture? DVD? VHS? Broadcast?
Also, what sigma values do you actually use?
Leo 69
20th December 2004, 18:54
Actually I'd be very grateful to some guys here who'd post some good settings for this filter.For example "light denoising" "heavy denoising" etc. And "High Quality Standard denoising" would be great!:D
Сheers
Fizick
21st December 2004, 18:46
So, people want 2D :)
Got it!
Version 0.3, 21 December 2004 - added block temporal size parameter bt (was fixed =3 internally).
bt - block temporal size, number of frames (1, 2, or 3, default = 3):
1 - only current frame (spatial 2D filter - fastest);
2 - previous and current frame;
3 - previous, current and next frame (slowest)
IMHO, for big noise we must use big sigma, and more large block 32x32 to prevent grid artifactes.
Probably for 2D block 32x32 is better too.
morsa
21st December 2004, 19:50
for More oe less noisy DV I use plane 0 sigma=2, plane 1 sigma=3 ,plane 2 sigma =4.
I don't remember the block size right now but I guess it was 16....
krieger2005
21st December 2004, 22:47
great filter, ass always... and you are right: it's very slow.
To prevent "bluring" of edges with high sigma-values one can use "FineEdges"-Function from "Didée" i guess. Here my try:
function CleanUp(clip c, int "eEnd", int "eStart", int "bw", int "bh", float "sigma", int "sharp", bool "mask"){c
eEnd=default(eEnd,8)
Flaechen" markiert
eStart=default(eStart,68)
bw=default(bw,32)
bh=default(bh,32)
sigma=default(sigma,3.0)
sharp=default(sharp,180)
mask=default(mask,false)
ed=c.FineEdge(16)
SurfaceMask=ed.Levels(eEnd,1,eStart,255,0,false)
ret=mask ? MaskedMerge(c,c.BlankClip(pixel_type="YV12", color=$66FF66),SurfaceMask,Y=3,U=3,V=3,useMMX=true) : NOP()
cleanSurface=c.AddBorders(0,0,bw+20,bh+20).FFT3DFilter(bw=bw, bh=bh, sigma=sigma).crop(0,0,-(bw+20),-(bh+20)).xsharpen(sharp)
ret= (!mask) ? MaskedMerge(c,cleanSurface,SurfaceMask,Y=3,U=3,V=3,useMMX=true) : ret
return ret
}
great job.
DarkFoon
21st December 2004, 23:54
@Fizick
How does the "previous frame" part of the filter work?
does it take the unprocessed previous frame, and then process it, or does it take the processed previous frame and process it again?
Hmm, an example would be good, that doesn't seem to make sense...
For example:
The filter is set "bt=2".
I randomly access frame 10. The filter processes frame 9, and frame 10 in the FFT, and then gives the filtered output frame 10.
Then I move over to frame 11. When the filter processes frame 11, it also processes frame 10, but does it take filtered output frame 10, or does it take the original frame 10?
Gosh, I hope that makes sense. Anybody else know what I'm saying?
State of Mind
22nd December 2004, 07:21
Ok, I also have a noisy DV source, what are the commands to use this plugin? I am VERY eager to see how well this denoises my DV.
State of Mind
22nd December 2004, 21:11
???
Fizick
22nd December 2004, 21:46
DarkFoon,
current versions has no memory, and procesed (spatially) all frames at every time step. It is not optimal, but easy coded. My filter is still experimental. I had some think about optimizing, and may be another temporal algo (Kalman) for 2D frequency "frames", but not rigth now. Sorry.
But (IMHO) the speed factor will not =2 for bt=2. Overlapped frame is large.
State of Mind,
do you have your own eyes? Try!
DarkFoon
24th December 2004, 00:40
@State of Mind
I tested this filter on my noisy DV capture and *angelic choir* it worked a miracle!!!
It would appear that the Y channel (plane=0, in the filter) is the noisiest. You can turn the filtering on so that it processes the other channels, but you wont get as dramatic of an improvement as you would with just the luma (Y, or whatever) being filtered.
Supposing that your capture is still 720x480 when you run this filter:
FFT3dFilter(sigma=2.0, bt=3, plane=0, bh=48, bw=48, measure=false)
That is what I used on my capture. Experiment with filtering the other planes in addition to this one.
@Fizick
Does the filter need square block sizes? Or could I get away with, for example, bh=48, bw=90? [for this example, assume that the block sizes fit exactly into the video frame.]
Fizick
24th December 2004, 23:08
DarkFoon, do you see any limitation or constrain on block size in my filter "manual" :)
But some sizes will result in very slow procesing due to FFT method implementation.
See FFTW doc for more info.
48 and 90 is OK.
DarkFoon
25th December 2004, 02:39
where in the docs does it say what sizes might slow it down? Or what should I look for? Sorry, I'm not a programmer, so I am lost in those kinds of things.
Fizick
25th December 2004, 11:42
FFTW works most efficiently for arrays whose size can be factored into small primes (2, 3, 5, and 7), and otherwise it uses a slower general-purpose routine.
48 = 2*2*2*2*3 is OK
90 = 2*3*3*5 is OK
DarkFoon
26th December 2004, 01:32
Thanks!
Keep up the good work!
This filter has great potential, don't let it fall between the cracks.
Leak
26th December 2004, 12:50
Originally posted by Fizick
FFTW works most efficiently for arrays whose size can be factored into small primes (2, 3, 5, and 7), and otherwise it uses a slower general-purpose routine.
48 = 2*2*2*2*3 is OK
90 = 2*3*3*5 is OK
Shouldn't this info be in your filter's documentation, under "Performance considerations" or something like that?
(NB: I haven't tried your filter as I don't have sources that are noisy enough, so apologies if it's already in there... :))
np: Donnacha Costello - Dry Retch (Pop Ambient 2002)
gst
26th December 2004, 20:32
This filter is really powerfull. Maybe the best denoiser out there, and one of the slowest to.
I've got interesting results with this combination on a noisy dvd source :
DRemoveGrain(mode=2).DRemoveGrain(mode=2)
crop()
Lanczos4Resize()
Unfilter(-5,-5).FFT3DFilter(sigma=3,bh=32,bw=32).Unfilter(-5,-5).DRemoveGrain(mode=1)
I've also made a few test with the block size. You can see results here :
http://x.spirit.free.fr/FFT3D.zip (4.69Mo)
Block size tested :
8x8;16x16;32x32;64x64
Codec : xvid
Matrix : eqm_v3ulr_rev2
Bitrate: 1.050mb/s
32x32 give me the best quality, but there's no big difference between 16x, 32x and 64x. 8x is the worst value for my source.
Good job Fizick
DarkFoon
26th December 2004, 23:31
I usually work on anime, so my filter combination is much stronger than for video, for obvious reasons. But here it is, for those interested:
fft3dfilter(sigma=2.0, plane=0, bt=2, bh=48, bw=48, measure=false) #<- Y plane
fft3dfilter(sigma=3.0, plane=1, bt=2, bh=48, bw=48, measure=false) #<- U plane
fft3dfilter(sigma=4.0, plane=2, bt=2, bh=48, bw=48, measure=false) #<- V plane
msmooth(threshold=5, strength=3, mask=false)
Note: I use 48 because it is the largest number the divides into 720 and 480.
This is incredibly slow on my PIII, but it works excellently.
An explanation: the eye is most sensitive to luma, so that is filtered the least. But the difference between not filtering the luma and filtering it is quite visible; this can make or break the quality.
The reds (V plane, whatever you call it) are the most subsampled with my source (MPEG2 TV capture) so they can be filtered more powerfully.
Msmooth is to blend out the 'ghosting' that results (sometimes) from the temporal part of the filter. It's most noticeable when there are fast motions across large solid color areas.
To illustrate this, I have some pictures for comparison.
Original source frame (after IVTC, but no denoising):
http://www.freewebs.com/cassumnox/6343-original.png
Frame after FFT3D, but no Msmooth:
http://www.freewebs.com/cassumnox/6343-unsmoothed.png
Frame after FFT3D and Msmooth:
http://www.freewebs.com/cassumnox/6343-smoothed.png
The 'ghosting' I am talking about can be seen on the suitcase.
Note: compare the file sizes of the pictures too ;)
Sorry the host is so slow, my usual server is down. :'(
Fizick
27th December 2004, 21:36
...When the filter processes frame 11, it also processes frame 10, but does it take filtered output frame 10, or does it take the original frame 10? Gosh, I hope that makes sense. Anybody else know what I'm saying?
DarkFoon, seems now I understand your question :)
All normal temporal filters (fft3d too) always take only original frames on input, not prefiltered by previous steps.
Other comment: V plane is not quite "red". Ask Wilbert (or see his guide) for detail :)
DarkFoon
27th December 2004, 22:10
V is not red?
Crap! Curse the internet's wealth of misinformation!
Wilbert
27th December 2004, 22:53
V is the red minus the luma. Highering V will turn your clip to red and lowering it to green (you can check that with ColorYUV(off_v=x)).
btw, V and U are sampled "equally", so you can apply the same amount of filtering on them.
DarkFoon
28th December 2004, 13:13
I thought U and V were sampled differently.
Ex. -YUV 4:2:0 (YV12, MPEG1/2, etc.) The luma is fully sampled, because the eye notices luma differences the most, and thus it is least compressed. U is subsampled, and V is even more so.
-YUV 4:2:2 (YUY2) The luma is not subsampled (perhaps that is the wrong word?) The U and V are equal, and because of such, there is more data than YV12.
-YUV 4:1:1 (DV) I'm noticing a luma pattern here ;) The U and V are again equal, but smaller than YUY2.
-YUV 4:4:4 (???) fully sampled, lots of data.
I draw my data conclusions (which become the explanations for my understanding of this) by taking an AVS in said colorspace, and opening it in Vdub, and then looking at the bitrate in the information box.
YV12 is the smallest, RGB32 is the largest.
I think I may be right...
Unless I am totally misunderstanding the YUV numbers and such... ^_^;;
Wilbert
28th December 2004, 17:38
Ex. -YUV 4:2:0 (YV12, MPEG1/2, etc.) The luma is fully sampled, because the eye notices luma differences the most, and thus it is least compressed. U is subsampled, and V is even more so.
No. There's one UV sample per four (2x2) luma samples.
YUV 4:2:2 (YUY2)
One UV sample per two (horizontal) luma samples.
http://www.avisynth.org/Sampling
-YUV 4:1:1 (DV)
One UV smaple per four (horizontal) luma samples.
Yeah, the notation is a bit weird. I don't understand how you can read of the vertical subsampling. More info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/YUVFormats.asp
Poutnik
28th December 2004, 17:46
YUV 4:2:0 : U and V are not sampled differently, but only one of them is coded in a TV line, alternating each other, i.e. one line U, one line V.
Y=+0.299 R + 0.587 G + 0.114 B
U=-0.1687 R - 0.3313 G + 0.5 B
V=+0.5 R - 0.4187 G -0.0813 B
DarkFoon
28th December 2004, 22:12
Thanks for clearing that up Wilbert and Poutnik!
I remember reading about all this a long time ago, I guess time has decayed my memory...
Y=+0.299 R + 0.587 G + 0.114 B
U=-0.1687 R - 0.3313 G + 0.5 B
V=+0.5 R - 0.4187 G -0.0813 B
Poutnik, what is this? The RGB-> YUV conversion table?
Poutnik
28th December 2004, 22:36
Yes, it is. It was related to Wilbert=s note:
"V is the red minus the luma. Highering V will turn your clip to red and lowering it to green (you can check that with ColorYUV(off_v=x))."
DarkFoon
28th December 2004, 23:15
Thanks again!
Now back to the topic:
@Fizick, is there a possibility of a speed increase in the near future with FFT3D? Or perhaps variable block size based upon some parameter M that defines the sensitivity to detail?
Tell us the ideas that you have for your filter. It seems the people here on the forum don't contribute ideas very often, so if you give it a jump-start with your ideas, then we all could comment and derive something, yadda, yadda, yadda...
gst
29th December 2004, 22:50
Or perhaps variable block size based upon some parameter M that defines the sensitivity to detail?
+1
I don't know what blocksize is the best for optimal quality, this M parameter would be a great idea.
DarkFoon
29th December 2004, 23:53
I have done some thinking about variable block size, and I think this 'parameter M' would be better suited to modifying the sigma value than the block size.
Changing block size (making it smaller) really doesn't affect the quality, it just makes the filter more ineffective. A large block size with a small sigma, in my opinion, is better than a smaller block size with a large sigma. And it would appear that the data is on my side: larger blocks remove more noise.
The 'parameter M' would be more useful as this:
a complexity calculator would be run over the block, if the block is a solid color with some noise (the complexity calculator would find this block to be very 'simple'), the sigma value would be raised, according to the value of 'parameter M'
Now, lets say the block is over an eye. The complexity calculator would find this block to be very complex, and would lower the sigma, so it wouldn't blur the delicate details.
A high 'parameter M' would mean that when the filter processes a complex block, it would blur it more, and ignore the fine details more. But a low 'parameter M' would mean that it would not blur complex details.
Ideally, the user could specify just the 'parameter M' and let the filter decide what is complex and what isnt. Or, the user could specify the 'parameter M' and sigma, and sigma would act as a bias to 'parameter M', such that, if sigma is low, then the sigma would not be raised very high even if the block is detected as 'simple'.
And if the sigma is high, then the sigma would be modified to be higher even if the block is detected as complex.
If this doesn't make sense (as I suspect it wont) please message here, and I'll try to explain it better. This is just my rough idea.
Mug Funky
30th December 2004, 08:02
the trick here is how to determine what's visually complex (ie, relating to human perception) rather than complex in frequency. with FFT the most complex you're going to get is white noise. in this case, i think FFT3d will probably pass about half of it through (i'm guessing here, as i can't be bothered generating test videos and running fft3dfilter on them), possibly regardless of the sigma value used.
my understanding is that if there's "spikes" in frequency plus a background that would approach pink or white noise, then sigma determines where to draw the line between the noise floor and the spike (which is assumed to be detail). of course, i too may be wrong.
anyhoo, it strikes me that it would be exceedingly difficult to determine from the FFT that you have a complex object like an eye in the spatial domain.
however, some kind of adaptive sigma is still a good idea. i wonder how it would work? rather like LAME's floating ATH is how i imagine it, where the noise floor is determined per-block, and the threshold (ATH in LAME, or sigma in FFT3dfilter) expresses a desired ratio rather than a constant. this would also mean that no matter the block size, sigma can be kept constant and perform the same (right now larger blocks mean more noise removal for the same value of sigma).
btw, this baby works REALLY well when you motion-compensate it :) i can't wait for MVtools to include overlapped-block motion compensation, so it doesn't throw off FFT3d's groove...
DarkFoon
30th December 2004, 10:42
I imagine the edge detector in Msmooth as the complexity calculator. I mean, what is (fine) detail? Edges! So, perhaps an edge detector could act as a good complexity calculator. Only problem is, it could pick up the noise as edges.. :/
I also remember seeing while using libAVcodec to encode MPEG2, an RC control algorithm called "texture complexity", perhaps there's a complexity calculator that could be taken from there?
I quote these because they are open source, and the source could be used in the filter, I guess.
Your ideas, Mug Funky, intrigue me. I can't say I like or dislike the idea of a ratio. It just... intrigues me. OH!
How I wish I could program so I could test all these things and see if they're any good!
By the way, what do you mean:
this baby works REALLY well when you motion-compensate it :) i can't wait for MVtools to include overlapped-block motion compensation, so it doesn't throw off FFT3d's groove...
How do you motion compensate this filter? Why do you do that? Explain... Tell me your knowledge!
State of Mind
30th December 2004, 14:10
Will someone just go flat out and show some screenshots of their oisy DV footage and the outcome screenshots of this noise remover? I would like at least three examples... :)
Hope this isn't asking too much, plus others would get better idea too.
Mug Funky
30th December 2004, 15:24
@ darkfoon:
motion compensating it means that the temporal component uses frames that are deformed such that they match the current frame as closely as possible. this is useful because it makes it easier to distinguish between noise and signal - the more alike you get 2 frames looking, the more likely any differences will be noise, and can safely be removed.
in my case, i'm using manao's excellent MVtools to motion compensate the previous and next frames, then i'm running fft3d on the result. this helps get rid of the ghosts that you'd possibly get otherwise with smooth video and a high sigma value.
at this point, MVtools isn't ideal for anime, though it does help quite a bit. the only problem is that you want to make sure blocks don't show through. in reality it's quite hard to do this, as it looks like the blocking is small enough or large enough to be ignored by FFT3d.
here's a very alpha function to do this. beware there's no artefact-protection-through-masking that i'd usually put on an experimental denoiser, so blocks can and probably will show up.
also beware that it probably wont give much of a different result from running fft3d on it's own (but it'll be lots slower :))
function fftMC (clip c, int "pel", int "blocksize", float "sigma", int "bw", int "bh", bool "chroma")
{
pel = default(pel,2)
blocksize = default(blocksize,8)
sigma = default(sigma,2.0)
bw = default(bw,16)
bh = default(bh,16)
chroma = default(chroma,false)
vfw = c.mvanalyse(pel=pel, isb=false, blksize=blocksize)
vbw = c.mvanalyse(pel=pel, isb=true, blksize=blocksize)
cro = interleave(c.mvcompensate(vfw),c,c.mvcompensate(vbw))
\.FFT3DFilter(sigma=sigma,bw=bw,bh=bh,plane=0)
\.FFT3DFilter(sigma=sigma,bw=bw,bh=bh,plane=1)
\.FFT3DFilter(sigma=sigma,bw=bw,bh=bh,plane=2).selectevery(3,1)
lum = interleave(c.mvcompensate(vfw),c,c.mvcompensate(vbw))
\.FFT3DFilter(sigma=sigma,bw=bw,bh=bh,plane=0).selectevery(3,1)
(chroma==true)? cro : lum
}
enjoy :)
[edit]
btw, i like your avatar.
DarkFoon
31st December 2004, 08:06
@ State of Mind
Here are those noisy DV samples you wanted.
http://virus-pserver.ath.cx:81/kizawa/FFT3d-examples.png
The "unfiltered" examples have only been deinterlaced: they haven't been converted to YV12 for FFT3D. What I mean when I say "from frame 90" is that, I jumped to frame 90, and then I stepped frame-by-frame to frame 100. I do this whenever I am testing a filter with a temporal component, to give it time to kick in. Here's the script I used:
loadplugin("C:\plugins\kerneldeint140.dll")
loadplugin("C:\plugins\FFT3DFilter.dll")
avisource("capture.avi")
kerneldeint(order=0, threshold=0, twoway=false, sharp=false, map=false)
converttoYV12(interlaced=false)
FFT3dFilter(sigma=2.0, bt=3, plane=0, bh=48, bw=48, measure=false)
FFT3dFilter(sigma=3.0, bt=2, plane=1, bh=48, bw=40, measure=false)
FFT3dFilter(sigma=4.0, bt=2, plane=2, bh=48, bw=40, measure=false)
Note the block width used for the chroma. I remembered at the last moment that the chroma in YV12 has one quarter the pixels of the luma.
So, I had to pick block sizes that divide into 360x240, not 720x480.
Here are the differences:
http://virus-pserver.ath.cx:81/kizawa/FFT3d-differences.png
The script I used there is:
loadplugin("C:\plugins\kerneldeint140.dll")
loadplugin("C:\plugins\FFT3DFilter.dll")
avisource("capture.avi")
kerneldeint(order=0, threshold=0, twoway=false, sharp=false, map=false)
converttoYV12(interlaced=false)
clip1 = last
clip2 = FFT3dFilter(sigma=2.0, bt=3, plane=0, bh=48, bw=48, measure=false).FFT3dFilter(sigma=3.0, bt=2, plane=1, bh=48, bw=40, measure=false).FFT3dFilter(sigma=4.0, bt=2, plane=2, bh=48, bw=40, measure=false)
Subtract(clip1,clip2)
Levels(112,1,144,0,255)
@Mug Funky
so that's what motion compensation does... I never knew. Is DePan better for anime? Or is MVtools better than depan? Or are they incomparable? Thanks for the script function! Though, I probably can't use it, because FFT3D is already so slow on my computer ;)
btw, thanks for the compliment. I like your avatar as well.
[edit]
got my regular host back! now its fast(er)!
State of Mind
31st December 2004, 11:07
Judging from the screenshots, the image gets a bit blurrier after the noise is removed. However, I also realize that is why you guys have Sharpening filters, especially the one with the most hype at the moment (Limited Sharpen), which apparently doesn't get "edgy" when sharpening.
Anyway, the filter looks cool, but I still wonder why blur takes place after noise removal. The image on the bottom which appear to be sky or something, I can see serious noise removal, but not 100%. I guess this is currently impossible as far as software denoisers go, but that's fine. Still a major improvement.
Cheers,
Jeremy
DarkFoon
31st December 2004, 14:22
what you have to understand is that noise makes things look "sharp". Ever used one of those really old sharpening filters in an image editor? The image gets increasingly grainy as you "sharpen" it. As I understand it, this is because the sharpener adds noise strategically (or maybe not) to make the image look for crisp and sharp.
All denoisers make the image look a little blurry( or distort it in some fashion). The reason these look so blurry is because there was quite a bit of noise in the first place, so I have to make the tradeoff between noise removal and image integrity. I have picked noise removal. Besides, these don't look bad if you watch them as a movie, and not as a single frame.
Also, these could look blurry because I am rather new to this filter, and I have not done much experimenting with it because A) my computer is slow, and B) it is going on the fritz so I can't leave it on for long periods of time.
btw, what 'sky' are you talking about in the 'bottom image'?
If you are talking about the two pictures at the very bottom by themselves, they are just showing how much noise was removed for the actual pictures posted above. I used the 'subtract' filter so that I could see how much noise was being removed. As you can see, quite a bit was removed from those two images.
State of Mind
31st December 2004, 16:16
I never really clued in that sharpening filters added noise that way. Interesting. I don't like noise at all and wish I had the proper hardware in between my DVC (Panasonic PV-DV953) and my PC (Pentium 4, 3.0 GHz, 512 DDR 333 MHz PC3200). And I know when watching the actual video would make a user feel a little better about the filtered product overall, but I guess I'm really picky, heh. Anyway, you've done a good job with this filter. I look forward to using it. Hey, wouldn't removing most of the noise make the encoder's job a lot easier? I have read that a lot of noise can through off the accuracy of a codec and make it hard for it to analyze what it's encoding. Have I worded this decently?
Cheers,
Jeremy
708145
31st December 2004, 21:30
Originally posted by State of Mind
I never really clued in that sharpening filters added noise that way. Interesting. I don't like noise at all and wish I had the proper hardware in between my DVC (Panasonic PV-DV953) and my PC (Pentium 4, 3.0 GHz, 512 DDR 333 MHz PC3200). And I know when watching the actual video would make a user feel a little better about the filtered product overall, but I guess I'm really picky, heh. Anyway, you've done a good job with this filter. I look forward to using it. Hey, wouldn't removing most of the noise make the encoder's job a lot easier? I have read that a lot of noise can through off the accuracy of a codec and make it hard for it to analyze what it's encoding. Have I worded this decently?
Cheers,
Jeremy
You're right. It makes a codec's job much easier if it doesn't have to encode the noise!
Regarding the "sharper" impression noise gives: That's why some decoders add noise while playback. The difficult thing about this is to know how much noise to add where!
Some newer codecs (AVC HP) allow to store this info in the video stream. I don't know (yet) how detailed this info is since different scenes and even different parts of a frame need different amount of noise.
<prophecy> 2005 will bring up interesting codecs with this in mind. </prophecy>
bis besser,
T0B1A5
DarkFoon
31st December 2004, 22:25
@State of Mind
A pv-DV953 huh? Isn't that one of their new 3-CCD 'prosumer' models?
anyways, the best way to get rid of noise is to not have it in the first place. Those noisy images were filmed using a digital8 camera I was borrowing, not very high quality. But I used my school's Panasonic PD-150, which has 3 CCD, and uses miniDV, to film another event, and there is no noise! I had to transfer that footage to a digital8 tape so I could import it at home (schools wont let you check out $3000+ equipment) and it still had no noise! So, its not the medium necessarily, but the quality of the CCD(s).
That was a complete tangent, and I'll get back on point.
I know how you feel about denoisers, I'm very picky with my own video (though I usually work on anime, and not DV video). If your work is destined for DVD, or ultimately going to be shown on a TV, you'll be suprised at how good things will look on a TV, even if they look awful on a computer screen. If you want a subtle sharpening effect, without the added noise, or artifacting, trying using lanczos4resize() to upscale the image, then scale it back down with lanzcosresize() and that should add a little sharpening. (lanczos4 is better for upsizing, but feel free to experiment)
Yes, removing noise means the encoder doesnt have to waste data on junk, meaning there is less artifacting when there is a high-motion scene, because it has more bits to work with. (Redundancy...)
if you have time and want to do something fun, take a short test clip, and use sharpen(1.0) on it twice, then encode it with a restrained bitrate like max 4000, average 1200(use whatever encoder you want, but MPEG2 will make the point better). Then take the same source clip, runa denoiser on it instead of sharpen, and encode using the same parameters. Look at the size of the clips, and them look at their quality. You'll see the purpose of noise reduction.
And with that...
Happy new year all!
signing off...
State of Mind
31st December 2004, 23:30
DarkFoon,
Well, the camera does have 3 CCDs and it works pretty well. If the lighting is superb, there won't be any noise at all. But once the light starts dimming, noise starts showing up. I think its best quality is catching the true clarity of color. If it's a bright summer day and Me and my friends are wrestling in a field somewhere in the valley, Im going to see absolutely beautiful image with not a speckle of noise because the lighting would be perfect. I don't have a little attachable light to go with my camcorder and sometimes we shoot stuff at nighttime and I keep stressing that we should be under a street light just so we can be seen. And even then I think to myself "I'm going to have to filter this clip like a son of a b....".
And I am well aware of how much better video is going to look on TV. Hell, I took some clip that was DV > MPEG-2 > DivX > MPEG-2 and was encoded with TMPGEnc, VirtualDub and then TMPGEnc again (this was over a very long period of time that I bothered with this particular clip and before I even knew about AviSynth) and the DivX bitrate was 1500 kbps and when I put it on DVD, I gave it a bitrate of 6000 kbps just to make myself feel better about putting 120 MBs worth of DVD video on a brand new DVD+R and even though the file didn't look so good on my PC, it still looked really good on my TV. So I know that after I get to know my way around AviSynth and the filters and figure out exactly how I want to use them, the resulting image on the TV will be excellent. But I also like to store AVIs of my videos on my external HD and I much prefer XviD over DivX because that way I get sharper looking video at smaller filesize.
Anyway, awaiting new mobo, will enjoy experimenting with filters. But, I need to ask for future usage, what is the default script command for your denoiser filter?
Cheers,
Jeremy
Dreassica
1st January 2005, 22:16
Originally posted by krieger2005
great filter, ass always... and you are right: it's very slow.
To prevent "bluring" of edges with high sigma-values one can use "FineEdges"-Function from "Didée" i guess. Here my try:
function CleanUp(clip c, int "eEnd", int "eStart", int "bw", int "bh", float "sigma", int "sharp", bool "mask"){c
eEnd=default(eEnd,8)
Flaechen" markiert
eStart=default(eStart,68)
bw=default(bw,32)
bh=default(bh,32)
sigma=default(sigma,3.0)
sharp=default(sharp,180)
mask=default(mask,false)
ed=c.FineEdge(16)
SurfaceMask=ed.Levels(eEnd,1,eStart,255,0,false)
ret=mask ? MaskedMerge(c,c.BlankClip(pixel_type="YV12", color=$66FF66),SurfaceMask,Y=3,U=3,V=3,useMMX=true) : NOP()
cleanSurface=c.AddBorders(0,0,bw+20,bh+20).FFT3DFilter(bw=bw, bh=bh, sigma=sigma).crop(0,0,-(bw+20),-(bh+20)).xsharpen(sharp)
ret= (!mask) ? MaskedMerge(c,cleanSurface,SurfaceMask,Y=3,U=3,V=3,useMMX=true) : ret
return ret
}
great job.
Thios script isnt working for me, even after removing the usemmx=true bit. I get missing quotation marks errors. I'd be damned if i knew where it be missing tho.
Fizick
1st January 2005, 23:24
Hi to all!
Thank for ideas and discusions. I see this filter is "hot" :)
My work on this filter are still delayed (but not stopped).
What I want to try in next version(s):
Step 1. Compute 2D "frequency" images of frames
Step 2. Apply some temporal filter.
Step 3. Make inverse transform as output.
The most interesting question is: what is the best temporal filter in step 2.
The answer is: there are many different temporal filters (for ordinary "spatial" clips) , we may use any of them.
If we could use output fft images in Avisynth , we could use any external existent filter (Fluxsmooth, Dust, etc)! But they are not integer but complex float. (may be it we be possible in Avisynt 3.0)
So, I want try internal Kalman filter. BTW, I already have my another Avisynth plugin (not public) with simple Kalman temporal filter, but i do not like its result (point artefactes).
About "mythological" parameter M :)
I think that variable adaptive block sizes in frame is hardly to implement. And i do not realize why it is better than constant block size.
Adaptive sigma is more interesting but what is algo?
Some sharp mask is interesting too. But suppose we have some sharp lines in picture. Sharp mask will prevent any noise reduction on it. But really good filter must denoise (smooth) along that line and do not smooth across the line.
Frequency approach is partially consistant with these.
Motion compensation is of course the right way for any temporal filter. But we need add overlapped blocks to MVTOOLs or create some another plugin with optical flow method for motion estimation-compensation.
All above is IMHO (and not in my native language) (and after some drink) :).
So, discuss and suggest (and please, wait - sorry, I work on other project and moreover i will far from my comp some time right now).
Happy new year!
Leak
2nd January 2005, 00:02
Originally posted by Dreassica
Thios script isnt working for me, even after removing the usemmx=true bit. I get missing quotation marks errors. I'd be damned if i knew where it be missing tho.
Throw out the line
Flaechen" markiert
and probably get rid of the "c" after the "{" in the first line, though this shouldn't be a problem...
np: Autechre - Cichli (Chiastic Slide)
Dreassica
2nd January 2005, 01:50
Now i get a " There is no function named : FineEdge
edit: Looks liek that's one of Didee's own scriptfunction. Doing a search on it didn't yield results though.
State of Mind
2nd January 2005, 09:32
I am curious...if I have a clip that started when it was 3 PM and ended at 6 PM; being bright in the beginning and being dark in the end, if I used the denoiser filter, since it tends to blur after removing the noise (which makes things look sharp) would it blur the entire clip, despite no noise in the beginning while still denoising the darkness in the end? I use way too many commas and long sentences. Am I clear enough?
mikesbytes
2nd January 2005, 12:29
Do you have any instructions for your filter
State of Mind
2nd January 2005, 14:40
Also, do you think you could take the effort to include RGB support?
DarkFoon
3rd January 2005, 06:49
@ State of Mind
Mind you, I am not the programmer (or a programmer at all), i just have a loud mouth. :D Fizick is the real programmer.
Your syntax when talking about denoisers is a little confusing: it doesnt blur after denoising, the denoising is the blurring.
With this denoiser, it would process every frame equally, so the same ammount of denoising would be done in the beginning as well at the end. Peachsmoother, on the other hand, has a metric built in where it determines how much denoising there needs to be done, based on your parameters. So it will not process a scene that has no noise, but it will work on scenes that do have noise. This means you can set a general purpose threshold specific to the input video, and it will fluxuate with the ammount of noise present in the clip. If that's what you are looking for, PeachSmoother is an excellent filter. Get it from WarpEnterprises.
@Fizick
what I meant by the edge finder was that the 'parameter M' would use it to determine the sigma value for the block, not to limit the filter so it doesnt filter the edges. Does that make sense? It would just be used as a metric, not as a part of the filtering process.
Just out of curiosity, can you put motion-compensation into the filter? or does it have to come from an external filter?
Just wondering.
State of Mind
3rd January 2005, 07:39
The denoising IS the blurring...that doesn't sound very efficient to me. Aren't there other ways of denoising or is this a method that all denoisers have derived their operations from? (Wonders if "derived" is the right word.)
I thought noise was more or less excess pixels that were randomly thrown all over certain areas of the frame, depending on the layout of brightness, since the Iris of the camcorder would over-haul brightness in dim areas and therefore compensate by "ape-sh..".
I may sound like I don't know what I am talking about, but I am just recalling things that a friend of mine told me. He works at a TV station and knows what he's talking about, so if something I have said seems off the wall, its because a) I worded it badly, or b) I didn't understand him very well.
DarkFoon
4th January 2005, 07:15
Its not that all denoisers are derived from the blurring, it is just a side-effect inhernt in the system. The noise causes irreparable damage to a picture. The denoiser has to do it's bestt o reconstruct a coherent image while removing the noise. There are several algorithms out there that determine what is/isnt noise and how to remove it. Fast Fourier Transform, is one such method. Wavelet transform, as used in Vague Denoiser, is another. Discrete Cosine Transform, used in MPEG encoding, is also a form of high frequency (noise?) reduction. DCT also happens to be related to FFT.
Because the denoiser doesnt know what the original image is supposed to look like, it has to use metrics and methods to remove what it thinks is noise. No denoiser will ever be as good at denoising as a human being, there will always be blurring, or if not, a little bit of noise left over, because it cannot remove just the noise, and leave just the image intact.
The noise you described is only one kind of noise, and very specific.
There are many types of noise: mosquito, which I believe is random fluxuating pixels over the frame; ringing, this I'm not all that clear on, I believe it is noise that usually hangs around edges; blocks, large blocks (16x16 or 8x8 pixels) that occurs when a shortage of bitrate exists, not to be confused with DCT blocking, which is where the DCT over compresses a a block, compared to its neighbors, and thus a difference is noticed; some others that I haven't encountered....
The type of noise you are describing, the random pixels that are noticeable when the camera automatically increases the gain in dark scenes, is because of the CCD, if I'm not mistaken. The CCD picks up pixels hwne the light hits it, and because some are slightly different when it picks them up, when the gain is increased, they are more noticeable. Or, the camera adds the noise to increase contrast in the dark areas, but I find it difficult to believe that a device would add noise to an image.
Also, noise can be caused by bad TV broadcasting equipment: most of the work I do is with TV captures. Since I have a few line-splitters, and because companies are pushing the new HD stuff and are letting their standard def equipment go, the signal quality is getting worse. So, most of the noise I deal with is mosquito noise, and is similar to the camera noise you are talking about.
State of Mind
4th January 2005, 07:34
Wow...very interesting. Wow. You worded what I was trying to say a hell of a lot better than I was able to. (I have sentence structure problems, lol) Anyway, I try to be as responsible and mature about the video I shoot as possible. But when I get with a bunch of guys whose minds are on a completely different planet (as far as computers and device technical issues go), I can't always assure myself that we are going to end up with the best looking image. The camera I use shoots absolutely beautiful and noiseless footage given it is a bright and sunny day out. But, these guys seem to get inspiration when we are inside and it's late in the evening and I don't have much lighting around the apartment, so noise is always there. I get pissed off when these guys try to tell me its a good idea to record something with minimal lighting. "Dude, this will look awesome!" "No, it will look like sh.. because..." and I want to say all the technical stuff but they will just stand there and blink awkwardly at me and tell me that as long as we can see roughly what's going on, nobody really gives a crap. And I know this is the harsh truth, but if we are going to record something, I want to be able to see it vividly and not be looking through a layer of randomly generated specks all over the screen and have to denoise the crap out of it, blurring what is supposed to be sharp and clear and then have to use sharpening filters (which I actually like to use on normal well lighted scenes sometimes).
Anyway, I guess you learn how to make bad stuff look tolerable and bear with it on occasion. I can't help that I'm a quality-driven freak. :D
Mug Funky
4th January 2005, 16:58
ouch.. shooting in the dark. do what i do:
carry a 500 watt floodlight + diffuser made from greaseproof paper and a coat-hanger + a tripod to attach it all to in the car with you if ever you have an inkling something is going to be shot. even if you just point the naked light at the ceiling, you'll get much more light (and people will look much nicer too from all that soft light coming down from the ceiling).
this way, if your buddies are like "let's film such-and-such in this hella dark room", you can just pop off and grab the light. even if you want the scene to look dark, you can easily do this by deliberately setting the white-balance to give a bluish tint (point at something slightly orange and set the balance), then stop-down the aperture until it's nice and dark. it'll look dark, but still be less noisy and look more professional.
also, bear in mind that if you're making DVDs, you can afford to have a fair bit of noise. try to remove less than you would for a DVD backup-to-xvid. QuEnc, with trellis turned off (it pulses and goes a little blocky with trellis on at this rate, at least on 1-pass), will handle noise nicely at bitrates as low as 3mbps. anything above 4 or 5 is very nice indeed.
[edit]
btw, the cost of that lighting stuff above is about $25, not including the tripod. certainly affordable, and with the diffuser it looks really good. outdoor halogen floodlights are very under-rated. they last longer than photographer's lamps, use less power (for the same rating - it's an inductance thing), and are brighter and less coloured. they're also much cheaper.
State of Mind
4th January 2005, 17:13
Thanks for the tips, Mug Funky. I'll have a look around and see what I can find. This forum rules. :D
I plan on experimenting with QuEnc. I was wondering what Trellis was... Thanks.
I assume you suggested less noise removal for DVDs to retain that "sharp" look it sometimes gives and plus DVDs can hold so much on them whereas an XviD copy of an edited DV source is all about reduced filesize while trying to maintain some high quality. However, noise can poorly affect other filters which try to improve the image (such as sharpeners), right? Well, as every DV source is different, I guess the only way to really see what happens is by doing it. *crawling out of skin waiting for new motherboard!!!*
Mug Funky
4th January 2005, 17:22
trellis basically exploits the difference in (lossless) compressibility between numbers that are rounded up or down. it tries them all and finds the best tradeoff between bits used and quality. however, because "quality" is subjective, it might believe that a block looks better than a slightly ringy gradient. and if the block compresses better that way, it'll consider it worth the risk and round up instead of down, so to speak.
trellis is probably better in 2-pass mode, but i never have enough time.
btw, if you want those lights, check a hardware store. they're black and rectangular with a tube about 10cm long for the globe. sometimes it helps to remove the glass from them if you want to point them downward, or the tube will pop. some come with their own little stand, which is totally cool. hehe... any further questions should be by PM, as it's not really the subject of this thread (sorry, fizick).
State of Mind
4th January 2005, 17:26
I edited my previous post. (Another question about noise).
Ok, I'll PM you from now on, thanks. Sorry to Fizick also, just trying to learn more. :)
Didée
4th January 2005, 17:37
Originally posted by State of Mind
*crawling out of skin waiting for new motherboard!!!*
hihi, LOL! ... (feel with you, State of Mind ;) )
BTW, sharpening without amplifying noise is absolutely possible (within certain bounds).
How? Well, that's the mental exercise :-)
The upcoming LS version will basically do it - but this isn't the thread to discuss that, sorry.
State of Mind
4th January 2005, 17:50
Ok, I like the new sharpening filters because you guys know so much about the technical details with video data and how to manipulate it and they just sound like they can do a good job. :) Will keep an eye on the appropriate threads! :D
DSP8000
6th January 2005, 15:56
Hi,:)
Fizick can you fix the link, for some reason I can't download any of your filters:(
Tnx,
DSP8000
morsa
8th January 2005, 00:07
Fizick,
I'm very concerned about the banding on colors (and I guess on luma) that is left after using this filter (default values).
Is there any way to remove banding using dithering or the like in the fourier space?
thank you.
DarkFoon
8th January 2005, 06:54
@morsa
try using a bigger block size with smaller sigma, that might remove the banding. But I cant really tell, do you think that you could post a picture of the banding?
morsa
8th January 2005, 23:49
I found a quick and rough solution for the color banding:
chroma = bilinearresize(512,288).Lanczos4resize(1024,576).mplayernoise(2,2)
MergeChroma(chroma)
hope this helps
leonid_makarovsky
13th January 2005, 16:41
I'm not sure what I'm doing wrong but this filter FFT3DFilter just wouldn't load. I copied it to C:\Windows directory which is in my path in environment variables. Wouldn't load. Any help will be appreciated. Thanks.
Boulder
13th January 2005, 16:49
You're not supposed to copy the plugin, you should copy the fftw3.dll from the fftw3win32mingw.zip package.
leonid_makarovsky
13th January 2005, 17:05
Originally posted by Boulder
You're not supposed to copy the plugin, you should copy the fftw3.dll from the fftw3win32mingw.zip package.
Yeah, that's what I did. I copied fftw3.dll to C:\Windows directory from this package. Tried to load from there LoadPlugin("C:\Windows\fftw3.dll"). No luck. Or do you mean I should not be using LoadPlugin("C:\Windows\fftw3.dll") at all 'cause it will load by default?
--Leonid
Boulder
13th January 2005, 17:13
Don't try to load the fftw3.dll, load the plugin itself. fftw3.dll is loaded automatically by the plugin when it's called;)
leonid_makarovsky
13th January 2005, 17:31
Originally posted by Boulder
Don't try to load the fftw3.dll, load the plugin itself.
What do you mean load the plugin itself? What is the line of code?
LoadPlugin("what should I put here?");
--Leonid
Boulder
13th January 2005, 18:01
Extract fftw3.dll to C:\Windows\ for example. Then extract Fizick's FFT denoiser plugin dll to Avisynth plugins folder, by default it is C:\Program Files\Avisynth 2.5\plugins\ . After that, you don't need to load it in your script, it is automatically loaded when it is used in the script.
leonid_makarovsky
13th January 2005, 18:15
Originally posted by Boulder
Then extract Fizick's FFT denoiser plugin dll to Avisynth plugins
This is the part I'm missing. Where can I get it and what is it called?
--Leonid
Boulder
13th January 2005, 18:22
As Fizick's signature says, his plugins can be found via the www button in his profile.
Socio
14th January 2005, 00:35
I did a comparison between PixeDust and FFT denoiser I wanted to see how FFT denoiser stacked up against my favorite denoiser, the settings were Pixedust(2) and FFT3DFilter(sigma=3,beta=1). It took Picedust 10 minutes to process 1828 frames; it took FFT3DFilter 18 minutes to do the same. The results look pretty good with the exception that the FFT3DFilter seems to alter the color slightly but you really only notice in still images.
Here are some pics:
Unfiltered TV capture image
http://img146.exs.cx/img146/6484/nonorm1cr.jpg
Pixedust (2)
http://img146.exs.cx/img146/4030/nodust5jf.jpg
FFT3DFilter(sigma=3,beta=1)
http://img146.exs.cx/img146/671/noffw5mc.jpg
Thanks to ImageShack for [URL=http://www.imageshack.us]Free Image Hosting
kingmob
14th January 2005, 19:46
Originally posted by Socio
[B]I did a comparison between PixeDust and FFT denoiser I wanted to see how FFT denoiser stacked up against my favorite denoiser, the settings were Pixedust(2) and FFT3DFilter(sigma=3,beta=1). It took Picedust 10 minutes to process 1828 frames; it took FFT3DFilter 18 minutes to do the same. The results look pretty good with the exception that the FFT3DFilter seems to alter the color slightly but you really only notice in still images.
Here are some pics:
[cut out images]
I find the difference in color amazingly big. It's not something i personally wouldn't care about.
leonid_makarovsky
14th January 2005, 20:43
I think I got it.
I should copy
Download FFT3DFilter version 0.3 to AVISynth/plugin directory.
Then I should copy the library itself to any directory that is in the path, correct?
Also my footage is in Huffyuv which is YUY2 (YUV colorspace). Do I need to convert it to YV12?
--Leonid
Boulder
14th January 2005, 21:29
Originally posted by leonid_makarovsky
I think I got it.
I should copy
Download FFT3DFilter version 0.3 to AVISynth/plugin directory.
Then I should copy the library itself to any directory that is in the path, correct?
Correct. The safest bet if you use WinXP is to put the library in Windows\System32.
Also my footage is in Huffyuv which is YUY2 (YUV colorspace). Do I need to convert it to YV12?
If the filter doesn't support YUY2 (haven't used it myself), then you need to do the conversion.
leonid_makarovsky
14th January 2005, 21:32
Originally posted by Boulder
If the filter doesn't support YUY2 (haven't used it myself), then you need to do the conversion.
If I go from YUY2, do I lose the quality? Although my end result is DVD.
--Leonid
Tenement Funster
14th January 2005, 23:13
Socio, what block dimensions did you use on FFT3DFilter? Also, which color channel(s) did you run it on?
Socio
15th January 2005, 01:03
Originally posted by Tenement Funster
Socio, what block dimensions did you use on FFT3DFilter? Also, which color channel(s) did you run it on?
The only settings I used were FFT3DFilter(sigma=3,beta=1) with YV12 I even tried using Colormatrix after the FFT3Filter to fix the color still came out the same.
Boulder
15th January 2005, 10:34
Originally posted by leonid_makarovsky
If I go from YUY2, do I lose the quality? Although my end result is DVD.
--Leonid
There is always a slight loss when you do a colorspace conversion. If you use QuEnc or NuEnc to encode to MPEG-2, you'll have to convert to YV12 anyway so there would be minimal loss and this would be the ideal case.
With CCE you need to convert back to YUY2 at the end of your script so the loss is much bigger, and TMPGEnc uses RGB24. In these two cases, I would keep it in YUY2 and use filters that don't require converting to YV12.
Fizick
16th January 2005, 01:39
I have some time and now release Version 0.4, 16 January 2005
- algorithm optimized for speed for bt=2 (now default),
- mode bt=3 is temporary disabled,
- changed default bw=bh=32,
- filtered region now centered.
Mug Funky
16th January 2005, 03:12
cool! thanks, fizick.
SirCanealot
16th January 2005, 14:29
Webspace seems to be down again.
And I want the latest version~ *cries*
Socio
16th January 2005, 18:35
Yep it is down I wanted the new version and defreq as well.
Fizick,
Maybe you can mirror your plugs on warpenterprises plugin collection site?
Fizick
17th January 2005, 00:23
It is not my problem.
The problem is free hosting.
But i do not want pay for free soft.
Warpenterprises is not my host. I has not access to it.
Try once more later.
Be patient. :)
krieger2005
17th January 2005, 02:44
Kill your firewall. This can help. When i try to download the files from Fizick's server i get an error-page. After i kill my firewall there are no problems to download something.
------ EDIT:
Ups. I should read before i reply. However, i had such a situation like described above and it helped to kill my firewall (ZoneAlarm)
leonid_makarovsky
20th January 2005, 04:08
I finally got it to work. It looks great. However, can anyone recommend settings to clean up VHS capture. I need both PAL and NTSC. This is what I use so far:
clip = PixieDust(clip)
clip = convertToYV12(clip)
clip = fft3dfilter(clip, sigma = 2)
clip = convertToYUY2(clip)
clip = LimitedSharpen(clip)
Thanks in advance.
--Leonid
Mug Funky
20th January 2005, 05:39
fizick: something i'd like your opinion on...
is there much point in feeding fft3d with motion-compensated frames? i've done a quick hack to do this (using mvtools of course), but i'm wondering if it really makes sense as you're working in the frequency domain, and so spatial corellation may not mean as much as it does with regular temporal smoothers. certainly the results are good, but i'm not sure if it's worth the extra cpu time. i figured you wrote this denoiser, so maybe you've got some insight into it :)
also, the effectiveness of motion-compensation is reduced a little what with bt=3 disabled for now.
Richard Berg
21st January 2005, 08:39
The problem is free hosting.
But i do not want pay for free soft.
Avisynth contributors have always been welcome to host on avisynth.org. Contact me if you need anything.
(That goes for everyone from plugin coders to brave souls who want to try to document IIP ;))
Didée
21st January 2005, 10:17
Broad hint has reached recipient ;) - (oh my ... :rolleyes: )
After all, iiP is documented. One just has to do a little more reading ... /*whistles a melody*/
(And IMO iiP isn't *that* hard to understand. Documenting LS's upcoming bigger brother, that is what's making my hair turn grey ...)
DarkFoon
27th January 2005, 08:11
Since this thread has been dead for a few weeks now, I have come to post some ideas and try to stir the ashes.
Here are some conversation starting ideas:
1) adaptive/variable sigma value. Is it possible? How could it be done? pros/cons?
2) other colorspace support?
3) other (faster?) temporal algorithms? I'm not all that keen here, but maybe somebody who is will post.
4) Built-in FFT so FFTW.dll doesn't need to be downloaded too.
5) Assembly optimizations?
6) A "preview" mode, like in Vague denoiser or MSmooth?
7) A different type of fourier transform?
Well, that's all I can think of. C'mon people, lets get to brainstorming!
TheUnforgiven
27th January 2005, 19:46
just wanted to say that i tried ihis filter on a vhs capture and i liked the look and the size saving alot.
i would use it almost always on these sources if the filter speed significantly improved.
leonid_makarovsky
27th January 2005, 20:16
Originally posted by TheUnforgiven
just wanted to say that i tried ihis filter on a vhs capture and i liked the look and the size saving alot.
i would use it almost always on these sources if the filter speed significantly improved.
What settings did you use?
--Leonid
TheUnforgiven
27th January 2005, 20:30
i started with those settings suggested by DarkFoon
fft3dfilter(sigma=2.0, plane=0, bt=2, bh=48, bw=48, measure=false) #<- Y plane
fft3dfilter(sigma=3.0, plane=1, bt=2, bh=48, bw=48, measure=false) #<- U plane
fft3dfilter(sigma=4.0, plane=2, bt=2, bh=48, bw=48, measure=false) #<- V plane
Fizick
27th January 2005, 20:33
My some quick comments to DarkFoon's questions.
1) no comments yet :)
2) I have a plan to add YUY2 soon.
3) faster temporal? Can anybody post speed test results for last version with bt=1 and bt=2?
I have a plan to add Kalman temporal filter, but some parameter is still not clear for me.
4) FFTW is fastest fft availiable free, and for most general sizes.
5) some code parts may be optimized, for example for Athlon 3Dnow float,
but i checked time: if i disable non-fft code parts, the speed increasing is about 30% only.
You must understand, that using of overlapped blocks doubles the frame width and height.
So the filter must be slow.
6) what do you want see in preview? FFT spectrum? normalized? real, imagine or amplitude? on big frame for all overlapped blocks?
7) recently i understood, that FFT3Dfilter in 2D mode (bt=1) for bw=8, bh=8 is quite similar to DCT filter by Tom Barry http://forum.doom9.org/showthread.php?threadid=38539
I do not think that this thread has been dead a few weeks.
But i am a little wonder, why anybody not post speed test results for last version.
Once more question to all:
8) Is old mode bt=3 is better than bt=2 (not speed but quality)?
Fizick
27th January 2005, 23:09
BTW, I release version 0.5 (added YUY2 support).
Not tested, of course ;)
DarkFoon
28th January 2005, 00:16
@TheUnforgiven
I found a rather large deficiency in the settings that I suggested, which you are using. If you set your script up so that the filtered is subtracted from the unfiltered, you'll see that the right 24 pixels are unfiltered. That's because I forgot that YV12 has chroma that is 1/2 height and width. I fixed it with these settings:FFT3dFilter(sigma=2.0, plane=0, bt=2, bh=40 ,bw=40, measure=false)
FFT3dFilter(sigma=3.0, plane=1, bt=2, bh=40 ,bw=40, measure=false)
FFT3dFilter(sigma=3.0, plane=2, bt=2, bh=40 ,bw=40, measure=false)
I use this while working on 720x480 video (which is the only resolution I work at) and its spectacular. If only there were some way to make it go faster... (Unfortunately, it will be slower in YUY2 mode than YV12, because there will be more pixels)
@Fizick
About the preview mode, I haven't the faintest idea what most of those mean. I do know one thing I can answer: the last part, why not have it show basically the output frame, only the noise that it removed is made obvious. That's what I was thinking of, a way to see how much detail is lost. So the user could fine-tune the sigma value to remove just the noise. I know I could just use my eyes, but sometimes its hard, and this could help the process along.
By the way, what does the 'measure' option do? I know its on the website, but that description makes no sense to me. Can you explain it in better detail?
Fizick
29th January 2005, 01:03
About MEASURE (cited from nice pdf FFTW manual - read more there!)
FFTW_MEASURE
instructs FFTW to run and measure the execution time of several FFTs in order to find the
best way to compute the transform of size n. This process takes some time (usually a few
seconds), depending on your machine and on the size of the transform. FFTW_ESTIMATE,
on the contrary, does not run any computation and just builds a reasonable plan that is
probably sub-optimal. In short, if your program performs many transforms of the same size
and initialization time is not important, use FFTW_MEASURE; otherwise use the estimate.
More news.
I release new version 0.6 with simple (?) Kalman temporal optimal recursive filter.
DarkFoon
30th January 2005, 23:12
@Fizick
thanks for the explanation! In light of what you said in the explanation, perhaps measure should be set to =true by default?
I gave kalman a try a few days ago, its a little picky, but it can remove *HUGE* ammounts of noise, with very small numbers. For example, I had sigma=1, ratio=1.25, bh/bw=40, and it removed tons of noise! (My settings above leave no artifacting (ghosting) on 100% scene changes.)
As for the preview mode, what about FFT Spectrum in amplitude? All I really want is something that I can use to help fine-tune my sigma/ratio value.
Keep up the good work!
Fizick
30th January 2005, 23:49
Measure=true results in some start delay, so i do not want set it as default.
Yes, Kalman can remove noise :)
I will think about some preview later. But overlapped frame is large, and complex (real + imagine part).
rigth now i release a new version 0.7 with bt=3 re-enabled.
And I still wait speed test data.
Socio
31st January 2005, 14:56
I have not been able to access Fizick"s site in several days to get the latest version, is it just me or has anyone else been able access the site?
Mug Funky
31st January 2005, 18:09
i think it's just you :(
just got the new version. thanks, fizick :)
Socio
31st January 2005, 21:15
Originally posted by Mug Funky
i think it's just you :(
just got the new version. thanks, fizick :)
Hmm?
Maybe my ISP does not like his site all though I have been able to access it in the past.
Boulder
31st January 2005, 21:53
If you have a proxy configured in your browser's options, try disabling it, or adjust it so that fizick's site isn't accessed via the proxy.
Socio
1st February 2005, 15:49
Do not have a proxy, I even shut down my firewall and tried to connect and still can't. Hopefully someone will mirror his stuff elswhere some day soon.
Boulder
1st February 2005, 17:08
What about accessing via proxy (if your ISP has one you can use) ? It would definitely be the best solution if they were mirrored on avisynth.org though;)
DarkFoon
4th February 2005, 04:39
I'd have posted a speed test by now, if it weren't that my power supply is about ready to die, and I'm afraid to leave my computer on for long periods of time unattended.
From what I have experienced, Kalman feels a littler slower, depending on scene complexity. If I'm wrong, don't blame me: I calls 'em like I sees 'em.
Fizick, what do you use to program this filter?
Fizick
4th February 2005, 21:10
I used my hands and PC keyboard (mouse sometimes) :)
krieger2005
4th February 2005, 22:05
I guess it was Microsoft Visual C++ 6.0? But could be also some of the other c-compiler.
Fizick
5th February 2005, 02:09
BTW, I release Version 0.8, 05 February 2005 - added experimental sharpening option and bt=-1
(2 in 1) ;)
Backwoods
5th February 2005, 11:47
Your site seems to be down.
SirCanealot
5th February 2005, 12:05
Yo, all.
I've been using FFT3D for a while, and it's a great filter, but I'm having a kicker of a problem with it now...
All of the settings are somewhat complicated and unexplained, so I'm not sure what buttons to press :P *kicks Fizick*
http://www.williams1.homechoice.co.uk/JinkiEp2(Original).png
http://www.williams1.homechoice.co.uk/JinkiEp2(FFTProcesed).png
I think my problem is most obvious when comparing filesizes - the processed one is 150kb bigger!
Basically, FFT is cleaning up the crap on the image, but it's adding some weird grain-like effect to the image. It doesn't do this all the time, so I'm somewhat confused as to why it's doing it.
I'm using slightly tweaked settings of someone else who posted theirs back in the thread:
FFT3dFilter(sigma=2.0, plane=0, bt=3, bh=32 ,bw=32, measure=false)
FFT3dFilter(sigma=3.0, plane=1, bt=3, bh=32 ,bw=32, measure=false)
FFT3dFilter(sigma=3.0, plane=2, bt=3, bh=32 ,bw=32, measure=false)
I've tried messing around with all the settings you see there; but the only thing that seems to stop the effect is putting bh/bw to "4". This completely gets rid of the effect, but FFT hardly denoises at all then!
I've tried twaking the sigma, bt value, turning measure on and off. I don't know what to do, bleh~ :(
My source is 1024x576. Is it something like I need to use specific bh/bw settings for each res? I've never really understood bh/bw ^^
By the by, Fizick, are you interested in putting FFT on my webspace? It's a pain that your site is always down, and people can't get the latest version goodness :P
You'd probably need to create a tiny website for me (I don't know the first thing about website creation even if it's been on my 'to do' list for years), since linking to stuff like I've done above doesn't seem to work very well for anything other than pictures. Either that or people will need to dive into the depths of all the crap on the root folder :P
Anyway, thanks for any help, all.
Fizick
5th February 2005, 18:48
SirCanealot,
Any denoiser produce some artifacts to image.
There are no restoration without some cost (blurring, ghosting, etc)
Do your understand that this plugin is:
1.Free :)
2.Experimental :)
Thanks for your analisis and report! It is what i want get from people. (otherwise i simply would not public my plugins)
Do you read the Kokaram paper (link in first message) ?
Yes, it is hard, but is useful.
Every frame is divided by blocks. Its width is bw, its weight is bh (in pixels). Every block is processed almost independetly
(it is reaaly not true becouse of overlapping, but it must simplify understanding).
Thanks for hosting suggestion, but I do not have a time for web-programming too. (but I will try solve this problem soon).
Boulder,
why you do not send the downloaded file to Socio ? :)
Boulder
5th February 2005, 19:02
Hmm, I assumed he got them since he didn't ask anybody to send them to him. Nevertheless, I put the latest version on my webspace.
http://www.saunalahti.fi/sam08/fft3dfilter08.zip
http://www.saunalahti.fi/sam08/fftw3win32mingw.zip
Fizick
5th February 2005, 20:23
Boulder,
it was my almost joke, but thanks anyway. :)
DarkFoon
6th February 2005, 00:04
@SirCanealot
Your source image looks good enough that you don't need to denoise it (meaning that the noise there is negligible). Unless its more noticeable when it is playing.
I do see the artifacting that FFT3D adds back into the image... (I also like the slight blurring it gives to the edges) very strange...
If I were in your situation, I'd use
FFT3dFilter(sigma=2.0, plane=0, bt=0, bh=64 ,bw=64, ratio=1.25-2, measure=true)
FFT3dFilter(sigma=3.0, plane=1, bt=0, bh=32 ,bw=32, ratio=1.25-2, measure=true)
FFT3dFilter(sigma=3.0, plane=2, bt=0, bh=32 ,bw=32, ratio=1.25-2, measure=true)
The Kalman seems to do a very good job (i haven't used it much though, computer problems...) Note: make sure to set the ratio value, the ones I have given are just what have worked for me.
FYI: 'ratio' controls the "scenechange threshold" essentially for kalman, it determines how much weight change is given. A great way to see this, is by opening your script in vdub, frame-advancing about 10 frames that have no motion[it is important that these frames are NOT solid black], and then using CTRL+G to go to some other part of the video that is completely different. If you see a ghost over top the new frame, lower the ratio. Repeat and keep lowering the ratio value until you see no ghosting or it is faint emough that it doesnt matter.
http://virus-pserver.ath.cx:81/kizawa/example.png
An extreme example with ratio=80 after ~15 frames
If you think kalman looks bad, use bt=2. I have achieved superior results with that one (when my computer still worked, I used that everytime)
You might also lower the sigma values. The noise in the original image is so small, that a sigma value greater than 2 might be too much. Let me know how it all works out for you.
Another FYI: Measure=true means that the filter gets time to find the best FFT to use. It is a speed increase, essentially. But it takes a few extra seconds on load. (negligible, in my opinion)
@Fizick
I am not quite understanding what "overlapped blocks" means. Is it explained in that manual on the very first post?
Also, what program opens up a .ps file?
Thanks!
State of Mind
6th February 2005, 05:53
SirCanealot, you know...from normal viewing distance, those two screenshots don't look different at all.
Boulder
6th February 2005, 11:13
Originally posted by Fizick
Boulder,
it was my almost joke, but thanks anyway. :)
I should have added the :p to the end of my post but forgot it..
Anyway, if there's any other filter that people are asking for but can't get for some reason, just let me know and I'll put it there as well.
Yuri
6th February 2005, 11:26
Fizick
Thank you for another great filter.
I personally liked the new sharpening feature very MUCH, unfortunately, when it's on, it produces thin horizontal line at the top and at the bottom. How could one get rid of this?
the script:
-------------------------
Mpeg2Source("film-film-film.d2v")
crop(12,0,-16,-4,align=true)
RemoveDirt()
DeGrainMedian(limitY=5,limitUV=10,mode=2)
Tweak(hue=0.0,sat=1.3,bright=0.0,cont=1.00)
FFT3DFilter(sigma=1.5,bt=2,sharpen=0.9)
LimitedSharpen(Lmode=2)
unfilter(70,0)
------------------------
Boulder
6th February 2005, 12:21
Did you try moving the filter before cropping?
Fizick
6th February 2005, 12:53
SirCanealot,
State of Mind is right, your clip need in more sharpening but not in strong denoising.
So, try
FFT3dFilter(sigma=2, plane=0, bt=3, ratio=2, sharpen=0.6)
DarkFoon,
About overlapped blocks.
Consider horizontal dimension only for simplity
(same for vertical).
Every frame image block has width=bw.
But step between blocks (used for FFT) is half value (bw/2).
So, neighbors blocks are overlapped by bw/2 in this filter.
More correctly, every block (used for FFT) is not simple copy of frame image pixels, but formed with some window weight. This weight is a some function (cosine), weight=1 at block center and =0.5 at block border. So, the summmary weight of two neighbors block is =1 for all pixels (both at center and at border, and at any intermediate points).
All these blocks are tranformed by FFT, then spectrum are filtered. Then we do reverse FFT for every block. At last we do summation of all blocks, use the same window weights for overlaped parts, to produce output frame image.
(anybody understand my bad English ?)
Why use overlapping? - To prevent blockiness at block borders. The cost is huge speed decreasing.
This method is well known to some peoples :),
I hope Manao one day implement it in MVTOOLS. ;)
DarkFoon and all advanced users,
About *.ps files format (paper link in my very first post). It is postscript. But firstly you mus decompress GZ acrive by WinRar etc.
Use free GSview with Ghostscript to open *.PS files.
(there are many links in Google search to download)
Hint: You may convert PS file to PDF format by GSView (use menu File->Convert->pdfwrite device) and then use Acrobat reader.
BTW, There are many interesting papers (and example images from his book)about film restoration at Kokaram site
http://www.mee.tcd.ie/~ack/
BTW, there are many papers with some more advanced algorithms presented, with comparing of its results with old (1993) FFT3D filter :)
Yuri,
I know about this lines at first block border,
but do not know how to remove it yet.
BTW, IMHO you use to many denoisers and sharpeners in your script...
SirCanealot
6th February 2005, 14:28
Right~ I've done some more mucking around, finally...
First, to address...
I fully understand this filter is free and experimental. But that's exactly why I'm posting: in case you're not aware of this problem, and in an attempt to fix it/work around it, since I really like this filter :D
Your source image looks good enough that you don't need to denoise it
The source is actually CQ Quant 3 XVid, so there's a fair ammount of noise to get rid of.
Actually, that's why I was basically trying to use FFT (and some other very light filters) - it's removing the light noise in the encode while keeping the detail ^^
Especially since I'm recompressing it, I need to remove the noise as best I can...
State of Mind is right, your clip need in more sharpening but not in strong denoising.
So, try
FFT3dFilter(sigma=2, plane=0, bt=3, ratio=2, sharpen=0.6)
Okay, now this gets annoying/interesting :P
I've actually got some sharpening going (see below), so I'm not really interested in FFT's sharpening (this time!; the problem with the white lines is a bit of a problem right now, but it does look interesting).
However, for the sake of argument, I tried the above settings.
Err, the artifacting is GONE when a sharpen setting of 0.6 is used :/
When a sharpen setting of 0.1 is used, it's still there, just somewhat reduced.
This is VERY odd :/
Bug~?
Anyway... let's spam some more screenshots and you can see what I'm beating my brain over now ^^
Edit: Why are ALL forums right now NOT pasting my screenshots correctly!? It worked a while back 0_o
http://www.williams1.homechoice.co.uk/JinkiEp2%5b22740%5d(Raw).png
http://www.williams1.homechoice.co.uk/JinkiEp2%5b22740%5d(FFT).png
http://www.williams1.homechoice.co.uk/JinkiEp2%5b22740%5d(FFT+others).png
These are with the settings DarkFoon posted, which seemed to work quite well. Except I'm using bt=2 and ratio=0.75 (seemed to work best).
Others is me tuning up Deen which seems to smooth over the artifacting somewhat ^^
http://www.williams1.homechoice.co.uk/JinkiEp2%5b22740%5dFFT0.6).png
http://www.williams1.homechoice.co.uk/JinkiEp2%5b22740%5d(FFT0.1).png
See? 0.6: NO~ arifacts (but the white line problem). 0.1: reduced artifacts (check it against the original raw).
http://www.williams1.homechoice.co.uk/JinkiEp2%5b22740%5d(Finished).png
And this is (currently) what the finished filtering will look like.
A bit later (too hungry now :P) I'll try turning on the internal sharpening slightly with the settings Darkfoon posted (they're denoising better anyway), but this is very odd.
IS it a bug... or is it something else?
SirCanealot, you know...from normal viewing distance, those two screenshots don't look different at all.
Remember these are screenshots... noise looks like... 10x as bad in motion :P
And remember you need to zoom to your desktop res too... which is 1280x960 here ^^
Did you try moving the filter before cropping?
And if that's addressed at me: I ain't cropping; this isn't a DVD source :P
Fizick
6th February 2005, 21:19
I release version 0.8.1, 6 February 2005 - skip sharpening of the lowest frequencies to prevent parasitic lines near borders.
Soulhunter
6th February 2005, 22:28
#####################################################################################
# Source: Gladiator PAL/R2 - Chapter 19 - 1000 frames
# Result: FFV1
# System: Athlon XP2800+
# FFT3D : V.0.8
#####################################################################################
# 001
# No Filtering
# Time: 0:49 / Size: 143MB
# http://img154.exs.cx/img154/4661/0019il.png
#####################################################################################
# 002
# FFT3dFilter(sigma=1.0, plane=0, bt=3, bh=32 ,bw=32, measure=false)
# Time: 4:54 / Size: 137MB
# http://img85.exs.cx/img85/7259/0026xt.png
#####################################################################################
# 003
# FFT3dFilter(sigma=2.0, plane=0, bt=3, bh=32 ,bw=32, measure=false)
# Time: 4:52 / Size: 129MB
# http://img128.exs.cx/img128/395/0034hz.png
#####################################################################################
# 004
# FFT3dFilter(sigma=3.0, plane=0, bt=3, bh=32 ,bw=32, measure=false)
# Time: 4:48 / Size: 125MB
# http://img112.exs.cx/img112/9279/0045iv.png
#####################################################################################
# 005
# FFT3dFilter(sigma=1.0, plane=0, bt=3, bh=16 ,bw=16, measure=false)
# Time: 4:12 / Size: 140MB
# http://img81.exs.cx/img81/7068/0057cf.png
#####################################################################################
# 006
# FFT3dFilter(sigma=2.0, plane=0, bt=3, bh=16 ,bw=16, measure=false)
# Time: 4:13 / Size: 132MB
# http://img156.exs.cx/img156/2201/0067ez.png
#####################################################################################
# 007
# FFT3dFilter(sigma=3.0, plane=0, bt=3, bh=16 ,bw=16, measure=false)
# Time: 4:07 / Size: 129MB
# http://img82.exs.cx/img82/8642/0073ub.png
#####################################################################################
# 008
# FFT3dFilter(sigma=1.0, plane=0, bt=0, bh=16 ,bw=16, measure=false)
# Time: 5:24 / Size: 142MB
# http://img158.exs.cx/img158/1033/0081qe.png
#####################################################################################
# 009
# FFT3dFilter(sigma=2.0, plane=0, bt=0, bh=16 ,bw=16, measure=false)
# Time: 5:25 / Size: 138MB
# http://img125.exs.cx/img125/3852/0098vn.png
#####################################################################################
# 010
# FFT3dFilter(sigma=3.0, plane=0, bt=0, bh=16 ,bw=16, measure=false)
# Time: 5:27 / Size: 134MB
# http://img100.exs.cx/img100/4333/0106nu.png
#####################################################################################
# 011
# FFT3dFilter(sigma=1.0, plane=0, bt=3, bh=16 ,bw=16, measure=true)
# Time: 4:05 / Size: 140MB
# http://img200.exs.cx/img200/7541/0114qs.png
#####################################################################################
# 012
# FFT3dFilter(sigma=2.0, plane=0, bt=3, bh=16 ,bw=16, measure=true)
# Time: 4:04 / Size: 132MB
# http://img164.exs.cx/img164/6030/0127zg.png
#####################################################################################
# 013
# FFT3dFilter(sigma=3.0, plane=0, bt=3, bh=16 ,bw=16, measure=true)
# Time: 4:00 / Size: 129MB
# http://img95.exs.cx/img95/3737/0131fr.png
#####################################################################################
# 014
# FFT3dFilter(sigma=1.0, plane=0, bt=3, bh=16 ,bw=16, measure=false, sharpen=0.5)
# Time: 4:29 / Size: 140MB
# http://img95.exs.cx/img95/5532/0145zp.png
#####################################################################################
# 015
# FFT3dFilter(sigma=2.0, plane=0, bt=3, bh=16 ,bw=16, measure=false, sharpen=0.5)
# Time: 4:27 / Size: 133MB
# http://img99.exs.cx/img99/6766/0150bp.png
#####################################################################################
# 016
# FFT3dFilter(sigma=3.0, plane=0, bt=3, bh=16 ,bw=16, measure=false, sharpen=0.5)
# Time: 4:26 / Size: 132MB
# http://img103.exs.cx/img103/4134/0166ne.png
#####################################################################################
# 017
# FFT3dFilter(sigma=1.0, plane=0, bt=-1, bh=16 ,bw=16, measure=false, sharpen=0.5)
# Time: 3:10 / Size: 151MB
# http://img40.exs.cx/img40/7020/0172rj.png
#####################################################################################
# 018
# FFT3dFilter(sigma=1.0, plane=0, bt=-1, bh=16 ,bw=16, measure=false, sharpen=1.0)
# Time: 3:11 / Size: 157MB
# http://img106.exs.cx/img106/1716/0188gh.png
#####################################################################################
# 019
# FFT3dFilter(sigma=1.0, plane=0, bt=-1, bh=32 ,bw=32, measure=false, sharpen=1.0)
# Time: 4:01 / Size: 157MB
# http://img24.exs.cx/img24/2587/0190kv.png
#####################################################################################
DarkFoon
6th February 2005, 22:35
@SirCanealot
Your finished product looks spectacular: it's sharp, and clean. But there is this one type of noise I saw in the girl's hair. It's this wierd discoloration, but I know how to remove it. Ever heard of a filter called MSmooth? You can find it on http://neuron2.net under 'Mine'. With a situation like yours (which I have been in myself) just set the threshold really low, so as not to destroy your lines, and then raise the strength to high values(not too high, or you get a wierd "graying"). I usually use Msmooth after FFT3D to make the color homogeneous, or to fix gradients. A sample script:
msmooth(threshold=3, strength=5, mask=false)
Make sure to tweak the threshold with the mask feature, it really helps!
'Ratio' only has an effect if bt=0. (But how does sharpen work for you if it has to have bt=-1? hmmmm...)
I bet you used lanczos(4?) to resize... It looks very sharp.
Anyways, these are my two cents on the matter. If you want your source to look good after encoding, *sigh* (I know I'm going to catch hell for this...) you might give the WM9 codec a try. Unfortunately, I have never gotten good results with Xvid, except with high bitrate. WM9 has compressed 1.5GB Mpgs down to ~150MB (audio+video) with acceptable degredation. (If it were something I really cared about, I'd use a higher bitrate) I use Nic's WM9Enc to encode WM9, I'd recommend that you give it a try.
@Fizick
Two questions:
1) does 'ratio' have any effect if bt= does NOT equal 0?
2) does 'sharpen=' have any effect if bt= does NOT equal -1?
These relate to the above stuff, and if I am wrong in what I said above, SirCanealot, listen to what Fizick has to say.
Also, is there a way that you could make it so the user could turn off overlapped blocks, for speed increase? (And to satisfy my curiosity ;) ) I wonder if it is still worth it even with really low sigma values...
Anyways, good luck to all!
Fizick
6th February 2005, 23:40
Soulhunter,
thanks, but do you have some comments?
Fizick
6th February 2005, 23:51
1) does 'ratio' have any effect if bt= does NOT equal 0?
"this ratio also defines threshold noise value at sharpening stage."
does 'sharpen=' have any effect if bt= does NOT equal -1?
Yes, for all modes.
bt=-1 is "pure" sharpen.
Also, is there a way that you could make it so the user could turn off overlapped blocks, for speed increase?
I do not tryed make such mode...
No, i do not want make bad filter :)
And to satisfy my curiosity ) I wonder if it is still worth it even with really low sigma values...
I am afraid SirCanealot will see artefactes (blockiness) even with really low sigma values and will want kick me again :D
Soulhunter
7th February 2005, 00:13
Originally posted by Fizick
Soulhunter,
thanks, but do you have some comments?
General stuff...
- BH/BW = 32 gives imo better results than BH/BW = 16
- Sharpening @ BH/BW = 16 produced artefacts
- High sigma values producing artefacts
My opinion...
- Blending FFT3D with DeGrainMedian gives fantastic results
- BH/BW = 32 is minimum value I would use
- This filter rockz... ^^
Requests...
- A "auto add boarders" function to match the blocksize
- Could you explain how the sharpening works?
- A "show me the difference" function
- Maybe add some presets... :\
Bye
SirCanealot
7th February 2005, 00:24
Originally posted by Fizick
I am afraid SirCanealot will see artefactes (blockiness) even with really low sigma values and will want kick me again :D
Well, why do the artifacts go away when I turn sharpening on?
That says bug to me, so...
I don't want to kick you, I just want to get yo shit working as well as possible :P
Your finished product looks spectacular: it's sharp, and clean. But there is this one type of noise I saw in the girl's hair. It's this wierd discoloration, but I know how to remove it.
Do you mean that fact that it's discoloured over the raw?
That's because I opened the raw in VirtualDub (not through AVS), and the rest of them were through AVS. If I know rightly, that discolouration won't get through into the final encode. I meant to open the raw in AVS, but I guess I couldn't be bothered :P
Or are you talking about something else? Maybe I should see how MSmooth combats the artifacts anyway, though I've never had much luck with MSmooth before :/
And yes, it was Lanczos4Resize, heh.
A Lanczos4Resize down from the 1024x576 source that is ^^
Downscalling like that basically stopped pasteling too.
Anyways, these are my two cents on the matter. If you want your source to look good after encoding, *sigh* (I know I'm going to catch hell for this...) you might give the WM9 codec a try.
XVid encodes that epiosde to 190 megs at Quant 2/Quant 3 B-Frames *shrugs*
No thanks to FFT, though I do wonder how much filesize is damaged because of the bug-artifacts :P
And, yes, die for suggesting WMV9 enccoding :P
DarkFoon
7th February 2005, 19:19
http://virus-pserver.ath.cx:81/kizawa/noise-demo.png
This is the wierd discoloration I was talking about. (And this image is the one in your post called 'finished.png' so I assume this is what is going to the encoder...)
Though, even if it was caused by opening raw in VDub, you should still give Msmooth a whirl; in my experience, it plays very nicely with FFT3D. :)
What destination medium is this encode going to? HDD, DVD, S/VCD? Just curious...
And, yes, die for suggesting WMV9 enccoding :P
In regards to that: I calls 'em like I sees 'em. I have been very pleased with the results I have achieved with WMV9 (Especially the 2-pass VCM codec). Xvid has often let me down in terms of quality, and also filesize. :( (As in the quality will disappoint and the filesize will be very large). Maybe I'll give it a whirl again too, as soon as I fix my $!#@*&% computer!!! :angry:
Anyways, what settings do you use for your Xvid encodes? (Please be very specific).
Good luck!
[OT]
What anime is this?
SirCanealot
7th February 2005, 20:51
Originally posted by DarkFoon
This is the wierd discoloration I was talking about. (And this image is the one in your post called 'finished.png' so I assume this is what is going to the encoder...)
That's what FFT is causing, and that's what I'm trying to fix ^^
And I basically use the defaults; but cartoon mode on, quants set to 2-31, trellis (or whatever it's called) on, H.263 Matrix, and B-Frames quantiser ratio set to 1.0. Don't use anything like GMC, QPel or anything.
And the destination medium is .avi...
And make sure you turn WMV9's autosmoothing off :D
Fizick
7th February 2005, 21:01
DarkFoon,
BTW now I think about you suggestion to remove overlapping.
But really I want not remove, but decrease the overlapping,
for example fix it to 8 pixels (may be variable parameter).
I may decrease the blocks number (for not very small block sizes) and increase speed with factor about 2 to 3.
But some work is needed (and time).
tsp
7th February 2005, 21:57
isn't the windowfunction(overlap) necesary to minimize leakage(from one frequency to the adjoining frequencies) when determing the power spectral density?
Also I'm trying to recreate the filter using the GPU instead of the CPU this should hopefull lead to some speed improvememt(fast parrallel floating point math and high bandwith). At the moment the FFT part is nearly done. So maybe in a week or two it's done.
DarkFoon
7th February 2005, 22:12
@SirCanealot
Well, if that is what FFT is creating, just use Msmooth to remove it (Msmooth is really good at removing that type of artifacting) and quit bitching. ;) It's probably some inherent problem with FFT or weiner or Kalman, or temporal in general (I've seen the same thing with other temporal filters...)
Msmoother at work... (http://virus-pserver.ath.cx:81/kizawa/msmoothed.tif) (Stupid IE wants to download it, instead of displaying it... :angry: (The green circle is there to draw your attention to the smoother and better-looking gradient... By the way, it's 32-bit)
By the way, the script for that was:
converttoRGB32()
msmooth(threshold=10, strength=5, mask=false)
All I know, is that Msmooth is really good at removing that kind of noise on anime. (I don't like Msmooth for live source at all, I use FFT exclusively in that case). Actually on anime, before I used FFT, I would use msmooth to remove most of the spatial noise, and Peachsmoother after it to make it all uniform along the time axis. But all this was back when my computer wasn't about to die :angry:
I haven't done much encoding since...
What is autosmoothing? I have never seen it anywhere in WMV9. Are you talking about the slider that has smoothness on one end, and sharpness on the other? I always set that one to sharp. ;)
BTW, you still haven't answered my question, what anime is that? :)
@Fizick
It will be interesting to see how it looks, and how fast it becomes. Overlapped blocks do make it look good, but when the sigma is really, REALLY high (I did this for fun) I get this wierd grid look. I suppose that is true even with overlapped blocks completely off...
Also, this means that you may be able to implement a 'show me the differences' mode more easily! YAY!
EDIT:
@tsp
GO you! I can wait to explode my Geforce2 MX400! I think it will be interesting to see how it uses the GPU...
krieger2005
7th February 2005, 23:10
Originally posted by DarkFoon
@SirCanealot
Overlapped blocks do make it look good, but when the sigma is really, REALLY high (I did this for fun) I get this wierd grid look.
The Grid-Problem is, so long i read, a general problem of the FFT-Transformation. I don't read enought to say, if it can be removed or not, but i think not.
morsa
8th February 2005, 01:05
The removal of this grid won't be the same algo used for block removal of Xvid block artifacts or the like?
Like using Blind PP or simillar?
Yuri
8th February 2005, 01:10
FIZICK
BTW, IMHO you use to many denoisers and sharpeners in your script...
-------------------------
yep, I like 'em VERY SHARP :)
THANK YOU FOR THE FILTER UPGRADE
TheUnforgiven
8th February 2005, 10:32
Test:
FF3dFilter v0.8
Machine:
P4 3.2 Prescott 512Ram
Source:
Matrix Reload Med Quality 480x260 3625Frames(151secs) Progressive(24)
http://progressive.warnerbros.com/thematrix/us/med/trailer_final_480_dl.zip
NoFilter.AVS:
avisource("src.avi") #huffyuv
crop(0,2,-0,-2)
Filter.AVS:
avisource("src.avi")
crop(0,2,-0,-2)
FFT3dFilter(sigma=2.0, plane=0, bt=2, bh=32 ,bw=32, measure=true)
FFT3dFilter(sigma=3.0, plane=1, bt=2, bh=32 ,bw=32, measure=true)
FFT3dFilter(sigma=3.0, plane=2, bt=2, bh=32 ,bw=32, measure=true)
FilterMore.AVS:
avisource("src.avi")
crop(0,2,-0,-2)
FFT3dFilter(sigma=3.0, plane=0, bt=2, bh=32 ,bw=32, measure=true)
FFT3dFilter(sigma=4.0, plane=1, bt=2, bh=32 ,bw=32, measure=true)
FFT3dFilter(sigma=4.0, plane=2, bt=2, bh=32 ,bw=32, measure=true)
FilterKalman:
FilterMore.AVS:
avisource("src.avi")
crop(0,2,-0,-2)
FFT3dFilter(sigma=2.0, plane=0, bt=2, bh=32 ,bw=32, measure=true)
FFT3dFilter(sigma=3.0, plane=1, bt=2, bh=32 ,bw=32, measure=true)
FFT3dFilter(sigma=3.0, plane=2, bt=2, bh=32 ,bw=32, measure=true)
All encoded to:
XVID CQ2 QPel 2BF ChromaOpt ChromaMotion MAXVHQ VHQBF Trellis
Speed:
NoFilter.AVS: 0% Slower 206secs 17.6fps
Filter.AVS: 36% Slower 280secs 12.95fps
FilterMore.AVS/FilterKalman.AVS almost the same as Filter.AVS
Size:
NoFilter.AVS: 1610 kbit/s 0 saving
Filter.AVS: 1325 kbit/s 18% saving
FilterMore.AVS: 1270 kbit/s 21% saving
FilterKalman.AVS: 1350 kbit/s 16% saving
Images:
NoFilter Before XviD:
http://www.arabcc.net/theunforgiven/randomfiles/ff3dfiltertest-images/NFNoXviDS1.PNG
NoFilter:
http://www.arabcc.net/theunforgiven/randomfiles/ff3dfiltertest-images/NF492S1.PNG
Filter:
http://www.arabcc.net/theunforgiven/randomfiles/ff3dfiltertest-images/F492S1.PNG
FilterMore:
http://www.arabcc.net/theunforgiven/randomfiles/ff3dfiltertest-images/FM492S1.PNG
FilterKalman:
http://www.arabcc.net/theunforgiven/randomfiles/ff3dfiltertest-images/FK492S1.PNG
Artifacts:
http://www.arabcc.net/theunforgiven/randomfiles/ff3dfiltertest-images/artifacts.JPG
Download All Images 1MB:
http://www.arabcc.net/theunforgiven/randomfiles/ff3dfiltertest-images/ff3dfiltertest-images.zip
@DarkFoon
thanx for the tips.
SirCanealot
8th February 2005, 11:54
Well, if that is what FFT is creating, just use Msmooth to remove it (Msmooth is really good at removing that type of artifacting) and quit bitching.
Hmm... I tried MSmooth, but, just as I suspected, it did great at removing the noise, but also removed all the detail too :P
And I really don't have time to trim apply MSmooth right now :/
Maybe for next episode ^^
tsp
8th February 2005, 13:35
Originally posted by DarkFoon
@tsp
GO you! I can wait to explode my Geforce2 MX400! I think it will be interesting to see how it uses the GPU...
I'm afraid it will be directx 9 only(to get the neccesary floating point support), but then you have an excuse for upgrading your graphics card :)
Q-W-Y
8th February 2005, 15:20
Amazing filter!!!
Thank you VERY MUCH!
Only one problem i have with it.
"Noisy borders"
I use this script
AviSource("clip.avi")
ConvertToYV12(interlaced=true)
TomsMoComp(0,5,1)
FFT3dFilter(sigma=10.0, measure=true, bh=32 ,bw=32, bt=3, sharpen=0.9)
DeGrainMedian()
crop(0,6,720,566)
LanczosResize(512,368)
Tweak(0, 1.3, 0, 1, false)
ColorYUV(levels="TV->PC",autogain=true)
Result is great.
Unfiltered source file encoded at q5 takes 3,98_MB
Filtered takes 708_kB :D
Only problem is the strange border...
There are samples:
unfiltered: http://ceskyinterier.cz/temp/3test1.avi
filtered: http://ceskyinterier.cz/temp/3test2s10.avi
Anybody could help?
Thank you
krieger2005
8th February 2005, 18:12
The left and buttom border were not proceeded if they does not fit for the parameter "bw" and "bh". You can Add Borders and after Filtering remove them again. "Soulhunter" ask for this future "in" the filter, so maybe Fizick will add it...
Great work Fizick ;).
BTW: sigma=10!!! Wow. And second: If you have a grainy source, then give you the use of "DegrainMedian" before FFT3DFilter better result (my expirience).
Q-W-Y
8th February 2005, 18:33
Originally posted by krieger2005
BTW: sigma=10!!! Wow. And second: If you have a grainy source, then give you the use of "DegrainMedian" before FFT3DFilter better result (my expirience). [/B]
For me it looks better when DeGrainMedian is after FFT3D :)
Soulhunter
8th February 2005, 19:22
Originally posted by Q-W-Y
For me it looks better when DeGrainMedian is after FFT3D :)
And I like to blend DeGrainMedian with FFT3D... :D
Bye
Fizick
8th February 2005, 23:35
DeGrainMedian is my fastest filter,
FFT3DFilters is slowest one...
But combine is not midde-speed, unfortunately. :D
Soulhunter
8th February 2005, 23:43
Originally posted by Fizick
But combine is not middle-speed, unfortunately. :D
http://img91.exs.cx/img91/6105/yahoooo0iy.png
And now imagine a 2x FFT3D blend... :D
Bye
DarkFoon
9th February 2005, 00:38
@unforgiven
Just FYI: the artifacting looks strange because (this is suspecting you did a subtract(clip1,clip2) type thing) the sharpening done by FFT3D. You might want to turn it off if you are going for straight denoising. (Personally, I wish it were off by default, but that's just me ;) ) btw, no problem, for the tips! ;)
@SirCanealot
I'm sorry Msmooth didn't work for you, perhaps your settings are too high? It worked fine for me with that one frame you had posted (I do hope that you looked at the example I had available) so maybe there is strangeness in the way it works on our separate systems? (I never allow it to remove ANY detail, so maybe you should just set the threshold lower next time?)
@tsp
well, shit... so I need a DirectX9 hardware compatable card? Cuz I have Dx9b installed... (I hate how m$ has it divided into hardware and software, I can't ever keep it straight)
@Fizick
I know I have been asking you a bunch of things lately, but I have got one more: a way to turn on/off the sharpening through the bt= variable.
For example, bt=0 turns on Kalman, but bt=-0 turns on kalman and sharpening. bt=3 turns on weiner prev,current,next filtering, bt=-3 turns on weiner prev,current,next filtering and sharpening. Otherwise shrpening would be off. Or maybe instead of minus, it would be bt=0s, or bt=3s, to turn on sharpening. Get the idea? I don't know how this is implemented in programming, so let me know if this is stupid.
Socio
9th February 2005, 01:00
This works real nice with LimitedSharpen I can even do 2X sharpening.
Give this a shot SoulHunter:
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpen.avs")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\undot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\WarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\colormatrix.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\fft3dfilter.dll")
FFT3dFilter(sigma=2.0, plane=0, bt=-1, bh=32 ,bw=32, measure=false, sharpen=0.5)
LimitedSharpen( ss_x=1.5, ss_y=1.5,
\ Smode=3, strength=40, radius=2,
\ Lmode=1, wide=false, overshoot=1,
\ soft=false, edgemode=0, special=false,
\ exborder=0 )
UnDot()
ColorMatrix()
Socio
9th February 2005, 01:03
SirCanealot
If MSsmooth does not cut it for you try MipSmooth does wonder for my stuff.
SirCanealot
9th February 2005, 01:51
Originally posted by DarkFoon
@unforgiven
@SirCanealot
I'm sorry Msmooth didn't work for you, perhaps your settings are too high? It worked fine for me with that one frame you had posted (I do hope that you looked at the example I had available) so maybe there is strangeness in the way it works on our separate systems? (I never allow it to remove ANY detail, so maybe you should just set the threshold lower next time?)
Remember that frame had very little detail to be preserved...
Unfortunately, this series features quite a few detailed backgrounds, so...
Not about smoothing them TOO much :P
SirCanealot
If MSsmooth does not cut it for you try MipSmooth does wonder for my stuff.
Thanks. Sure thing - I'll give it a go when I get the chance...
DarkFoon
9th February 2005, 05:12
@Socio
what settings do you use with mipsmooth? I usually get terrible results, at a speed slower than msmooth.
Also, what settings do you use when you have FFT3D with mipsmooth?
perhaps an example of a script with mipsmooth and FFT3D (that works for you)?
TheUnforgiven
9th February 2005, 10:44
@Darkfoon
from ff3dfilter 0.8 help:
"sharpen - sharpening strength (default=0 - not sharpen)"
and i am not sbtracting anything it is the actual video.
Socio
9th February 2005, 16:03
DarkFoon,
I am not concerned with speed I will sacrifice speed for quality any time, so this may not be as fast as you like but both give me nice results.
Try this for light denoising, light smoothing:
FFT3dFilter(sigma=1.0, plane=0, bt=-1, bh=32 ,bw=32, measure=false, sharpen=0.8)
MipSmooth(preset="MovieHQ")
For more denoising and smothing:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\fft3dfilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MipSmooth.dll")
FFT3dFilter(sigma=2.0, plane=0, bt=-1, bh=32 ,bw=32, measure=false, sharpen=0.8)
MipSmooth(preset="MovieLQ")
MacAddict
11th February 2005, 14:32
Originally posted by Socio
Try this for light denoising, light smoothing:
FFT3dFilter(sigma=1.0, plane=0, bt=-1, bh=32 ,bw=32, measure=false, sharpen=0.8)
Would this be a nice starting point for a clean DVD movie source? TIA
Socio
11th February 2005, 16:08
Originally posted by MacAddict
Would this be a nice starting point for a clean DVD movie source? TIA
Sure in fact I am right in the middle of doing my Rio Bravo DVD and I am using those settings along with IIP and it looks fantastic so far.
NOTE: If you are doing 720x480 then change the bh=32 ,bw=32 part to either bh=16 ,bw=16 or bh=48 ,bw=48 because for some reason bh=32 ,bw=32 leaves a line all the way around the edges. Pehaps the 32 setting is better suited for PAL not sure.
Socio
11th February 2005, 22:43
Here is a before and after pic of Rio Bravo using FFT3dFilter,IIP,and Mipsmooth.
I used the FFT3DFilter to clean up some of the noise prior to IIP then used the Mipsmooth to clean up and blend some of the specs and artifacts left over after IIP that were particularly noticeable in scenes where there was lots of sky.
Before
http://img231.exs.cx/img231/7665/riobravo2b41ci.jpg
Filtered
http://img231.exs.cx/img231/3838/riobravofiltered22cs.jpg
DarkFoon
11th February 2005, 23:17
Thanks for the suggestions, Socio! I'll try them ASAP.
@Everybody
If you're doing 720x480 with FFT3D, you should use:
bh=48, bw=48 if plane=0; bh=40, bw=40 if plane=1 or plane=2
Reason: If the bh/bw doesn't divide evenly into the frame, then there will be unfiltered edges (because now the blocks are "centered". Before, it was the right, bottom that was unfiltered if the blocks don't fit). if you divide 720 by 32, you get 22.5, which doesn't work.
If you divide 720 by 40, you get 18, which does work.
It has nothing to do with PAL.
The reason I say use bw=bh=40 for plane=1/2 is because I am assuming that you are using YV12 input. With YUY2 and plane=1/2, only bw=40, bh can equal 48. All this is because of the chroma-subsampling.
[OT]
What is IIP? And, where do I find it?
Soulhunter
13th February 2005, 22:11
Originally posted by DarkFoon
What is IIP? And, where do I find it?
Here... (http://forum.doom9.org/showthread.php?s=&threadid=70916) ;)
Bye
namor82
14th February 2005, 05:31
Originally posted by Socio
[B]Here is a before and after pic of Rio Bravo using FFT3dFilter,IIP,and Mipsmooth.
I used the FFT3DFilter to clean up some of the noise prior to IIP then used the Mipsmooth to clean up and blend some of the specs and artifacts left over after IIP that were particularly noticeable in scenes where there was lots of sky.
Wow looks great.
Can you post you complete script here please ?
And what version of FFT3DFilter do I need ? I have Athlon XP Barton and Geforce 2 Pro Grafiks...
Thx for answers.
Socio
14th February 2005, 15:26
Originally posted by namor82
Wow looks great.
Can you post you complete script here please ?
And what version of FFT3DFilter do I need ? I have Athlon XP Barton and Geforce 2 Pro Grafiks...
Thx for answers.
I am using the latest version of Fizick's FFT3DFilter I have not tried out TSP's version yet.
Here is the script I used:
Import("C:\Program Files\AviSynth 2.5\plugins\IIPX.avs")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\fft3dfilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MipSmooth.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\undot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\WarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\UnFilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\colormatrix.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\LoadPluginEx.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\dustv5.dll")
FFT3dFilter(sigma=2.0, plane=0, bt=-1, bh=48 ,bw=48, measure=false, sharpen=0.4)
iip( duststr = 2, dustweight = 1.0,
\ ss1_x = 1.33, ss1_y = 1.66,
\ detailcontr1 = 127, detailcontr2 = 208,
\ contr_radius = 3, PixSharp = 0.3,
\ ss2_x = 2.5, ss2_y = 3.5,
\ Xstren = 208, Xlimit = 255,
\ subpelstren = 0.0, flatweight = 0,
\ antiflicker1 = true, antiflicker2 = true,
\ protect_floor= 0, protect_bias = 12,
\ dering = -100, dering_weight= 1.0,
\ dering_floor = 8, dering_bias = 12,
\ detail_floor = 24,
\ EQ = 2, exborder = false,
\ warp_Y = true, warp_UV = true,
\ debug="dering | protect | detail | compareH | compareV | compareT | showall",
\ cropx = 40, cropy = 20
\ )
return( last )
MipSmooth(preset="MovieLQ")
ColorMatrix()
namor82
14th February 2005, 23:32
Ok thx,
could you attatch the "IIPX.avs" please I don't know really where do I find this one...
Socio
15th February 2005, 00:43
Sorry that is just what I named the IIP script.
You can find IIP at the link SoulHunter posted a couple posts up. Use version 5 it is somewhere in the middile of the thread also read through the thread Didee put lots of good info on IIP settings and what they do.
Didée
15th February 2005, 10:00
>> ... lots of good info on IIP settings and what they do
... though the code you posted above gives the feeling you never use the "debug" option for tweaking? ;)
Fizick
15th February 2005, 20:27
New version 0.8.2 February 15, 2005 - added internal buffer to process whole frame (borders included) for any bw, bh (a little slower)
Try new site:
http://www.avisynth.org/fizick
Socio
16th February 2005, 00:42
Nice Fizick!
Also unlike your other site I can get on this new site no problems.
Thanks
Didee,
Actually I have been using AVSedit for tweaking makes it real easy to do real time adjustments.
Fizick
16th February 2005, 05:51
You must say "Thanks" to Richard Berg for it!
Capirossi
16th February 2005, 12:06
very well :D
namor82
18th February 2005, 02:37
Thx to you all for your great plugins...
I have one question, i used the script from "Socio" (previous page) to make my films look better, but when it comes out it is reversed...
Why is that so, can I fix that somehow ?
As Decoder I use the ffdshow-20050204 Filter. But the Video is reversed so that the Buttom is the Top and the Top is the Buttom.
If I deinstall the ffdshow-filter, then I can't encode the file and the PC writes "no codec for YV12-Support"...
What could I do to get the Video in the right position and not 180°reversed ?
/EDIT/
I solved the problem with the XVID-CODES (it can do YV12 too).
DarkFoon
19th February 2005, 00:04
My computer uses Xvid for yv-12 decoding, no flipping, no problems. But, it feels rather slow...
dragongodz
19th February 2005, 00:25
there is also the helix yv12 codec which is meant to be ok. there was a download link some time ago so if someone wants to try that a little search is needed. :)
EDIT: heres the helix codec if you want to try that aswell.
http://forum.doom9.org/showthread.php?s=&threadid=56972
Socio
19th February 2005, 00:54
I use ffdshow but never have encountered a flipping problem.
You might want to check in the ffdshow configuration make sure under miscellaneous that flip video has not accidentally been enabled.
krieger2005
19th February 2005, 01:30
Originally posted by namor82
But the Video is reversed so that the Buttom is the Top and the Top is the Buttom.
What could I do to get the Video in the right position and not 180°reversed ?
I guess, that this is something like what i have too, but only then, when i tried to load images in avisynth. The images where not 180° rotated but Fliped Horizontally (or vertically?: surely Buttom-Up). The interessting thing is, that mostly the first image where shown normally and the rest were flipped. So i guess, that this is not because you use FFT3DFilter or ffdshow but simply something with avisynth.
namor82
20th February 2005, 12:42
Ok so I solved the Problem I think. I have used the xvid YV12 filters.
But I see, that if I start the encoding with the fft-filter, then CCE don't encode it. I get only errors (red blury letters in the bottom)...
The script is ok so far, because I have load it in the VD-Mod and there I see no problems...
What could be the problem ?
dbzgundam
27th February 2005, 05:03
Amazing filter, I wish I'd used it on live action before ditching it the first around. ^^;;
Anyway, here's some pics. :D
http://x5.putfile.com/2/5622013669.png
http://x5.putfile.com/2/5622023689.png
Import("F:\Encoding Stuff\MISCAVS\BlindDeHalo2.avs")
MPEG2Source("F:\TSOS\d2v.d2v")
BlindDeHalo2(2,2,120)
Lanczos4Resize(720*2,480*2)
SangNom
LanczosResize(720,480)
FFT3DFilter(bt=3,bw=48,bh=48, sigma=1.5)
leonid_makarovsky
27th February 2005, 09:38
If I use size 704x480 and 704x576 (not 720x...) what parameters (bw) should I use?
--Leonid
DarkFoon
27th February 2005, 13:12
@Leonid
For 704x576
plane=0: bw=bh=32
plane=1=2: bw=bh=32
For 704x480
plane=0: bw=bh=32
plane=1=2: bw=44, bh=40
Those are the values I would reccomend.
Fizick
27th February 2005, 20:17
Leonid,
did you read my last post?
New version 0.8.2 February 15, 2005 - added internal buffer to process whole frame (borders included) for any bw, bh
So, now you can use any values for bh,bw. Full frame will be processed.
But default values (32) are optimal (by speed too).
This default is not accidentally :)
leonid_makarovsky
27th February 2005, 20:35
Thank you. Will try it.
--Leonid
DarkFoon
3rd March 2005, 07:45
@Fizick
This is completely off topic, but version 0.34.1 of Vaguedenoiser crashes all of my computers: not only my P2, but also my P3.
Just thought you'd like to know (especially since I complained about the P2 problem in the first place ;) )
Yeah, yeah... I know there's a thread for that filter, but I'm too lazy to find it (I have this thread bookmarked, however)
leonid_makarovsky
10th March 2005, 03:54
I just encoded a DVD video from the AVI file that was captured from VHS. This is the code that I used for interlaced part:
main = SeparateFields(main)
main = PixieDust(main)
main = fft3dfilter(main, sigma = 2, bt = 3, sharpen = 1.0)
main = Weave(main)
And this is the code that I used for progressive frames (static credits):
credits = PixieDust(credits)
credits = fft3dfilter(credits, sigma = 3, bt = 3, sharpen = 1.0)
The results are amazing. The DVD looks much better than the original VHS. There're a few places where I could see some blockiness here and there and 1 or 2 places with lack of details where they were supposed to be. But there're only a few places. Overall it's really great. Thanks Fizick. Ñïàñèáî, Ñàøà.
I have one question though. My next input clip is 704x576. I'm going to be doing 352x576. If my output clip stayed the same, I could've used:
fft3dfilter(sigma = 2, bt = 3, sharpen = 1.0)
But because it's going to be 352x576, should I use this code:
fft3dfilter(sigma = 2, bt = 3)
LanczosResize(352, 576)
LimitedSharpen()
instead?
Thanks.
--Leonid
kingmob
10th March 2005, 15:50
Using the sharpening method, i always get a vertical and horizontal line in my image. At first i thought it was crop. but removing that doesn't effect it. It is especially noticable in the u,v planes.
leonid_makarovsky
11th March 2005, 16:31
Originally posted by kingmob
Using the sharpening method, i always get a vertical and horizontal line in my image. At first i thought it was crop. but removing that doesn't effect it. It is especially noticable in the u,v planes.
Do you get these lines if you use something like this:
fft3dfilter(bt = -1, sharpen = 1.0) // sharpening only?
By the way, would this be a good idea for 704x576:
fft3dfilter(sigma = 2, bt = 3)
LanczosResize(352, 576)
fft3dfilter(bt = -1, sharpen = 1.0)
--Leonid
leonid_makarovsky
14th March 2005, 16:58
I tried FFT3DFilter just in sharpening mode, and it doesn't seem to work at all. Whenever I have bt = -1, the whole image just becomes dark and barely visible. I guess I can try to set sigma to 0 in with bt = 2 or 3, would this work as just sharpening? In the description it says that sigma is float and > 0.
Thanks.
--Leonid
DarkFoon
14th March 2005, 23:49
@Fizick
Have you come any closer to a variable sigma algorithm?
Or adding any other temporal modes?
Or any new changes? Ideas?
I WANT THIS THREAD(FILTER) TO LIVE!
DarkFoon
15th March 2005, 03:27
if you remember, I got geforce2 MX400, I can't do squat. T_T
Fizick
15th March 2005, 06:12
DarkFoon,
The first thing in my "to do" list is full rewrote to implement fixed overlapped size (for speed increasing). But it will take some time.
What is variable sigma? per block or per frame?
The are Authothreshold in Vaguedenoiser, for example.
DarkFoon
15th March 2005, 07:00
Though it may slow things down considerably, I was thinking variable sigma per block. Per frame would be too inaccurate and result in worse quality.
Maybe trying out the autothresholder from VagueDenoiser would be good first test of the idea.
[Edit]
Maybe the autothresholder's values could be normalized(?) or averaged or scaled to be relative to the user set value. For example, if the user-set value is 3, and the autothresholder wants to use a sigma of 10 for a block, it would be averaged (or normalized, or whatever) to a more reasonable value like 5, so it stays relative to the user value (it is still below it, just not so far off). Or lets say the autothresholder wants to use a value of .25, but average that against the user value, and the result is 2.25, a better value. Basically, the values are "gaussian distributed" (I stole that from the BlockBuster README) around a user value. Meaning, sure a 10 could be used, but it would be once in a thousand. much more likely, however, would be a 2 or a 4 (still assuming that the user value is 3).
This all assumes that the autothresholder would be turned on with a boolean argument. Like auto=true/false.
Of course, you could ignore all this too, because it doesn't make much sense to me, and I bet it doesn't make much sense to you either. (I'm tired :) )
I hope it made sense, though. In some way.
Backwoods
15th March 2005, 07:03
Or have an option for "per frame" or "per block".
Fizick
16th March 2005, 00:23
leonid_makarovsky,
Version 0.8.3, March 16, 2005 - fixed sharpen mode (bt=-1) for YUY2.
DarkFoon,
Not now. May be later. May be not. There are no good algo to estimate noise.
LordIntruder
19th March 2005, 06:04
Hi,
I would like to know if adding "measure=true" help to improve the general encoding speed?
Thanks. :)
DarkFoon
19th March 2005, 18:22
yes it does.
measure=true basically gives the FFT the time it needs to find the optimum equation (or operation, something like that) for your bh/bw and CPU. turning it off means that when you load your script, it loads faster, but overall it is less efficient than if you had measure=true. It just slows down (about 1-2 seconds on a PIII 800Mhz) how fast your script initially loads. (when you drag it into VirtualDub, for example, the video wont display for a second or two)
This has no effect on the filter's ability to filter, and it has no effect on the quality of video, it just makes it faster legally
Hope that helps (kinda a lot there... sorry)
LordIntruder
21st March 2005, 04:37
Hi,
Thanks for the answer :)
Well I encoded a 10000 video frames to see what gain I could expect and with this parameter for FFT:
'FFT3DFilter(sigma=3, bt=3, measure=true)'
Without FFT:
1st Pass = 13 min
2nd Pass = 37 min
FFT Measure True:
1st Pass = 53 min
2nd Pass = 80 min
FFT Measure OFF:
1st Pass = 59 min
2nd Pass = 82 min
So the impact of 'measure=true' option is light but on a a full DVD encode, the gain should be (for my machine a 2400+ with 1Gb Ram) roughly 1 hour minimum for the first pass (and the 1st pass should take around 11 hours :scared: ).
In my example I selected the heaviest solution with latest XviD beta: Qpel, GMC, VHQ4, VHQ for bframes, Chroma motion, etc...
On the few short tests I did, what surprises me is the compression gain you get with this filter. I need to encode a full movie with and without this filter to confirm it but my first feelings are amazing. Thanks to this filter I could rise the resolution on difficult movies to encode. I currently have a movie (a bit grainy) that I encoded in 640 x 464 and the result is very good, after a compression test using FFT it appears I could encode this movie in 720 x 564 with similar quality. I will see that this week. Of course the drawback is the awful slowness of this filter but I tested the GPU version and this one is amazingly fast. ;)
Thanks and cheers for the excellent work on this filter. :)
DarkFoon
21st March 2005, 08:49
@Fizick
since avisynth filters are open source, isnt is possible that you could take the algorithm from PeachSmoother used to estimate noise? That one is very good. (actually, before FFT3d, that was my temporal filter of choice)
Just a thought that occured to me.
@LoadIntruder
I can't wait for your full results. But thanks for the ones you have posted. They are a welcome justification.
Wilbert
21st March 2005, 10:38
Peach is not GPL :(
DarkFoon
21st March 2005, 10:43
well don't that beat all (i.e. damn!)
I wonder why, though...
Boulder
21st March 2005, 14:21
Has anybody been able to contact Lindsey Dubb? I remember that someone was looking for the sources and Richard Berg (who ported the filter to AVS2.5 and does have them) said he would ask Lindsey if they could be released. IIRC Lindsey had earlier said that if he disappeared for a long time, they should be made available.
DarkFoon
27th March 2005, 09:09
@fizick
I noticed a strange problem with FFT3D when filtering anime with seperatefields() before it.
The lines in the anime are made really jaggedy and look terrible. Is there anyway to put a special "fields mode" into FFT3d, so that it compensates for field jitter (which is what I suspect is the problem)
What I had in mind was that it would shift the even field up one line, so that it matches the odd field on the time axis.
an example:
normal operation with seperate fields
o
e
o o e
e --fields to frames--> o e [[FFT3D]]
o o e
e o e
o --time axis-->
e
Thus, the lines (as in the drawings in the frame, not the interlacing) appear to 'jitter' to FFT3d when it compares the fields, so it destroys them, trying to remove noise.
Operation with seperate fields and compensation
o e
o e o e
--fields to frames--> o e [[FFT3D]]
o e o e
o ^
o e e
^ --time axis-->
... hmmm.
well that example sucks, but do you know what I am saying? I could take screenshots if that would help. (I'm really bad at describing this kind of thing. It makes sense in my mind)
Let me know if I need to clarify.
Backwoods
27th March 2005, 20:20
I've noticed some jaggies on live action video with SeparateFields() also.
Fizick
27th March 2005, 22:10
http://www.avisynth.org/InterlacedSmoothing
But is your anime really interlaced?
I never see any anime :)
DarkFoon
27th March 2005, 22:36
Thanks for the link Fizick, it was exactly what I had in mind! :)
But it makes the filter run slower. And it looks like less noise is removed with the function... :(
Here are some examples!
With plain Seperatefields()
http://kizawa.virusclan.org/ex/ex2.png
Look closely at the diagonal lines on the suit of armor. (The more diagonal the line, the worse the jaggies are)
With Interlaced Function
http://kizawa.virusclan.org/ex/ex1.png
see? No jaggies at all!
I don't feel like posting the script right now. I will if somebody asks me to, however.
Yes, it is interlaced, because its a TV capture.
Leak
28th March 2005, 01:32
Originally posted by DarkFoon
Yes, it is interlaced, because its a TV capture.
No, it's interlaced because it was telecined from 23.976 to 29.97 FPS.
If you record something straight from TV here in PAL land and it was a movie to begin with it's progressive...
Even if it were interlaced, the non-moving parts would still look progressive, after all - and I don't think Ed and Al were moving much in that scene...
np: Rhythm & Sound with Willi Williams - See Mi Yah (See Mi Yah)
DarkFoon
29th March 2005, 04:54
@Leak
Alas, I live in the land of NTSC, yes there weren't moving much in that scene, nonetheless, the video was captured interlaced and when Al bent his arm down about 15 frames after the example, there is interlacing. If I don't use some sorta of field splitting and just FFT3D on the image, it really messes up the image. It blends the lines and such.
I don't like running IVTC on my anime, it takes too long to get it perfect (like weeding out frames detcted wrong). If it would work the way I want it to, I would run Telecine(), then FFT3D(), and finally Weave() to keep my interlacing, but that wouldn't always work. I don't think.. maybe I should try it... hmmm.
Gotta go, Gonna try that now.. ;)
Fizick
4th April 2005, 21:03
So, I at last release version 0.9, April 4, 2005 - variable overlaping size ow, oh for more fast processing
Doubled overlap sizes must be not great than block sizes
In the all previous version I used fixed overlap size = (block size)/2
Now default is (block size)/4 as more fast.
http://www.avisynth.org/fizick/fft3dfilter/overlap.gif
Try!
leonid_makarovsky
4th April 2005, 21:07
A question. I have a clip of size 704x576. The output clip, however, should be 352x576. I would like to run it through FFT denoiser to donoise and sharpen. What's the best way?
PixdieDust()
fft3dfilter(sigma = 2, bt = 3, sharpen = 1.0)
LanczosResize(352, 576)
Or would it be better:
PixdieDust()
LanczosResize(352, 576)
fft3dfilter(sigma = 2, bt = 3, sharpen = 1.0)
Thanks.
--Leonid
DarkFoon
4th April 2005, 21:20
@Leonid
Generally speaking with video, you want to have as many pixel to manipulate.
The first way you described would result in higher quality, but slower processing.
The second way would result in faster processing, but lower quality.
It's a question of logic: the first way, the filter has more pixels to work with, so it can remove noise without destroying some of the finer details. But in the second example, the finer details are made even smaller also the noise is too, so when the filter passes over the smaller frame, it will be more likely to remove the fine details along with the noise.
Can't I ever make a simple explanation? Prolly not ;)
Fizick
4th April 2005, 21:28
Leonid,
you mus find it yourself and say to us :)
Probably in last case you must use bw<bh
But why you use Dust, and why you do not use motion compensated denoising?
( or I forget to recommend previuosly ...?)
motion=Depanestimate()
depaninterleave(motion)
fft3dfilter(sigma = 2, bt = 3, sharpen = 1.0)
selectevery(3,1)
EDIT: Must be:
motion=Depanestimate()
depaninterleave(data=motion)
fft3dfilter(sigma = 2, bt = 3, sharpen = 1.0)
selectevery(3,1)
leonid_makarovsky
4th April 2005, 21:28
Originally posted by DarkFoon
@Leonid
Generally speaking with video, you want to have as many pixel to manipulate.
The first way you described would result in higher quality, but slower processing.
Well, the biggest concern here is not a processing time but sharpness. It is better to apply sharpness at 352x576 rather than 704x576 if the final clip is going to be 352x576. As far as I understand denoising and sharpness work together in fft3dfilter so I can't separate them. I could have done
fft3dfilter(bt = 3, sharpness = 0)
Resize(352, 576)
fft3dfilter(bt = -1, sharpness = 1.0)
but then sharpening and denoising are not connected here.
--Leonid
leonid_makarovsky
4th April 2005, 21:32
Originally posted by Fizick
But why you use Dust, and why you do not use motion compensated denoising?
( or I forget to recommend previuosly ...?)
motion=Depanestimate()
depaninterleave(motion)
fft3dfilter(sigma = 2, bt = 3, sharpen = 1.0)
selectevery(3,1)
I've never used/heard of Depanestimate and depaninterleave. My clips are recorded from VHS which are pretty noisy. I found that PixieDust followed by fft3dfilter remove noise very well. I guess I will try depaninterleave.
--Leonid
DarkFoon
4th April 2005, 22:38
@Leonid
Lanzcosresize() sharpens the image a bit on its own.
I can't really say if sharpening before resize or after is better. I'd say do it before so that denoising looks better, and so it sharpens the smaller details so that when the resizer resizes the image, the smaller details aren't ignored, or left out of the resize.
DarkFoon
6th April 2005, 01:29
@Fizick
I am trying to do something with my video, and I'm probably going about it the hard way. I am trying to combine this:
Posted by Fizick
motion=Depanestimate()
depaninterleave(motion)
fft3dfilter(sigma = 2, bt = 3, sharpen = 1.0)
selectevery(3,1)
and this
function ApplyInterlacedFilter(clip v1, string filter) {
v2 = separatefields(v1)
selecteven(v2)
even = Eval(filter)
selectodd(v2)
odd = Eval(filter)
interleave(even,odd)
return weave()
}
Is it possible to do motion compensated denoising of an interlaced clip?
My script so far looks like this:
loadplugin("C:\plugins\dgdecode.dll")
loadplugin("C:\plugins\fft3dfilter.dll")
loadplugin("C:\plugins\depan.dll")
function ApplyInterlacedFilter(clip v1, string filter) {
v2 = separatefields(v1)
selecteven(v2)
even = Eval(filter)
selectodd(v2)
odd = Eval(filter)
interleave(even,odd)
return weave()
}
mpeg2source("fma3.d2v",cpu=0,idct=4,ipp=true,moderate_h=20 ,moderate_v=40 ,showq=false,fastmc=false,cpu2=" ")
motion = ApplyInterlacedFilter(last, "depanestimate()")
applyinterlacedfilter(last, "depaninterleave(motion)")
fft3dfilter(sigma=3, plane=0, bt=2, bh=48, bw=48, ratio=1, sharpen=3, measure=true)
fft3dfilter(sigma=7, plane=1, bt=3, bh=32, bw=32, ratio=1, sharpen=0, measure=true)
fft3dfilter(sigma=7, plane=2, bt=3, bh=32, bw=32, ratio=1, sharpen=0, measure=true)
selectevery(3,1)
Only, the problem is, when I have this line: applyinterlacedfilter(last, "depaninterleave(motion)")
VirtualDub tells me upon opening "I don't know what 'motion' is" and gives me the line number.
And if I change that line to: depaninterleave(motion), Vdub says upon opening the script "Unrecognized exception" and gives me the line number.
If there is an easier way, or just any way to get this to work, I'd appreciate it!
kthxbye! :)
Fizick
6th April 2005, 05:13
DarkFoon,
1. I am not script writer, but plugin writer only :)
2. My Depaninterleave recomendation was not to you but to Leonid :D
3. For ordinary (not anime) sources, depaninterleave can be used without selectodd-even, since Depan will make optimal field compensation.
I did not use selectodd yet this way.
4. you may try other methods of fields separation:
- bob-deinterlace (ask scharfis_brain);
- unfoldfields.
5. Do you see my new version 0.9 ? Some time ago you ask me for null overlap.
Anybody can post speed tests with new option?
And what about optimal overlap size and visual quality?
May be i will fix overlap size in future version for speed optimize.
And probably i try add Athlon 3dNow optimization too.
DarkFoon
6th April 2005, 19:55
Indeed, I did see your version 0.9. I am using it right now.
I haven't paid any attention to speed, but I have noticed that it removes more noise than it used to. that pleases me greatly!!!
I think I may have set my overlap=0.5*bw/bh but, I haven't been paying attention to speed....
Anyways! Keep up the good work!
Have you considered using the multithreaded version of fftw(maybe as an option). It should be very easy to modify the code to use it and with all the upcomming multicore processors it could be a good investment.
Fizick
6th April 2005, 21:55
Now released Version 0.9.1, April 7, 2005 - some assembler 3DNow! speed optimization for mode bt=3
Athlon rules!
tsp,
i will try answer later.
vinetu
6th April 2005, 21:59
Originally posted by Fizick
Anybody can post speed tests with new option?
Sure! :)
P4 2.4GHz (133MHz FSB,512kB cache),1GbRAM,Radeon 9600
source is PAL 720x576 progresive - "real live" video ,uncompressed YV12.avi
the target is the same format -VirtualDub in "direct stream mode".
FFT3DFilter v. 0.90 :
1. FFT3DFilter(sigma=3.0, bt=3, bh=64, bw=64, ow=0, oh=0) speed is 18.20 fps,compressed later to xvid(quant2) to 6,979,864 bytes
2. FFT3DFilter(sigma=3.0, bt=3, bh=64, bw=64,ow=16,oh=16) speed is 11.38 fps,compressed later to xvid(quant2) to 6,342,656 bytes
3. FFT3DFilter(sigma=3.0, bt=3, bh=32, bw=32, ow=0, oh=0) speed is 19.50 fps,compressed later to xvid(quant2) to 7,098,800 bytes
4. FFT3DFilter(sigma=3.0, bt=3, bh=32, bw=32, ow=8, oh=8) speed is 12.40 fps,compressed later to xvid(quant2) to 6,399,584 bytes
FFT3DFilter v. 0.83 :
1. FFT3DFilter(sigma=3.0, bt=3, bh=64, bw=64) speed is 4.33 fps,compressed later to xvid(quant2) to 5,865,498 bytes
2. FFT3DFilter(sigma=3.0, bt=3, bh=32, bw=32) speed is 4.40 fps,compressed later to xvid(quant2) to 5,887,002 bytes
...but then I decide to repeat the tests with v.0.90 and... surprisingly I get lower speeds (even after a reboot):
1. FFT3DFilter(sigma=3.0, bt=3, bh=32, bw=32, ow=8, oh=8) speed is 8.53 fps,compressed later to xvid(quant2) to 6,399,584 bytes
2. FFT3DFilter(sigma=3.0, bt=3, bh=32, bw=32, ow=0, oh=0) speed is 16.05 fps,compressed later to xvid(quant2) to 7,098,800 bytes
I'll investigate that later ...Still I'm very happy with your optimizations on the latest version!
However I'll keep the v. 0.83 as it seems to help compressibility better...
About Quality-all I can say is that - It's very hard to find visual differences between original and filtered files and I've never
did see any artifacts with FFT3DFilter nor FFT3DGPU...probably I need new monitor and a glasses ;)!
Thank You Fizick!
P.S. It's time to change the title from "New very slow FFT denoiser" to "New not even slow FFT denoiser" or so :)
Fizick
6th April 2005, 22:09
vinetu,
thanks fo tests,
but why However I'll keep the v. 0.83 as it seems to help compressibility better...
if you can set overlap sizes to half of bw,bh in new version,
and you must get the same result as v. 0.8.3? Can you check it?
vinetu
6th April 2005, 22:22
Originally posted by Fizick
but why
if you can set overlap sizes to half of bw,bh in new version,
and you must get the same result as v. 0.8.3? Can you check it? [/B]
Yes You are right!
FFT3DFilter v. 0.91 :
FFT3DFilter(sigma=3.0, bt=3, bh=32, bw=32, ow=16, oh=16) speed is 5.35 fps,compressed later to xvid(quant2) to 5,889,762 bytes
the same with version 0.83 was 5,887,002 bytes
a quick test with old settings (for compatibility)
FFT3DFilter v. 0.91 :
1. FFT3DFilter(sigma=3.0, bt=3, bh=32, bw=32, ow=0, oh=0) speed is 16.05 fps,compressed later to xvid(quant2) to 7,098,800 bytes
2. FFT3DFilter(sigma=3.0, bt=3, bh=32, bw=32, ow=8, oh=8) speed is 9.75 fps,compressed later to xvid(quant2) to 6,399,584 bytes
P4 2.4GHz without multithreading
Thank You!!!
vinetu
7th April 2005, 00:45
After a 12-13 reboots I found very interesting dependence between speed of the filter and his settings.
If after a fresh reboot ,the first thing is "FFT3DFilter(sigma=3.0,bt=3,ow=0,oh=0)"
then I get 16.05 fps for the first "Save as" and 21.00 fps for every next "Save as" (same avs source->same target avi).
Next running "FFT3DFilter(sigma=3.0,bt=3,ow=8,oh=8)" I get 9.75fps for the first "Save as" and 11.38fps for every next "Save as".
Obviously something is cached ,but I doubth it's a just the avi file ...
because if I reboot again,then first run "FFT3DFilter(sigma=3.0,bt=3,ow=8,oh=8)" I'll get 8.5fps and for the every next "Save as"-9.75fps.
And if I run then "FFT3DFilter(sigma=3.0,bt=3,ow=0,oh=0)" I'll get 16.05fps(and not 21) for the first and every next "Save as"
So the "ow=0,oh=0" setings are somehow "The Right Initialization Patern" for my intel inside scrap :) !
Next tests will include 3DMark2005 results :) ...
About "testbed": the source avi is located on 120 Gb Maxtor,the target avi -on a 80 Gb Maxtor,file transfer between HDDs is ~ 40MB/sec.
VirtualDub is in "direct stream mode".The avs script is:
---------------------------------
LoadFilter("fft3dfilter.dll")
AviSource("YV12uncompressed.avi")
fft3dfilter(....)
---------------------------------
Bye
Fizick
7th April 2005, 05:08
vinetu,
thanks for interest report!
Now i see, that full overlap mode is faster now too.
It is due to other compiler settings (/QIFist flag).
How long was your test clip (number of frames, or file size).
And what is "YV12uncompressed" ?:confused:
Anybody with Athlon here (to compare v.0.8.3, 0.9, and 0.9.1 speed and quality?
Backwoods
7th April 2005, 07:23
Originally posted by Fizick
And what is "YV12uncompressed" ?:confused:?
I think just the name of his AVI file.
1000 frames 720x576 clip:
0.83:
fft3dfilter(a,bt=3,sigma=3) 4.6 fps
0.9.1
fft3dfilter(a,bt=3,sigma=3,oh=16,ow=16) 5.7 fps
fft3dfilter(a,bt=3,sigma=3)12.2 fps
fft3dfilter(a,bt=3,sigma=3,oh=0,ow=0) 19.2 fps
this is on an athlon xp 2400 MHz 1 GB ram(200 MHz).
so ~25% speed increase. Not bad
vinetu
7th April 2005, 09:12
Originally posted by Fizick
How long was your test clip (number of frames, or file size).
And what is "YV12uncompressed" ?:confused:
Clip is 273 frames long, 161Mb in size and 720x576@25fps.
"YV12uncompressed" meen that the clip is uncompressed and with the
collor space YV12.
It's produced that way - open an avs script wich end with "ConvertToYV12()" in VDub(direct stream mode) and Save the avi.
The stream of that avi is constant at ~15Mb/s
Bye
Fizick
10th April 2005, 16:25
New Version 0.9.2, April 10, 2005 - some assembler 3DNow! speed optimization for mode bt=0 (Kalman),
option measure=true is now default as more fast.
vinetu
10th April 2005, 20:06
Hi Fizick!
It seems my P4 is 3DNow capable too :)
here are the fastests results from running the avs 3 times
1.no fft filtering -> 91.05 fps
2.fft3dfilter 0.91 -> 16.95 fps
3.fft3dfilter 0.92 -> 19.23 fps
the avs:
--------------------
LoadPlugin("c:\dlls\FFT3DFilter.dll")
AVISource("1000frames_uncompressed-YV12_720x576@25fps_size-593MB.avi")
FFT3DFilter(sigma=3.0, bt=0, bh=32, bw=32, ow=0, oh=0,measure=true) #"Kalman mode"
--------------------
...intel P4 CPU at 2.4GHz.
At 2.9 GHz (the limit for my old Nordwood) I get 23.25 fps !!!
Thank You!
Fizick
10th April 2005, 21:38
it is not 3Dnow, but some code reorganization, and Bitblt function for arrays copying.
But true SSE2 optimization is out of my possibilities.
DarkFoon
11th April 2005, 00:43
if you dont mind my asking, why is SSE2 out of your possibilities? Did Intel make it that difficult to implement?
Fizick
11th April 2005, 05:02
DarkFoon,
try yourself! :)
I have AthlonXP at home.
iceburger
20th April 2005, 11:05
First of all thanks for this amazing filter- unbelievable results on one of my pal-ntsc restoration- this is the noise monster- moved all my quantizers down by one for tha same bitrate...as for the speed, oh well quality cost time (cce took 6 h. per pass, with this and resize, for a 1 CD DVDrip back to a whole DVD5 with DD2.0 , crazy, I know, but it's for a friend...results though...silky smooth both motion and backgrounds, all xvid artifacts gone, in one scene it recovered a reflection of a glass vase- very nice transitions- no blotchy areas, and very slight loss of detail...TV looks even better).
Just today I noticed the new version, and I was little suspicious since filesize is the same... I don't know how you do it Fizick, but you are something:devil:
First difference I noticed when I scrolled in VD- faaast! I decided to go heavy to see how good it is. I got ATA100, so no "uncompressed" direct stream for me- my little CPU stress test on my athlonXP@2300: Lost ep.20(960 x 528 1.818, 23.976 FPS, 1931 kb/s) first 500 frames, on Quant=2 with HVS Best, VHQ=4(b frames too), chroma motion on.
Test 1 0.8.3 FFT3DFilter(plane=0,sigma=2,bt=3,bw=48,bh=48,sharpen=0.5,measure=true)
Test 2 0.9.2 ow=24, oh=24 - if I understood correctly, this should be same algo as 0.8.3
Test 3 0.9.2 ow=16, oh=16
Results:
Test 1: size:13,126 KB 3:05 min ...staggering 2.7 fps
Test 2: size:13,148 KB 2:41 min... speed improvement of 15% - 3.1 fps
Test 3: size:13,658 KB 1:58 min- 4.23-got 1:47 with not fixed quant 4.62 fps...56-71% improvement over 0.8.3:sly: with 3% size trade-off:sly:
What's next :confused: I hope you make some sort of visualiser, or color coding of sort, so even more people see the difference. Literally. Thanks again.
Fizick
24th April 2005, 17:44
Version 0.9.3 - April 24,2005 - bug fixed for bt=2 with 3DNow! (thanks to kxproject for report);
mode bt=3 now default;
sharpen mode now is horizontal only and modyfied (still experimental)
What next?
1. I consider sharpen as experimental mode. Probably we never can create good sharpener with this algorithm becourse of blockiness (aliasing).
2. SSE2 or SSE3 optimizing?
You can try use or compile another version FFW3.dll
And it is posiible to optimize my own code (as 3DNow)
If somebody want make it, say.
tsp
24th April 2005, 19:41
Fizick what would the purpose with a sse2 version be when you only uses 32 bit floats (no double or integer code). A SSE version would be more suitable (All Athlons from Athlon xp and forward includes SSE).
Another thing do you plan to GPL the sourcecode (so I can rip the Kalman filter :p )
What about an ordinary 3x3 sharpening convolution(complex multiplication) as the sharpening function? The edge artifacts would disappear when using overlapping blocks.
Fizick
24th April 2005, 20:21
There are other fftw binary compiled with Intel comliler
ftp://ftp.fftw.org/pub/fftw/fftw-3.0.1-w32-pl1.zip
May be it is compatible. Can somebody with Pentium4 test its compatibility and speed?
Tsp,
I think next version will be GPL.
Yes, SSE is quite possible.
But there are many possible variants of Kalman fitering.
I tried some of them for ordinary (not-frequency domain) plugin, but never released it. The results is not very good.
About 3x3 convolution. I do not know really anything about sharpening :)
Do you say about frequency or spatial domain ?
I think we may use some external sharpening (Limitedsharpen).
Boulder
24th April 2005, 20:36
Originally posted by Fizick
There are other fftw binary compiled with Intel comliler
ftp://ftp.fftw.org/pub/fftw/fftw-3.0.1-w32-pl1.zip
May be it is compatible. Can somebody with Pentium4 test its compatibility and speed?
Can't say anything about the speed right now, but it does work.
tsp
25th April 2005, 00:38
Originally posted by Fizick
About 3x3 convolution. I do not know really anything about sharpening :)
Do you say about frequency or spatial domain ?
I think we may use some external sharpening (Limitedsharpen).
it's kind of both: if you take an ordinary sharpening mask like this:
-0.1 -0.1 -0.1
-0.1 1.8 -0.1
-0.1 -0.1 -0.1
and you have a blocksize of bh=8 bw=8 you zeropad the mask like this:
1.8 -0.1 0.0 0.0 0.0 0.0 0.0 -0.1
-0.1 -0.1 0.0 0.0 0.0 0.0 0.0 -0.1
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
-0.1 -0.1 0.0 0.0 0.0 0.0 0.0 -0.1
and fft it. Then you take the fft'ed image and complex multiply it with the fft'ed masked and apply the inverse fft to the result with result in a sharpend image.
this can also be used with any other mask. It's the same amount of worked involved so for bigger mask the difference in speed between multiplication in the frequency domain and convolution in the spatial domain increase.
DarkFoon
25th May 2005, 05:00
has there been any development?
this thread has been pretty dead...
leonid_makarovsky
30th May 2005, 05:18
I have some test results with the latest version.
The original file is in Huffyuv AVI format, 704x576, PAL 25fps. The output clip had total of 114025 frames. The total time of the output clip is 76 minutes and 1 second.
I had the very latest FFT3dfilter from Fizick.
I loaded the following AVS script into VirtualDub and saved it as also Huffyuv AVI with the same resolution and the same frame rate.
It took 22 hours 39 minutes and approximately 50 seconds to process the whole thing. I don't know how helpful it is giving the fact that there was PixieDust and it just also takes a while to process Save As operation in VirtualDub.
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\2.0\LoadPluginEx2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\2.0\DustV5.dll")
clip = AVISource("L:\KreatorPAL.avi")
clip = AssumeTFF(clip)
clip = Trim(clip, 16, 21) + Trim(clip, 16, 114024) + blank_clip(clip, 114009, 114024)
clip = Crop(clip, 0, 0, -6, -10)
clip = AddBorders(clip, 0, 0, 6, 10)
clip = SeparateFields(clip)
clip = PixieDust(clip, limit = 4)
clip = fft3dfilter(clip, sigma = 3, bt = 3)
clip = Weave(clip)
clip = Trim(clip, 6, 114030)
return clip
function blank_clip(clip myclip, int mystart, int myfinish, int "mycolor")
{
thepart = Trim(myclip, mystart, myfinish)
mycolor = Default(mycolor, $000000)
blankout = BlankClip(thepart, length = Framecount(thepart), pixel_type="YUY2", color = mycolor)
return blankout
}
namor82
7th June 2005, 12:35
Hello,
I have used the fft3d plugin a lot, and I liked especially the sharpenthing, because it was very good (for my subjectiv opinion)...
But the new version 0.9.3 is working not clean I guess, because i got vertical chroma-blocks in my capture, when I use version 0.9.3 .
It is not only because of the sharpen, but the sharpen does not work anyway, anymore (ok it's perhaps, because u dropped it to horizontal only)...
I had InterlacedSource, so I used:
SeparateFields()
e = SelectEven().FFT3DFilter(sigma=1.8, plane=0, bt=3, bh=32 ,bw=32 ,sharpen=1.7)
o = SelectOdd().FFT3DFilter(sigma=1.8, plane=0, bt=3, bh=32 ,bw=32 ,sharpen=1.7)
Interleave(e,o).Weave()
Here the Link, for the Images...
http://home.arcor.de/kwangsup/fft3d.rar
Has s.o. tried out the sharpen-functions ? Have you such bad results with the new 0.9.3 Version too ?
Fizick
7th June 2005, 21:49
namor82,
I know about very sharpen problems.
But i do not know a solution right now. And has no time. I must learn about sharpening.
These columns is due to not sufficient overlapping.
As a workaround, increase overlapped width to ow=bw/2
And i never say, that sharpen=1.7 is good value :)
The fft3flilter development is not stopped,
but delayed a little (week ?).
Any suggestions are welcomed.
Soulhunter
7th June 2005, 22:05
Isnt there some way to produce this grid pattern without real filtering ???
Then you could subtract it from the sharpened/smoothed result... :\
Bye
Fizick
8th June 2005, 05:31
I try put out the very first frequency member sharpening. So the column disappear, but strictly vertical lines will not sharpen too.
And i want add second sharpen parameter for verical sharpening.
acrespo
13th June 2005, 18:55
And I like to blend DeGrainMedian with FFT3D... :D
Bye
n00b question:
How can I do this (blend filters)?
Some people at this forum have writing that FFT is for real videos, not for anime. Is it true? I tried the combination of FFT3D(sigma=2,plane=0) and RemoveDirt(mode=16) << removedirt script. The results are good, but removedirt remove more noise than FFT. I tried sigma=3 but removedirt still better.
Other thing I have doubts is in apply only sharpen, only line darken or both.
The source is Samurai X TV.
DarkFoon
15th June 2005, 04:59
@acrespo
This filter is not only for live-action, I use it for anime often.
It is good at removing noise in certain situations in anime, but some kinds of noise and some kinds of anime aren't helped by the filter except with a high sigma (5-8) but that produces ghosting.
I have never used removedirt, so I don't know how it compares. I usually pair FFT3d with msmooth, but I am finding more and more that FFT3d on its own is better.
SirCanealot
15th June 2005, 13:12
@acrespo
This filter is not only for live-action, I use it for anime often.
It doesn't add its own grain/noise for you?
That's basically why I stopped using it ^^;; — what's the point of using it if I have to smooth after to compensate for FFT adding filesize to random frames...
This is especially the case with clean anime. When there's not much noise, whatever I do, FFT will add noise, heh...
Soulhunter
15th June 2005, 16:09
How can I do this (blend filters)?
Source=DirectShowSource("C:\Stuff\Blah.avi")
A=Source.FFT3DFilter(Sigma=1)
B=Source.Deen("a3d",3,3,3,25)
Overlay(A,B,Opacity=0.5)
Bye
DarkFoon
15th June 2005, 21:50
@SirCanealot
Actually, it doesn't add noise to my images. I usually work with TV anime captures and my capture card adds quite a bit of noise (which pisses me off so much, because it has hardware noise reducers, but the software doesn't use them)
On clean anime, I probably wouldn't use this filter, or if I did, I would use a low sigma. I have found what I consider a great way to use this filter, although it slows it down. I set my ow/oh = to 0.5*bw/bh. So if my bw/bh = 32, my ow/oh = 16. This way, I can use rather low sigmas, and remove quite a bit of noise, so I don't have to run the filter again.
SirCanealot it would be helpful if you posted a single frame of some of your anime (unprocessed) so I can better understand what you are working with. Also, I'd find it helpful if you could post the same frame, only processed with FFT3d so I can see the noise that it adds.
thanks
acrespo
15th June 2005, 22:29
I tried FFT3D in my sources (TV anime captures too), but I need a very high sigma (8-10) value to clean the image. When I apply FFT3D to all planes I need less sigma (3-5), but I always need other smooth (usualy spatial) to complete the job.
Can be implement a plane option to link all planes, or to link chroma planes in one plane, like that:
plane = 0 -> Y plane
plane = 1 -> U plane
plane = 2 -> V plane
plane = 3 -> UV plane
plane = 4 -> YUV plane
Then, I don't need to execute the filter three times to clean all planes.
DarkFoon
17th June 2005, 10:06
I asked Fizick for that a long time ago, but he said its just easier to filter each plane with a different instance.
There's no difference in either way. One way is more work for Fizick, and the other is more work for the user (but not really, all they have to do is copy/paste the filter line 3 times)
acrespo
17th June 2005, 12:16
I asked Fizick for that a long time ago, but he said its just easier to filter each plane with a different instance.
There's no difference in either way. One way is more work for Fizick, and the other is more work for the user (but not really, all they have to do is copy/paste the filter line 3 times)
But I guess that fft will run more fast if I don't need to start 3 instances. Only Fizick can confirm that of course.
Fizick
28th June 2005, 20:32
Released fft3dfilter Version 1.0 - June 27, 2005 - improved edges processing (by padding);
added svr parameter to control vertical sharpening
trevlac
28th June 2005, 21:35
@Fizick,
My comment is not really well thought out .... but that has not stopped me lately .. :D
With regard to filtering all channels faster ....
Can you implement UV as a single complex to complex DFT? U & V represent the vector that describes the chroma. I'm not really sure what this would mean to apply a filter. Maybe I'll give it a try and report back. :)
leonid_makarovsky
30th June 2005, 15:50
Released fft3dfilter Version 1.0 - June 27, 2005 - improved edges processing (by padding);
added svr parameter to control vertical sharpening
Hi Fizick.
I tried your new version yesterday. I found the couple of problems. The horizontal sharpness suffers from the same problem as in the previous version. There're vertical lines. The higher the sharpness parameter the more visible they are. I also found a bug. If you set sharpness parameter to 0, then no matter how high you set svr parameter, the vertical sharpness won't take place.
--Leonid
Fizick
30th June 2005, 17:31
Leonid,
these all are not bugs, but features of method used.
You may set "sharpen" to some small value =0.1 for example.
DarkFoon
30th June 2005, 19:57
Uh.. this may sound kind of stupid, but what was wrong with the sharpening algorithm in the first place? I never had any issues using the sharpening back in the versions before fizick first disabled it.
If I set it really high and only processed the Y plane, some black scenes with white text would have this neato "etching" effect coming off the edges. But, I work with anime almost exclusively, so maybe that's why I never had a problem.
Fizick
30th June 2005, 20:52
DarkFoon,
You say to me or to Leonid? :)
How about the last version?
leonid_makarovsky
30th June 2005, 21:55
Leonid,
these all are not bugs, but features of method used.
You may set "sharpen" to some small value =0.1 for example.
I am not critisizing. I'm giving the feedback. The features are kind of strange. Yes, if I use very small value like 0.1, I don't see the vertical lines. But it doesn't sharp the image either. So there's a proportional dependency between vertical lines (artifacts) and sharpening.
I turned the sharpening off to process my video clip.
--Leonid
Fizick
30th June 2005, 22:54
Leonid,
I want just to say, that if you set sharpen=0.1, then you may use svr=10 to get vertical sharpening only (if you want).
And i repeat, that sharpening is still experimental and not a super-puper - I included it to my filter simply because of it was easy for me.
fft3dfilter is not best ever filter - it is a filter what used certain algorithm (fft).
And i do not force anybody use it or its sharpen mode.
Hello Fizick,
Thanks for this great plug-in and many others. I frequently clean up old VHS sources with a lot of noise and this plug-in is indispensable.
When you say that edge processing has been improved in the latest version, do you mean edges of images within a frame, or the edge of the frame itself (borders)??
leonid_makarovsky
1st July 2005, 00:36
fft3dfilter is not best ever filter - it is a filter what used certain algorithm (fft).
I find your fft3d filter the best available for cleaning up VHS noise if used with PixieDust. Also wanted to thank you. And my commentary was a feedback on sharpening issues that I thought were bugs.
--Leonid
Pookie
1st July 2005, 03:22
Fizick - I wanted to thank you as well. FFT3D is a great denoiser. :)
Fizick
1st July 2005, 05:47
cwk,
Frame borders processing is improved, by padding some mirrored pixels to all borders,
and cropping them afrer processing.
Old versions changed (darken) some pixels near borders.
Leonid and all,
I am glad to get any critique,
but i will respond to it :)
Fizick
5th July 2005, 17:42
Version 1.0.1 - July 05, 2005 - fixed bug for chroma planes for YUY2 (introduced in v.1.0)
Fizick
8th July 2005, 23:21
OK, I create new version 1.1 - impoved sharpening method.
Now it is free of grid artefactes and similar to LimitedSharpen script (but is better a little IMHO :) )
Try for example pure limited sharpener:
fft3dfilter(bt=-1, sharpen=0.7)
Soulhunter
9th July 2005, 00:03
Well, in scenes with much texture detail it works very well !!!
But on flat gradients there is still a visible grid pattern... :\
Source:
http://img281.imageshack.us/img281/2888/1844source0jt.png
FFT3DFilter(BT=3, Sigma=1, Sharpen=1)
http://img281.imageshack.us/img281/9806/18448pi.png
Source:
http://img281.imageshack.us/img281/7716/2533source0gw.png
FFT3DFilter(BT=3, Sigma=1, Sharpen=1)
http://img281.imageshack.us/img281/8382/25334yu.png
Bye
Pookie
9th July 2005, 03:21
I looked at Soulhunter's stills on several PCs at work - some of the monitors show the grids, others don't.
DarkFoon
9th July 2005, 05:17
@soulhunter
I think I have an idea on how to lessen the grid artifacts (but you probably won't like it much)
try settings oh/ow = half the bh/bw.
this isn't all that special, and it slows down the processing (but I find it also produces better looking images) however, I think it might lessen the grid.
I'd appreciate a test of this theory using the same stills as above, if you have the time. (I lack the processing power, time, and sources to run the test(s) myself)
Soulhunter
9th July 2005, 06:09
@ DarkFoon
Yes, you are right... ^^
And it seems that "OX = BX / 3" is already enough !!!
FFT3DFilter(OH=16,OW=16,BH=48,BW=48,BT=3,Sigma=1,Sharpen=1)
http://img259.imageshack.us/img259/8555/18441648xxx2fx.png
FFT3DFilter(OH=16,OW=16,BH=48,BW=48,BT=3,Sigma=1,Sharpen=1)
http://img259.imageshack.us/img259/426/25331648xxx2go.png
Bye
DarkFoon
9th July 2005, 23:16
glad i could be of help ^^
although, i can still detect some gridding, but its small and insignificant.
Fizick
10th July 2005, 00:53
I will try make third attempt to make artifact-free sharpener later.
Soulhunter
10th July 2005, 03:01
glad i could be of help ^^
Well, thanks... ^^
although, i can still detect some gridding, but its small and insignificant.
True, on my 19" Syncmaster I can still spot the grid pattern...
But considering that "sharpen=1" is the max recommended value, its venial!
Bye
woutertje
11th July 2005, 18:56
I'm getting the following error:
Plugin fftw3.dll is not an Avisynth 2.5 plugin
I'm using AviSynth 2.55
Fizick
11th July 2005, 19:48
woutertje,
re-read manual. Do not try load fftw3.dll.
Soulhunter,
I think your settings (OH=16,OW=16,BH=48,BW=48) is the optimal,
i will set them as default in next version.
woutertje,
I had this problem too. fftw3.dll is not the plug-in, but is required for FFT3DFilter to work correctly. It must be placed in a directory specified by your path variable. I am running XP, put fftw3.dll in my c:\windows directory and it works. fft3dfilter.dll must go in the plug-ins directory.
ck
DarkFoon
12th July 2005, 02:07
@ Fizick
the bw/h of 48 is a better divisor into the standard DVD/TV resolution of 720x480 (or 720x576 in PAL-land, but I may be wrong...)
I often changed it to 44, or 40 because those divide nicely into the above resolution.
Anyways, a change for the good, I say!
Fizick
12th July 2005, 20:55
44=2*2*11 is not very good number, the speed will be slow.
DarkFoon
12th July 2005, 22:47
Actually, I think I stopped using 44 after you told me about that stuff. I still remember the number because I used it for a long time before that.
Fizick
13th July 2005, 17:54
Version 1.2 - July 12, 2005 - changed default block sizes bw=bh=48 and overlap sizes ow=bw/3, oh=bh/3 to finally prevent grid artifactes in sharpen mode (but speed is decreased).
ChronoCross
17th July 2005, 23:00
Feature Request: plane=3 Clean all 3 planes YUV instead of having to run 3 instances of the filter. Thanks
Fizick
19th July 2005, 21:00
This feature was already rejected.
But soon i will implement interlaced flag.
DarkFoon
20th July 2005, 00:43
This feature was already rejected.
But soon i will implement interlaced flag.
Do you mean that it will properly work on interlaced sources, instead of having to de-interlace before? Or is it something different?
So far, I've been using the "ApplyInterlacedFilter" function on my interlaced clips, but it slows processing down considerably. Would this "interlaced flag" make it so I don't need to use that anymore? If so, that's going to be great!
Fizick
20th July 2005, 17:08
Version 1.3 - July 20, 2005 - added interlaced parameter for interlaced video processing.
Now I use simple "unfold - fold" method. I flip second field (up-down) and put it to bottom of first field. Then process this combined "frame" (FFT, filter, iFFT).
Then reverted fold.
So, some small artifactes are possible near bottom.
But speed is not slowed.
Try!
Hello Fizick,
I am getting a problem with the interlaced mode in 1.3. One of the fields appears to be vertically resized incorrectly when they are getting weaved back together.
My source is YUY2, Huffyuv, interlaced. Here is my script:
AVISource("E:\DV\Clips\plain.avi")
FFT3DFilter(sigma=1, sharpen=1, interlaced=true)
Attached images (original.jpg) (After_FFT13.jpg)
DarkFoon
21st July 2005, 03:55
looks to me like the the Y plane is being imporperly processed. notice how the messed up part is gray. .... on second thought, maybe its the chroma planes that are being processed wrong. either way, it has to do with colospace. try it with YV12, and see if that changes anything.
if not, just wait a while, fizick will probably have it fixed within a few days.
Yes, converting to YV12 fixed this problem. Thank you DarkFoon.
It appears that the interlaced option currently has difficulty with YUY2 material.
Here is the new script:
AVISource("E:\DV\Clips\plain.avi")
ConvertToYV12(interlaced=true)
FFT3DFilter(sigma=1, sharpen=1, interlaced=true)
Fizick
21st July 2005, 20:08
cwk,
thanks for fast report.
Try new fixed version 1.3.1
Fizick,
That did it! Thank you for the fast fix.
cwk
DarkFoon
21st July 2005, 23:09
fizick, I have a question.
A few months back you said that you were going to open source the next release of this filter. The next release has come and gone, but no open source. Have I just not found it? Or did you change your mind?
Fizick
23rd July 2005, 21:58
Firstly i did not want to open the source.
So, I still did not change this my mind about it.
Lets return from policy to technik.
Version 1.4 - July 23, 2005 - corrected neutral level for chroma processing,
changed weighting window type with new wintype parameter.
wintype - weighting windows type (default=1 since v1.4):
0 - same analysis and synthesis half-cosine window, used in all versions before 1.4;
1 - intermediate between 0 and 2;
2 - flat analysis window, rised cosine (Hanning) synthesis window.
Weighting window wintype=0 can produce the worst grid artifactes, window type wintype=2 do not produce grid artifactes, but can produce some ringing, wintype=1 is intermediate case.
Probably it is my last attempt in grid artefactes preventing.
It is still not perfect solution, but some advance.
What next?
I think about noise pattern measure and using for filtration.
But why i want to do it? I want remove not noise, but grain with some regular spectrum.
First alpha version is almost ready, but is not very good.
Here is method (partially implemented):
User must preview clip and select some region (block) as or x-y coordinate (block x-y numbers in current alpha version) in some one arbitrary frame (by frame number). This region must contain noise only, without any image detail.
Filter make FFT of this block. This spectrum is pattern of noise spectrum.
Then we use this noise pattern spectrum in place of (previously constant) sigma for all blocks filtration (for all frames).
This generally works, but not very good.
Firstly, it is spatial only, not temporal noise pattern.
Spatial filter is not so powerful as 3D.
Probaly we can take 2 (or 3) frames to get 3D noise.
Secondly, there are windowing problem again (grid formation).
Thirdly, the manual pure noise region selection is not so easy. And its spectrum using for all regions and frames is not very reasonable too.
But some success is quite posiible. At last we can use this spectrum to get real estimation of constant sigma.
May be some sigmas-map? :)
708145
24th July 2005, 18:55
Firstly i did not want to open the source.
So, I still did not change this my mind about it.
Hi Fizick!
Is it just that you don't want others to interfere with your coding? Or do you feel it's badly documented?
Whatever your reasons, I hope you will release it once you stop developing it so that others can at least continue and/or port it to new versions of avisynth. :D
About your "noise shaping": go ahead :) The filter is already great and any improvement will bring it closer to "perfection".
Maybe you could team up with prunedtree (meet him on #xvid on freenode) since he is working on (noise) filters as well.
bis besser,
Tobias
Soulhunter
24th July 2005, 19:41
Maybe you could team up with prunedtree...
Yeah, Fizick n' Pruned...
Would be THE dream-team!
Bye
Howdy Fizick,
Thank you for the new version. I am able to safely use Sigmas above 1 on VHS captures without Gridding. The interlaced flag also allows me to skip separatefields or TDeint, which saves some time and typing :) .
I have an enhancement request for the sharpener. As interlaced fields have 1/2 vertical resolution, how about a parameter to super-sample the image vertically by a factor of 2? (or a variable) A user could use this type of feature with interlaced material to sharpen without aliasing. Would this be difficult to do?
cwk
Fizick
26th July 2005, 18:31
cwk,
did you try svr parameter to control vertical sharpening?
I do not want upsampling.
I have tried the svr option, but most of my sources are old VHS tapes of sports events with alot of built-in aliasing. I was looking for a way to remove SangNom from my filter chain.
Fizick
27th July 2005, 20:09
cwk,
it is probably line jitter?
Fizick
27th July 2005, 20:14
New Version 1.5 - July 26, 2005 - added noise pattern method
Since v1.5 it is possible to get noise pattern (shape) by spectrum analyisis of some empty block (without any objects), and then to reduce the noise with the same pattern in whole frame and in whole clip. It may be useful for removal of film (especialy amateur 8 mm) grain and analog TV capture interference.
New parameters:
pframe - noise pattern frame number (default=false)
px - noise pattern block horizontal X position (default=0)
py - noise pattern block vertical Y position (default=0)
If px=px=0, then the pattern block is defined automatically with minimal power spectral density.
pshow - show noise pattern block and its properties (default=false)
pcutoff - noise pattern cutoff frequency (relative to max) (default=0.1)
pfactor - noise pattern denoise strength (0 to 1.0, default=0, this method disabled)
In order to use noise pattern method in place of ordinary (blind) method you must:
Firstly switch show mode pshow=true, and set some non-zero value pfactor=1.0.
Then select frame number and some block position, thus the block shown must not contain any objects beside typical noise pattern.
The switch off show mode pshow=false,
and set noise reduction strength, recomended value pfactor= 0.5 to 1.0.
The best windows type for this method is wintype=2.
The sigma and beta parameters are not used in this denoising method, but you can use this method in show mode pshow=true to estimate sigma value for ordinary denoising method (it is not strictly the same, but similar value).
The noise pattern method is very experimental.
Soulhunter
27th July 2005, 23:11
Hi, Ive already played around with the new noise-pattern stuff... One thing Ive noticed is that it removes much less noise than the usual processing. Even with very high denoising values only a small amount of noise gets removed! Ok, you wrote its still very experimental, and maybe Ive just used the wrong sample or the wrong settings or so, heh? Anyway, nice concept! Another thing Ive noticed is that "bt=0" produces some weird ghosting! Is this a known problem? Coz, I cant really remember that Ive seen this behavior before... :\
Source
http://img62.imageshack.us/img62/6492/81raw2ek.png (http://imageshack.us)
FFT3DFilter(Sigma=2,BT=0)
http://img62.imageshack.us/img62/1938/81fft3dfiltersigma2bt05qe.png (http://imageshack.us)
Bye
DarkFoon
28th July 2005, 01:09
@Soulhunter
bt=0 always causes ghosting with high sigmas, and (I can only guess) high pfactors.
also, check your kratio.
basically, it averages the frames out to remove the noise (if used with high values) so you get wierd ghosting when there is motion. Personally, I don't like to use that mode because it causes artifacts with motion. I use the weiner modes because, although less powerful than kalman at noise removal, they don't cause ghosting (nearly as bad).
Soulhunter
28th July 2005, 02:47
@ DarkFoon
Thanks for the confirmation... ^^
I mainly used bt=3 n' low sigma values for my encodes...
So, probably thats the reason Ive never noticed this ghosting... ^^;
Bye
Soulhunter
28th July 2005, 19:04
Ok, the source was the last chapter of "SAW" (PAL version) Its a very noisy/grainy flick, but to make it even harder I amplified the noise with some slight sharpening. Finally I cropped/resized the filtered result to 720x384 and encoded it with XviD @ Q2 / Soulhunters v3 / 1-1-1 B-VOPs. Well, here are some short samples of the results...
The "non-denoised" version: 27.250.688 Bytes / Sample (http://rapidshare.de/files/3436632/RAW_02.avi.html)
FFT3DFilter(Sigma=2,BT=1) on all planes: 18.161.664 Bytes / Sample (http://rapidshare.de/files/3437081/2x1x3_02.avi.html)
FFT3DFilter(Sigma=2,BT=3) on all planes: 17.246.208 Bytes / Sample (http://rapidshare.de/files/3437675/2x3x3_02.avi.html)
EDIT: FFT3DFilter(PFactor=1,BT=3) on all planes: 19.668.992 Bytes / Sample (http://rapidshare.de/files/3443697/P1.avi.html)
Observation 1: A compression gain of ~30% without killing the real details! Nothing new, but... ^^
Observation 2: Bt=1 seems to keep the fluctuation/flickering of the noise while BT=3 calms its down !?!
Bye
DarkFoon
28th July 2005, 22:00
@soulhunter
thanks for the stats! those are very interesting.
do you think you could run the script again using the new noise pattern removal for comparison?
thanks!! ^^
Soulhunter
28th July 2005, 22:56
@ DarkFoon
Ok, Ive added a additional "PFactor=1" sample... ^^
@ Fizick
If I use the "px/py" params + "pshow=true" VDubMod n' MPlayer crashes... :\
Bye
acrespo
29th July 2005, 05:56
I didn't understand the difference between noise pattern and old method.
With my analog anime TV captures I am using sigma=8 in old method. When I change pfactor=1.0 it's seem that old method is better to me, because more noise was removed.
Can anybody explain the difference between methods?
DarkFoon
29th July 2005, 06:40
the noise pattern method works by you telling the filter what is noise by selecting a certain block in a certain frame. Then the filter tries to find the same noise when it filters the whole movie, and remove it. the problem with this method, is that it is very difficult to remove large ammounts of noise (in my opinion, I perfer "blind" noise removal, over this "selective").
the normal mode just looks for the noise frequencies, and then removes them. It's much better.
I'm not a mathematician, nor a programmer, so I may be wrong on these, but this is how I understand how the filter works.
Fizick, please correct me if I am wrong.
Fizick
29th July 2005, 21:36
Soulhunter,
yes, it was a bug with pshow. I fixed it in v1.5.1 today.
About your tests: I almost do not see any noise in your sources. :)
If my sources would be same as your, i never create any denoiser.
A do not see ghosting (almost)
My denoisers was developed for really poor sources.
You may use fft3d for any sources, but at your own risk :)
It is especially true for pattern mode.
Pattern mode is developed for really big gran, or some noise structure (TV interference, like Defreq).
For "white" noise, the old blind method is optimal, as Darkfoon notes.
May be, pattern mode will be improved later.
Darkfoon,
your info is correct, thanks. I very like your comments. :)
Soulhunter
29th July 2005, 22:07
I almost do not see any noise in your sources. :)
Ouch, for me this sample is veeeery noisy (at least for a DVD source) Well, with the same settings my usual DVD->1024x576 encodes eat 4000-5000kbps, but this source eats more than 7000kbps at a framesize of just 720x384... :\
If my sources would be same as your, i never create any denoiser.
You may use fft3d for any sources, but at your own risk :)
Hey, a compression gain of ~30% without loosing "real" details is fantastic! Actually I consider FFT3D as one of the best denoising filters for DVD sources, especially for high bitrate encodes where you would notice even the smallest detail loss... ^^
Thanks n' Bye
DarkFoon
29th July 2005, 23:24
Actually I consider FFT3D as one of the best denoising filters, especially for high bitrate encodes where you would notice even the smallest detail loss... ^^
Amen!
Actually, right now, I am using FFT3D in a little experiment: I am taking a TV capture and cleaning it up and then upscaling it to 1280x720 (HD ^^) and re-compressing it.
In order to make the image as clean as possible and to make it sharp, I must use FFT3D as it is the only filter best suited to the job.
OT: anybody have any reccomendations for a codec that would handle that resolution? (I was going to use WMV9-VCM)
and I can't get x264 to playback on my computer(I have FFDshow and WMP still crashes) not to mention, stupid quicktime wants to play all my mp4 files.
sorry for the tangent ^^;
Soulhunter
30th July 2005, 02:34
OT: anybody have any reccomendations for a codec that would handle that resolution? (I was going to use WMV9-VCM)
and I can't get x264 to playback on my computer(I have FFDshow and WMP still crashes) not to mention, stupid quicktime wants to play all my mp4 files.
sorry for the tangent ^^;
Well, as always... it depends on the bitrate... ^^
For higher bitrates I still prefer XviD (faster n' less smoothing than WMV9/AVC)
But for lower bitrates AVC/WMV9 should give better results (less blocking etc.)
Bye
DarkFoon
30th July 2005, 08:24
@Fizick
As I understand, BT=3 or 2 means that the filter takes the current frame and averages it with the future frame and the past frame (depending on the mode). Then, the next consecutive frame, it filters by using the original frame preceding it, not the processed version of the previous frame.
... Am I right?
well, the feature I am requesting is where the filter uses the filtered version of the previous frame, instead of the un-filtered version. As I understand this, this would be like a hybrid between weiner and kalman modes.
I think this would remove much more noise than the current situation. I think it should be a parameter, so the user could choose between straight weiner mode, and this "hybrid" mode.
Unless I'm wrong, and weiner already uses the processed version of the frame previous to the one currently being processed. This also doesn't sound like it would be much work to implement.
I would like your feedback, and correction on my theories, if I am wrong.
Fizick
31st July 2005, 12:29
New Version 1.5.2 - July 31, 2005 - fixed bug with Kalman mode (bt=0) for Athlon (introduced in v1.5)
Soulhunter,
if you uses Athlon, please re-test ghosting in Kalman mode now.
Darkfoon,
Your understanding is correct.
As i noted somehow, there are many possible different denoise method for ordinary (not-frequency) approach in other filters existed .
We could use almost any of them for frequency approach in FFT filter.
But now I prefer use scientific approved methods only :)
Wiener and Kaman is well-known optimal methods.
IMHO, your "hybrid" mode is quite similar to Kalman.
To minimize ghosting in Kalman mode, try decrease sigma.
However, i will try implement bt=4 (two prev frames) and bt=5 (two prev and next frames) Wiener modes in next version.
Soulhunter
31st July 2005, 14:30
Soulhunter,
if you uses Athlon, please re-test ghosting in Kalman mode now.
Yup, Im a Athlon user... ^^
And it seems ya bugfix solved the problem!
Original:
http://img20.imageshack.us/img20/3853/63orig0zd.png
Old version
http://img20.imageshack.us/img20/322/63old2hf.png
New version
http://img20.imageshack.us/img20/6181/63new2wc.png
Thanks n' Bye
Fizick
3rd August 2005, 20:48
Version 1.6 - August 03, 2005 - added mode bt=4; added optimized SSE version for bt=2,3; added sigma2,sigma3,sigma4 parameters for combined method.
Ñombined method: when you can directly set different noise values sigma for highest and sigma2, sigma3, sigma4 for lower frequencies. The pattern coefficients will be created internally from these sigmas values by interpolation. Set pfactor=0 for this method (internally it will be =1).
SSE version is nof faster then 3Dnow for my Athlon, but Pentium users must have some improvements. please confirm.
in last version in russian documentation
two section "bt=3" in part "Plugin has several processing modes at filter stage"
and
no section "bt=4" in part " Function parameters"
PS SSE optimisation is realy faster on my P!!!800 (~15-20%)
ЗЗЫ 2 Fizick - надеюсь ты понял мой ломанный английский :D
PPS 2All Excuse me my english (my language is russian)
Isochroma
5th August 2005, 23:45
Your excellent filter has passed muster against all others currently in the contenders' ring! It is the best, and it surpassed the rest by a wide margin.
So, I'm writing to thank you, the developer, for working so hard to help bring world-class code to the masses. Your tool is helping countless people see the digital future with greater clarity and brilliance.
I hope that you see fit to continue developing this great AVISynth plugin; and I'm also sure that for every letter like this one, there are at least a hundred users who also appreciate your work but have chosen not to express their gratitude publicly.
Fizick
6th August 2005, 01:44
AI,
Thanks for pointing to the documentation bug. I will correct it.
What is your speed gain with SSE and what is your CPU?
Isochrona,
Thank for your kindly words!
But I hope that soon I will finish this plugin development at last ! :)
(and will develop somithing else.)
cwk
6th August 2005, 07:02
Hello Fizick,
I have some questions about the sigmas now available in 1.6.
Does these indicate the sigma that will be used on a particular noise pattern that I should isolate with pframe, px and py? Or do they apply to general low frequency noise that will be determined by the tool?
Also, preliminary tests indicate the following two statements are functionally equivalent:
1. FFT3DFilter(sigma=3, sigma2=2, pframe=100, px=15, py=6, plane=0)
2. FFT3DFilter(sigma=3, plane=0)
Do the sigma2, sigma3 and sigma4 values only apply when they are greater than sigma?
FFT runs now 10-15% faster with version 1.6 on a PentiumIV. I will post more exact results this weekend.
cwk
Fizick
6th August 2005, 14:04
cwk,
sigmas will forms pattern.
they apply if any of them is defined not equal to sigma.
Fizick
6th August 2005, 15:22
Addition:
sigmas mode does not use pattern position, it is general.
More corrrect: these sigmas define some coefficint matrix (size bh * bw/2), which then used at filtering and inverse FFT stages the same way as pattern spectrum was used.
I forget to say, that prosessing in this (sigmas) mode will depend at frame synthesis stage on wintype parameter (which defines windowing of low frequencies at frame analyze and synthesis stages).
I hope, my addition do not add more confusing. :)
But I do not ask to excuse my english. :)
DarkFoon
7th August 2005, 03:57
so, the new sigma values are for the different (noise) frequencies?
using fictional (meaningless) numbers:
frequencies 100 - 200 use "sigma"
frequencies 50 - 99 use "sigma2"
frequencies 25 - 49 use "sigma3"
and frequencies 4 - 24 use "sigma4"
basically, its a way to specify specific sigmas for different frequencies, yes?
if I am understanding correctly, the user needs a way to specify the ranges for each sigma, otherwise, the filter does that, and they have no control over it.
but if that's not the case, it'd be really cool to have as a feature! :)
Imagine it, for the highs, middles, and lows of the frequency spectrum, the user could set specific sigmas.
well, I'm just rambling. sorry :P
Fizick
7th August 2005, 16:55
Darkfoon,
You are not quite correct.
The pattern coefficients will be created internally from these sigmas values by interpolation.
So, for intermediate frequency we have intermediate sigma value.
Strictly:
lets maximum (2D) frequency = 1,
at f1=1 (highest frequency) we use "sigma" value,
at f2=0.354 (middle) we use "sigma2" value,
at f3=0.177 (low) we use "sigma3" value,
at f4=0 (lowest frequency) we use "sigma4" value.
At some intermediate frequency we use intermediate sigma value, calculated by linear interpolation between nearest frequencies for sigmas given.
For example, for frequency in the middle between f2=0.354 and f1=1, we have f=(1 + 0.354)/2=0.677, and we use (sigma+sigma2)/2 value.
You can test various sigmas influence by subtract command:
i=avisource("your.avi")
fft3dfilter(i, sigma=0.01, sigma2=2,sigma3=0.01,sigma4=0.01)
subtract(i,last).levels(117,1,137,0,255)
change sigmas values and see what you get (what noise is removed).
Please understand, that this mode is experimental, and i am still not sure, how good and how useful is it.
I create it to simplify the pattern mode using.
In general, it is possible directly specify full pattern spectrum matrix, without interpolation, but it has size bh*bw/2 =1152 :)
DarkFoon
7th August 2005, 22:58
ok, i think i understand much better now.
thanks Fizick!! :)
Hi, I have a Northwood p4 2.2 GHz and the encoding time dropped by slightly more than an hour using the new version, with the old version taking slightly over 8 hours in an encoding script with multiple filters. So the gain in speed was more than 13%, considering the multiplier effect.
Thank you for your work and effort ^^
trbarry
8th August 2005, 20:55
Fizick -
Drat! ;)
This sounds like a nice filter but I just dragged through the entire thread because somewhere a dozen pages back or so you said you might open up the source.
I was thinking about writing a slightly different filter along these lines and was looking for some good open VS6 compat optimized FFT code I could use.
Anybody recommend any?
- Tom
tsp
8th August 2005, 21:31
Anybody recommend any?
http://www.fftw.org/
Fizick
8th August 2005, 21:46
trbarry,
are you really returned? It will be great!
1. The fastest open FFT code is probably FFTW at http://www.fftw.org
It is comparable by speed with Intel fft library.
I use FFTW in my 3 plugins: Depan, Defreq, and fft3dfilter.
Defreq is open source, so you can look how to use it in VS6.
2. About opening the source.
IMHO, the most important advantage of opensource is team work, contribution.
For example Defreq is open since october 2004, but nobody contribute to it (though it was not perfect and quite draft).
I hope it will be useful for you at least.
But the main reason why i do not open fft3d - i still do not believe in GPL as a real protection from theft my code by some proprietary firm.
trbarry
9th August 2005, 04:42
trbarry,
are you really returned? It will be great!
Hi Fizick -
Not really, I'm still too busy but do stop in from time to time.
1. The fastest open FFT code is probably FFTW at http://www.fftw.org
It is comparable by speed with Intel fft library.
I downloaded FFTW a couple weeks ago but never got to it. I thought it said I needed the Intel compiler or vs7 (can't remember) but I don't currently use either.
I use FFTW in my 3 plugins: Depan, Defreq, and fft3dfilter.
Defreq is open source, so you can look how to use it in VS6.
Okay, cool, I'll get Defreq instead. That should be fine.
2. About opening the source.
IMHO, the most important advantage of opensource is team work, contribution.
For example Defreq is open since october 2004, but nobody contribute to it (though it was not perfect and quite draft).
I hope it will be useful for you at least.
But the main reason why i do not open fft3d - i still do not believe in GPL as a real protection from theft my code by some proprietary firm.
No problem. My own stuff is all over the web, sometimes probably in violation of the GPL. But I've found that if I spend too much time worrying about protecting things then I don't get anything useful done anyway. And I've received a number of useful contributions. Even a couple from you IIRC. thx ;)
- Tom
Fizick
9th August 2005, 16:53
trbarry,
the most important thing about fftw using:
Do not use (and complile) its source yourself.
Simple use header and already compiled binary. The link is in defreq doc.
tsp
9th August 2005, 17:20
only compile it yourself if you want to see what fft3dfilter does send to fftw ;)
trbarry
10th August 2005, 13:53
trbarry,
the most important thing about fftw using:
Do not use (and complile) its source yourself.
Simple use header and already compiled binary. The link is in defreq doc.
That's sort of the problem. I like optimizing and tinkering with things. ;)
- Tom
videoFred
18th August 2005, 11:49
FFt is a fine denoiser, I use it together with degrainmedian() and limitedsharpen().
But sometimes I get artifacts:
http://users.telenet.be/ho-slotcars/testmap/artefacts.jpg
The artifacts are visible in the dark parts only.
I do not have them with bt=0, but bt=3 or 4 works much better.
Maybe someone could give me some hints?
Thanks!
Fred.
krieger2005
18th August 2005, 15:50
I think this is because of sharpening... this problem is because of the combination of the softener and sharpener.... but this could be wrong... try to remove "LimitedSharpen" or any other sharpener... is this affect then there? Another try: sharpen only the luma-(Y)-Channel...
cwk
18th August 2005, 18:12
@videoFred:
Although FFT is a fantastic denoiser, it has been known to leave some grid-like artifacts. It could be that these are present after you use FFT, but are only visible after sharpening with limitedsharpen. Have you tried using wintype=2 ? This was designed to help alleviate gridding.
Also, try setting your oh and ow to 1/2(bh and bw). This will slow things down further, but seems to eliminate gridding for me with wintype=1.
Hope this helps!
ck
DarkFoon
18th August 2005, 20:40
The type of artifacting you are showing there seems to be consistenet with kreiger2005 is saying. Have you tried the built-in shrpener with FFT3d? Try that instead of another sharpener, and see if it makes a difference.
also, what channels are you processing? just the luma or luma + chroma? (looks to me like luma only)
Backwoods
19th August 2005, 03:07
Have you tried the built-in shrpener with FFT3d? Try that instead of another sharpener, and see if it makes a difference.
The same result happens, the grid is there and comes out with any sharpening.
I tried the "wintype=2" and the oh/ow method cwk mention, neither helped with the grid pattern.
Is there any settings anyone can suggest that proved to them to show no grid pattern?
DarkFoon
19th August 2005, 03:27
what is your sigma? what bt mode are you using, what processor do you have, any other filters before/after fft3d?
There could be something in common with you and videoFred, because I never get any of these problems.
Backwoods
19th August 2005, 04:41
FFT3DFilter()
or
FFT3DFilter(sigma=3, plane=0,ow=8,oh=8)
or
FFT3DFilter(sigma=5,plane=0,ow=24,oh=24,wintype=2)
FFT3DFilter(sigma=5,plane=1,ow=24,oh=24,wintype=2)
FFT3DFilter(sigma=5,plane=2,ow=24,oh=24,wintype=2)
with:
LimitedSharpen(smode=1,strength=500)
to emulate what VideoFred is doing.
P4 2.8
What settings have you used and received good results?
cwk
19th August 2005, 05:13
Here is a common setup for me:
FFT3DFilter(sigma=3, bh=60, bw=60, oh=30, ow=30, plane=0, sharpen=1, smin=2, smax=5)
I would imagine the gridding would be worse for me, because the lower smin setting includes more noise. But I don't see any in dark areas.
ck
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
videoFred
21st October 2005, 15:39
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
That's the one, My mistake :eek:
And does it work now?
The newest version works both in YV12 and YUY2 colorspace.
But now I'm gone for the weekend.. byee :p
Fred.
mumdigaueln
21st October 2005, 16:04
That's the one, My mistake :eek:
And does it work now?
Fred.
No, because I didn't change anything till I entered this thread. Any other idea?
mumdigaueln
Fizick
21st October 2005, 19:25
What is your system? CPU, Memory. Windows version?
May be you have dual boot system, and put fft3w.dll to other system32?
Please, be more specific.
mumdigaueln
22nd October 2005, 00:00
@Fizick
Everything OK now. I rebooted the system. Don't know why this should have been necessary!?
Short question before I start testing: If you have a look at the script
AVISource("F:\Video\Movie1\movie1.avi")
loadplugin("E:\Programme\AviSynth\plugins\FFT3DFilter\fft3dfilter.dll")
BlindPP(quant=8, cpu2="xxxxxx", moderate_h=45, moderate_v=55)
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()
do you think that the filter sequence deblock --> crop --> denoise --> sharpen --> resize --> change of colorspace (for CCE) is OK?
Many thanks
mumdigaueln
danpos
22nd October 2005, 03:37
@mumdigaulen
"LoadPlugin" line must to be before "Avisource" line. I think that order is OK but you're who must to judge if the filters used are sufficient for you. :)
Cya!
mumdigaueln
22nd October 2005, 08:42
@danpos
Thanks for your feedback. Now testing starts. It will take some time until one has a "feeling" for a new filter.
Best regards
mumdigaueln
Fizick
4th November 2005, 17:12
Hmm, I experimentally found that default degrid was really =0 in 1.8 and 1.8.1 acidentally.
So I release new v.1.8.2 with default degrid=1.0
puffpio
5th November 2005, 05:05
Would it be better to use this before or after deinterlacing on an NTSC interlaced source?
Fizick
5th November 2005, 10:55
I think, before. But i never deinterlaced any NTSC interlaced source. :)
Revgen
5th November 2005, 19:24
I recommend deinterlacing after. I usually recieve more interlacing artifacts when denoising before.
puffpio
5th November 2005, 21:36
I recommend deinterlacing after. I usually recieve more interlacing artifacts when denoising before.
???? hahah I must be confused...the first sentence wants to deinterlace after
But the second sentence says you get more artifacts when denoising before (ie deinterlacing after)
:P
DarkNite
5th November 2005, 21:39
limitedsharpen(ss_x=2.0,ss_y=2.0,strength=70)
BicubicResize(528,480,0.33,0.33,0,0,320,240)
Why? For optimal results do the resize in limitedsharpen.
limitedsharpen(dest_x=528,dest_y=480,ss_x=2.0,ss_y=2.0,strength=70)
Putting bicubic soft after a high quality sharpening filter is just wasting clock cycles.
Revgen
5th November 2005, 21:41
???? hahah I must be confused...the first sentence wants to deinterlace after
But the second sentence says you get more artifacts when denoising before (ie deinterlacing after)
:P
Your Right. :confused:
I meant that you should denoise after you deinterlace. Denoising before deinterlacing causes interlacing artifacts.
raquete
8th November 2005, 22:47
i don't have a fast machine and fft3dfilter give good result but is very slow.
with script in D2S(Roba and cce encoder)
LoadPlugin("C:\ARQUIV~1\DVD2SVCD\dgindex\DGDecode.dll")
MPEG2Source("D:\D2S\DGINDE~1.D2V")
Import("C:\Arquivos de programas\DVD2SVCD\Tylo\RoBaConditional.avs")
FFT3DFilter(bt=-1, sharpen=0.7)
BicubicResize(720,480,0.0,0.6)
Import("D:\D2S\ResampleAudio.avs")
ResampleAudio(44100)
ConvertToYUY2()
cce is running now at speed 0.22, without the filter speed 1.0x.
this fftd3filter parameters was used to give little sharpness(from readme).
limitedsharpen run faster than ffd3dfilter?
10x!
Boulder
10th November 2005, 13:52
Can I do Very Bad Things if I use an insanely high sigma value when filtering the U channel? My DV stuff appears to have lots of noise in the U channel which can be eliminated by FFT3DFilter(sigma=25,plane=1), sometimes even with sigma=30.
Interleaving the original clip and filtered one I can't see much difference, only the ugly yellow, purple and blue spots are gone:) I just wanted to know if there's anything I should watch out for.
AVIL
10th November 2005, 14:03
@Boulder:
I think also that FFT3Dfilter can be a good chroma denoiser. Please, read my post :http://forum.doom9.org/showpost.php?p=732380&postcount=26
Bye
puffpio
10th November 2005, 16:59
how good is the sharpen w/ fft3dfilter?
previously I was running fft3dfilter on all planes, then doing a limitedsharpen..
but if I can do it all within fft3dfilter, why not? :) It's a TV source so some noise
raquete
13th November 2005, 01:42
@ puffpio
sharpen with fft3dfilter is cool but very slow.
@ all
catching quality and speed with bugs life in dvd2svcd(d2sroba) for dvd-5.
first script:
FFT3DFilter(bt=-1,sharpen=0.7)
BicubicResize(720,480,0.0,0.6)
colormatrix()
cce run at 0.22 speed,Q 10 for dvd-5 target(need ~7hours to encode)
http://img386.imageshack.us/img386/8749/15wx.th.png (http://img386.imageshack.us/my.php?image=15wx.png)
second script:
asharp(1.25,3.75)
BicubicResize(720,480,0.0,0.6)
colormatrix()
cce run at 0.93 speed,Q 11,same target(need ~01:50 to encode)
http://img386.imageshack.us/img386/632/66zt.th.png (http://img386.imageshack.us/my.php?image=66zt.png)
tiny differences in quality.
Pookie
13th November 2005, 10:23
raquete - sharpening is very nice with FFT3Dfilter, but you're right, there are faster sharpening-only plugins out there. Where FFT3Dfilter is amazing is in the denoising AND retaining the detail of the source. In that case, the slow speed is well worth the visual improvement of your target file.
puffpio
13th November 2005, 12:14
ok..so sharpening with fft3dfilter is slow..
but if I am running it anyways for it's denoising properties, will the sharpening hit not be as bad?
Fizick
13th November 2005, 16:41
puffpio,
Yes, speed will be almost the same. FFT calculation takes the most time.
raquete
15th November 2005, 20:04
tiny differences in quality. http://forum.doom9.org/showthread.php?p=737232#post737232
@ Fizick
comparing this 2 encodes FFT is better,we only need more time to encode.
thank you for FFT :)
kingmob
18th November 2005, 16:09
With using FFT i drop from about 2.40 to 0.69 in cce. Is this an expected drop in speed or am i doing something wrong?
Fizick
18th November 2005, 16:20
What is the name of this topic?
kingmob
19th November 2005, 18:47
Very slow isn't really exact. I was just wondering if maybe i missed an sse2 flag or something like that.
gst
20th November 2005, 16:40
Hi,
this is a call to avisynth gurus!
I'm trying to smooth an animation made from a game. I'm using the fft denoiser and i have great results except one thing :
the ingame text on the screen is blurred in a funny way. White strokes are perfectly handled by the denoiser, but other colors (at least blue) are totally screwed up. Here an example :
(zoom x2):
no fft denoiser
http://x.spirit.free.fr/tmp/following_normal.png
+ fft denoiser
http://x.spirit.free.fr/tmp/following_fft3d.png
The link to the two clips hook.zip 8.51Mo (http://x.spirit.free.fr/tmp/hook.zip)
As you can see the blue text is blurred and white is intact.
And my script :
AVISource("hook.avi")
ConvertToYV12()
FFT3DFilter(sigma=3,plane=1)
FFT3DFilter(sigma=3,plane=2)
FFT3DFilter(sigma=3,plane=0)
I've tried to disable different planes but the problem is still there. Anyway to prevent this or to exclude this zone (following + name) of the fft denoiser process ?
Hope you can help me, bye !
Seed
20th November 2005, 16:58
And my script :
AVISource("hook.avi")
ConvertToYV12()
FFT3DFilter works in YUY2 as well. If your original clip is in YUY2, don't convert to YV12, and see if the problem goes away.
Boulder
20th November 2005, 17:10
Or if the clip is interlaced (which game videos often are), you need to treat it in a specific way.
gst
20th November 2005, 18:11
ok, you are in the right way :thanks:
normal
http://x.spirit.free.fr/tmp/following_normal.png
fft3d + YUY2
http://x.spirit.free.fr/tmp/following_fft3d_YUY2.png
fft3 + YUY2 + interlaced true
http://x.spirit.free.fr/tmp/following_fft3d_YUY2_interl.png
So the problem come from the conversion and not from the denoiser? The result is better but there's no way to avoid this color destruction ?
Boulder
20th November 2005, 18:40
Try
AVISource("hook.avi")
AssumexFF # replace x with T for top field first, B for bottom field first video
TDeint(mode=1) # possibly type=3?
FFT3DFilter(sigma=3,plane=1)
FFT3DFilter(sigma=3,plane=2)
FFT3DFilter(sigma=3,plane=0)
AssumexFF # the same here
SeparateFields()
SelectEvery(4,0,3)
Weave()
gst
20th November 2005, 23:15
Boulder script + tdeint type 3
http://x.spirit.free.fr/tmp/following_boulder_tdint-type=3.png
The result is better (best so far) but there's still distorsion.
I think i should stay with this script because i'm not in the good thread :')
Link to a clean image with no color manipulation if someone want to make a test click (http://x.spirit.free.fr/tmp/cooller_original.png)
Leak
20th November 2005, 23:37
I'm trying to smooth an animation made from a game.
I'm just curious - if the animation was made directly from a game, why would there be a need for denoising? *wonders*
Anyhow, have you tried simply not using FFT3DFilter on the U and V planes, or using a lower sigma for them? That should lessen the impact on colored text.
np: Bring Back The Buffalo - Not Up To You (Bring Back The Buffalo)
gst
20th November 2005, 23:47
In fact the animation is made from an image sequence. There's a built-in command inside the game for taking screenshots.
Video games are higly detailled, fast, and often you'll need a ~3000kpbs for keep a decent amount of detail with a player point of view. So i'm trying new way for lowering the bitrate, motion blur + temporal smoother is a good combo.
I haven't tried a lower sigma, the problem seems to come from the color conversion. I've tried a clip with a YUY2 conversion without FFT denoiser and the "blue blug" appear. Maybe a FFT denoiser with a rgb32 input would solve the problem ?!
Boulder
21st November 2005, 08:00
Are those screenshots directly from VDub or are they from the final format?
gst
21st November 2005, 10:57
The screens above are taking with the "copy source frame to clipboard" of virtualdub then export in photoshop and saved with full quality in png.
All the screens are made from non compressed .avi
Original format of the screenshots are 800x600 tga. example (1.21Mo) (http://x.spirit.free.fr/tmp/frame_00000000.tga)
Boulder
21st November 2005, 13:03
Is the clip hook_normal.avi in the hook.zip archive the original file? If not, please provide an unprocessed sample.
I tried FFT3DFilter(sigma=3,plane=1) on the normal clip and it didn't look that bad.
gst
21st November 2005, 18:44
Yes hook_normal is the original file but with xvid compression. Here is a totally unprocessed sample but with only 24 frames due to the size.
hook_full.zip (http://x.spirit.free.fr/tmp/hook_full.zip)
Boulder
22nd November 2005, 09:32
From what I can see, the destruction of the blue letters comes from the RGB24->YV12 conversion.
Compare this to the original:
AVISource("hook_full.avi",pixel_type="RGB24")
ConverttoYV12()
So FFT3DFilter is not the one to blame :)
Maybe you should try capturing in YUY2 if possible?
raquete
22nd November 2005, 14:26
Features:
1. Works only in YV12 color format.
you're right Boulder.
gst
22nd November 2005, 16:17
I don't know if it's possible to change the color space while i'm capturing. Like i said before, the video is a sequence of tga frames. Maybe there's a trick when i'm creating the full unprocessed .avi but i don't know a thing about color space manipulation =)
Thanks for the replies Boulder and other, your help is greatly appreciated.
Boulder
22nd November 2005, 17:55
Maybe you should start a new thread in the capture forum, or do a search as there should be several possibilities to capture a game video. Bottom line is you can't avoid the conversion as XviD, DivX, MPEG1 and MPEG2 all use YV12.
Leak
22nd November 2005, 22:30
I don't know if it's possible to change the color space while i'm capturing. Like i said before, the video is a sequence of tga frames. Maybe there's a trick when i'm creating the full unprocessed .avi but i don't know a thing about color space manipulation =)
Have you tried to read the TGA files directly into AviSynth with ImageReader? Then you could at least use ConvertToYUY2() or ConvertToYV12() which probably don't screw up the colors too much...
np: Seefeel - Air Eyes (Mira Calix remix) (Warp 10+3 Remixes (Disc 2))
Fizick
22nd November 2005, 22:54
Capture is really off-topic here.
By the way, congratulations to all!
Today is anniversary of fft3dfilter creation :)
tsp
25th November 2005, 15:34
I discovered a small bug when testing fft3dfilter and fft3dgpu.
in this code line 2383 in fft3dfilter.cpp version 1.8.2
else if (bt==0) //Kalman filter
{
// get power spectral density (abs quadrat) for every block and apply filter
if ( n==0 )
{
return dst; // first frame not processed
}
dst should be changed to src because env->NewVideoFrame is used instead of env->MakeWritable
Fizick
25th November 2005, 17:36
Thanks. But it works somehow.
Oh, I use copyframe for YUY2 (fullframe).
So it is bug for YV12 if we do not filter all color planes with 3 fft3d.
I am afraid you will discover more bugs, and probably will laugh on my dilettante code.
tsp
26th November 2005, 02:59
nooo you code is very nice else I wouldn't use it in fft3dgpu :). The only thing that I don't understand is why you treat the first frames separatly because you can request negative frame from child->getframe and get frame 0. No need to treat frame 0 as special. It just waste cycles when processing all the other frames.
and yes the bug only appears when using yv12.
Fizick
26th November 2005, 12:29
I never try to request negative frame numbers.
I do not see any info about it in Avisynth plugin SDK. I do not know, may be in next version it will result in exception?
So, I am over-cautious probably.
Moreover, I do not see any real (complete) SDK :( It's a pity.
tsp
26th November 2005, 15:42
It's only because I made the multithreading modification to avisynth that I discovered this in the cache:
n = min(vi.num_frames-1, max(0,n)); // Inserted to avoid requests beyond framerange.
But it is a pity that it is neccesary to run a debug build of avisynth to figure out how the non-documented stuff works.
Fizick
27th November 2005, 23:09
This bug is fixed in v1.8.3
Egh
29th November 2005, 04:10
This bug is fixed in v1.8.3
Thanks for your job btw :) FFT3DFilter is one of my favorites for some heavy-duty noise removal in complicated cases, especially on fadings, where lots of temporal filters screw up.
A small sidenote: though you updated english page on your site, but you haven't done russian, and the last version on that page is 1.8.2 :)
BTW, a question: i used FFT3DFilter (iirc it was 1.8.0 or so) for some serious sharpening of blurred material. It worked ok, but i noticed on the filtered source some kind of shimmering edges, especially on dynamic scenes (scrolling/panning).
Could this kind of effect caused by FFT3D and if so, what setting can reduce that effect? (i was using bt=-1 with sharpen=0.75 iirc).
Also, sometimes is a bit tough to understand documentation, even in russian :P For instance, sharpen setting could be >1.0. What is the difference from <1.0 and why strengh >1.0 is "not good"?
Fizick
29th November 2005, 22:35
Egh,
Thanks for thanks :)
Try check my site again. The last version must be 1.8.4 now ;)
(added multi-plane option)
No comment about shimmering.
But deblurring is not the same as sharpening.
sharpen <1.0 is only for aproximate (reasonable) value in order to nobody try use some crazy values about 1000 :)
So you can use 1.5 freely :)
It is "not good", but "not very bad" :)
Egh
30th November 2005, 00:14
Egh,
Thanks for thanks :)
Try check my site again. The last version must be 1.8.4 now ;)
(added multi-plane option)
No comment about shimmering.
But deblurring is not the same as sharpening.
sharpen <1.0 is only for aproximate (reasonable) value in order to nobody try use some crazy values about 1000 :)
So you can use 1.5 freely :)
It is "not good", but "not very bad" :)
multi-plane is rather good idea, though it's 2x slower then, right? :) (color planes are less resolution than luma, naturally).
what about cutoff params? smin and smax. What is behind those params and why are they 4.0 and 20 by default? I remember I tried >20 and it usually only enhanced sharpness.
Well, for those purposes I tried (see sample in Limited Sharpen thread) so far my filtering chain using FFT3D (with bt=-1) provides b3st results. Not ideal, not removing gaussian blurring or halos completely, far from that. But it can *reasonably*well* increase perceived sharpness of the picture and yet not create noisy artefacts (causual filtering aimed at gaussian blur removal creates so much noise that a serious temporal denoiser needs to be applied, inspite original is very clean and doesnt' need any serious denoising).
Why no comments on shimmering? :P Can I provide you with a sample (video, not stills, cause you notice it only on animated scenes).
Fizick
30th November 2005, 23:46
1. smin protects from increasing the noise.
smax protects against oversharping.
Try set smin=0 and smax=1000 to create simple stupid strong (but slow) sharpening.
2. fft3dfilter still has no option to remove halo, so why it must remove it? :)
But it will not increase it!
Egh
1st December 2005, 01:15
Can you be more specifics on details of noise protection?
2. Halos are not removed by your filter, i also use other filters in the chain. But w/o your filter sharpening the perceived quality of the result is rather poor.
puffpio
1st December 2005, 06:13
revisiting a question I had a while ago...
what would give better picture quality:
1)
TDeint()
FFT3DFilter(sigma=3, plane=4, bt=4, sharpen=0.7)
2)
FFT3DFilter(sigma=3, plane=4, bt=4, sharpen=0.7, interlaced=true)
TDeint()
my gut tells me #3 since if the fields are interlaced, then the noise should be spread within a frame like that....
Boulder
1st December 2005, 06:54
It's recommended to deinterlace/IVTC before doing anything else. There are a few exceptions to the recommendation, but that's just because they don't work well with deinterlaced/IVTC'd material.
Egh
1st December 2005, 14:00
revisiting a question I had a while ago...
what would give better picture quality:
1)
TDeint()
FFT3DFilter(sigma=3, plane=4, bt=4, sharpen=0.7)
2)
FFT3DFilter(sigma=3, plane=4, bt=4, sharpen=0.7, interlaced=true)
TDeint()
my gut tells me #3 since if the fields are interlaced, then the noise should be spread within a frame like that....
My experience is to use FFT3D to decrease the noise created by TDeint() in some specific cases, most notable fadings. So definately after.
raquete
1st December 2005, 17:00
@ Fizick
i have one slow machine and i use fft3d for sharp.the default is (bt=-1,sharpen=0.7) but loading .avs scripts in vdubmod,i see that using (bt=-1,sharpen=0.4) is what i really like.
i don't understand all parameters but comparing your ffft3d with others sharpen filters,your is the winner.
excuse my newby question :o : have any other way to adjust fft3dfilter to get seamless result as (bt=-1,sharpen=0.4) to encode a little fast?
thanks.
Fizick
2nd December 2005, 11:21
raquete,
You may try to decrease overlap sizes. But check gridding!
raquete
3rd December 2005, 19:11
no way my friend.the real problem is my old and slow duron 1.8. :mad:
but i have patience and i'm waiting for a new fft3dfilter faster version in next future.
thank you very much Fizick. ;)
DarkFoon
4th December 2005, 06:48
Happy anneversary, fizick and FFT3D!!!
Sorry, I haven't been around.
the forum quit notifying me of new posts....
Fizick
4th December 2005, 11:51
Version 1.8.5 - 4 December 2005 - fixed bug with memory leakage in constructor (thanks to tsp).
Fizick
4th December 2005, 12:04
DarkFoon, thanks :)
By the way this thread has 461 replies now.
It is record (top place) for two Avisynth forums ("MPEGDecoder.dll (Direct VOB/M2v -> AviSynth)" has 457, "Another motion adaptive deinterlacer and smart bobber" has 424, "Here is LimitedSharpen()" has only 333) , and it is 33-th place in whole doom9 forum! :) :devil:
raquete
4th December 2005, 15:01
then you deserve another congratulation and thanks for the new version!
:)
Fizick
4th December 2005, 15:54
fft3dfilter is not only very slow itself :(, but its development is very slow too. :)
DarkFoon
11th December 2005, 23:24
Hey Everybody!
I've got a very early x-mas gift for you all.
I've found a very effective bunch of FFT3D settings.
I use them to remove noise from my TV captures (mainly anime, but it worked well on a law & order episode with more noise than usual)
I have a hauppauge PVR-250, if that means anything to you guys.
The video frame size was 704x480(both divisible by 16)
And without further ado, the settings!
fft3dfilter(sigma=3, sigma2=5, sigma3=10, sigma4=20, plane=0, bt=3, bw=16, bh=16, ow=8, oh=8, sharpen=0.3, smin=20, smax=1000, wintype=2, kratio=1.0, measure=true, interlaced=false, degrid=1)
It works great with every source I've used. High ammounts of detail retained, while removing all the noise! It's also not too slow.
(I'd provide screen shots, but I've moved all my video work to another computer with no internet, so I can't)
Merry Christmas ya'll (or whatever you celebrate!)
cwk
11th December 2005, 23:36
You beat me to it DarkFoon!
Here is what I use:
one=clip
two=one.FFT3dFilter(bh=32, bw=32, oh=16, ow=16, sigma=1, sigma2=1, sigma3=4, sigma4=16, plane=0)
repair(two, one, 16)
FFT3dFilter(bh=32, bw=32, oh=16, ow=16, sigma=1, sigma2=1, sigma3=4, sigma4=16, plane=3)
The higher sigmas in the lower frequency band take away a tremendous amount of noise, while the lower sigmas in higher frequencies leave details. I use this for VHS caps.
DarkFoon
12th December 2005, 01:39
hehehe.
To filter my chroma, I use FFT3dGPU. I put as many filters as I can before it (a geforce fx5200 is slow compared to FFT3D) and it lessens the slowness.
The settings for FFT3DGPU I can't remember off the top of my head, but its something like 16=bh=bw, mode=0, degrid=5, sigma=10. It works pretty good, and cleans up most of the chroma noise.
one question, what is "repair( two, one, 16)"?
I've never heard of it before
foxyshadis
12th December 2005, 03:25
A filter in the removegrain package (http://www.removegrain.de.tf/) similar to removegrain, but that uses a second guide clip to lessen artifacts (in some cases, I never tried it with fft3d).
cwk
12th December 2005, 03:58
A filter in the removegrain package similar to removegrain, but that uses a second guide clip to lessen artifacts (in some cases, I never tried it with fft3d).
Exactly. I believe repair was originally designed to "repair" artifacts left over by temporal denoisers. I like the way it restores crispness to a clip that has been mildly blurred by FFT. I put the chroma cleaning after repair for a stronger effect. Repair mitigates the effects of whatever filter you are applying to your original clip....
Egh
12th December 2005, 17:46
Exactly. I believe repair was originally designed to "repair" artifacts left over by temporal denoisers. I like the way it restores crispness to a clip that has been mildly blurred by FFT. I put the chroma cleaning after repair for a stronger effect. Repair mitigates the effects of whatever filter you are applying to your original clip....
Repair is a counterpart for RemoveGrain's filter Cleanse() iirc.
So it was developed to remove artifacts creates by Cleanse() usage (which is very powerful filter indeed, though have unique-looking artifacts ^^). As for restoration after FFT3D... Sounds quite good idea to try at least, i'll run some experiments to see if it's good in my cases.
Isochroma
23rd December 2005, 03:42
Any avs script containing FFT3DFilter() will cause VFAPI 1.0.5 to throw an error and abort... ??
Fizick
23rd December 2005, 12:08
Isochroma,
I do not use VFAPI.
But please say: FFT3dfilter, Avisynth versions, script, system config.
What application do you use with VFApi?
IT is very simple questions.
Do you have error with more old FFT3Dfilter version?
Isochroma
23rd December 2005, 18:01
VFAPI 1.0.5
AVISynth 2.5.6 alpha 071005
VirtualDub 1.5.10
AVS Script:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Decomb521.dll")
MPEG2Source("filename.d2v")
Telecide(order=1)
Decimate(cycle=5, mode=0)
LimitedSharpen(ss_x=2.0, ss_y=2.0, Smode=3, strength=800)
FFT3DFilter(sigma=3,plane=4)
When the avs file is dropped into the VFAPI window, CPU does 100% for about 4 seconds, then nothing.
When the Add Job button is pressed and avs file is selected and opened, a window pops up saying "File 'filename.avs' is invalid". If this is done twice with the same instance of the program then the file, when opened, will cause a peculiar dialog to appear:
http://www.isochroma.com/Testfiles/Misc/vfapi-error2.png
URL path is case sensitive.
Because of this problem, I finally learned how to use ffdshow's AVIS maker! Works fine, if you use absolute paths for absolutely everything in the script...
DarkFoon
23rd December 2005, 19:01
you don't need to use absolute paths with AVIS if you store the resulting file in the same directory as your AVS.
at least I've never had to...
Fizick
23rd December 2005, 23:39
Yes, i make a short test and confirm the problem of fft3dfilter with VFAPI-converter.
(but is is not regular, sometimes for small frames it works).
Workaround: disable fft3dfilter in script, make fake avi, and re-enable fft3dfilter.
It must works. So, it is probably problem with VFAPI-converter , may be because of time delay.
Debug info:
DGVfapi: error (Unknown) loading avisynth script!
DarkFoon
24th December 2005, 05:18
maybe if you set measure=false it will work?
redfordxx
31st December 2005, 18:41
Hi,
I must say this is nice all-in-one filter: denoising, deblocking, deringing, deinterlacing...;-)
Thanks for it.
Only on larger areas I experience colorgradients... anybody noticed it? And been solving it?
redfordxx
2nd January 2006, 17:32
When taking noise pattern, it is looking only at one frame or on multiple frames (acc. to bt)?
DarkFoon
2nd January 2006, 21:40
The mode that uses px and py, only uses 1 frame, and you must specify that frame with the pframe= parameter.
I wonder that if you leave pframe= at default (do not specify it) if it looks at that block (specified by px and py) in every frame.... hmm.
redfordxx
2nd January 2006, 21:54
Thanks
Another question.
When taking noise pattern, will the noise patterns from following samples be the same?
Sample 1:
110 115 110 105 110
Sample 2:
150 155 150 145 150
(it's only + 40)
I other words: Does offset make difference?
redfordxx
6th January 2006, 19:09
Well I will share my noise-weapon.
It is in three parts.
1) script for searching the noise pattern
2) script with list of patterns
3) denoising script
With 1) I will search for the noisy frames and the pattern area. In virtualdub.
I will write it down to the 2), which I have opened in anouther instance of virtual dub. As I am going thru the clip, I am instantly changing the parameters and reloading the (F2) the clips, so the listclip 2) is growing. I can compare already found noise and new found noise by swiching the VD's.
Finally I wil choose noise I like from the list and look at the result in the script 3).
Periodical clip reloading increases memory requirement, so sometimes it is necessary to reopen it. I am suspicious MVTools are the cause of that...
[EDIT] I changed - improved it... now there are 2 more files... one for data and one for fast searching the noise
redfordxx
6th January 2006, 19:15
noisesearch.avs
Import ("noisedata.avs")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\TIVTC.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\mt_masktools.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\MVtools.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\fft3dfilter.dll")
mpeg2source("test.d2v",cpu2="xxxxxx",moderate_h=30, moderate_v=50)
crop(8,64,-8,-64)
AssumeTFF
o=TFM(order=-1,field=-1,mode=1,PP=6,ovr="",input="",output="tivtc1.log",debug=true,display=false,slow=0,mChroma=false,cthresh=10,MI=1,chroma=false,blockx=16,blocky=16,mthresh=5,d2v="")
g5=o.MyConvolution(5,25)
StackVertical(o,g5)
noisesetup.avs
Import ("noisedata.avs")
#tested area
is_=true
block_h_=48
block_w_=48
#frame_=
spot_x_=360
spot_y_=0
plane_=4
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\TIVTC.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\mt_masktools.dll")
#LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\masktools.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\MVtools.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\fft3dfilter.dll")
mpeg2source("test.d2v",cpu2="xxxxxx",moderate_h=30, moderate_v=50)
crop(8,64,-8,-64)
AssumeTFF
o=TFM(order=-1,field=-1,mode=1,PP=6,ovr="",input="",output="tivtc1.log",debug=true,display=false,slow=0,mChroma=false,cthresh=10,MI=1,chroma=false,blockx=16,blocky=16,mthresh=5,d2v="")
frames=Framecount(o)
a3=o.mt_Convolution("1 1 1", "1 1 1",y=3,u=3,v=3)
a5=o.mt_Convolution("1 1 1 1 1", "1 1 1 1 1",y=3,u=3,v=3)
a7=o.mt_Convolution("1 1 1 1 1 1 1", "1 1 1 1 1 1 1",y=3,u=3,v=3)
a9=o.mt_Convolution("1 1 1 1 1 1 1 1 1", "1 1 1 1 1 1 1 1 1",y=3,u=3,v=3)
a11=o.mt_Convolution("1 1 1 1 1 1 1 1 1 1 1", "1 1 1 1 1 1 1 1 1 1 1",y=3,u=3,v=3)
d3=Subtract(o,a3).ColorYUV(off_y=2)
d5=Subtract(o,a5).ColorYUV(off_y=2)
d7=Subtract(o,a7).ColorYUV(off_y=2)
d9=Subtract(o,a9).ColorYUV(off_y=2)
d11=Subtract(o,a11).ColorYUV(off_y=2)
g5=o.MyConvolution(5,25)
g3=o.MyConvolution(3,25)
p3=d3.crop(spot_x_,spot_y_,block_w_*2,block_h_*2).mt_lut(y=Select(plane_,3,-128,-128,-128,3),u=Select(plane_,-128,3,-128,3,3),v=Select(plane_,-128,-128,3,3,3)).AddBorders(0,0,block_w_,0)
p5=d5.crop(spot_x_,spot_y_,block_w_*2,block_h_*2).mt_lut(y=Select(plane_,3,-128,-128,-128,3),u=Select(plane_,-128,3,-128,3,3),v=Select(plane_,-128,-128,3,3,3)).AddBorders(0,0,block_w_,0)
p7=d7.crop(spot_x_,spot_y_,block_w_*2,block_h_*2).mt_lut(y=Select(plane_,3,-128,-128,-128,3),u=Select(plane_,-128,3,-128,3,3),v=Select(plane_,-128,-128,3,3,3)).AddBorders(0,0,block_w_,0)
p9=d9.crop(spot_x_,spot_y_,block_w_*2,block_h_*2).mt_lut(y=Select(plane_,3,-128,-128,-128,3),u=Select(plane_,-128,3,-128,3,3),v=Select(plane_,-128,-128,3,3,3)).AddBorders(0,0,block_w_,0)
p11=d11.crop(spot_x_,spot_y_,block_w_*2,block_h_*2).mt_lut(y=Select(plane_,3,-128,-128,-128,3),u=Select(plane_,-128,3,-128,3,3),v=Select(plane_,-128,-128,3,3,3))
pg3=g3.crop(spot_x_,spot_y_,block_w_*2,block_h_*2).mt_lut(y=Select(plane_,3,-128,-128,-128,3),u=Select(plane_,-128,3,-128,3,3),v=Select(plane_,-128,-128,3,3,3)).AddBorders(0,0,block_w_,0)
pg5=g5.crop(spot_x_,spot_y_,block_w_*2,block_h_*2).mt_lut(y=Select(plane_,3,-128,-128,-128,3),u=Select(plane_,-128,3,-128,3,3),v=Select(plane_,-128,-128,3,3,3))
p=StackHorizontal(p3,p5,p7,p9,p11)
p=p.ColorYUV(cont_y=24*256,cont_u=24*256,cont_v=24*256).AddBorders(0,0,o.width-p.width,block_h_)
pg=StackHorizontal(pg3,pg5)
pg=pg.AddBorders(0,0,o.width-pg.width,block_h_)
p=StackVertical(p,pg)
p=p.AddBorders(0,0,0,o.height-p.height)
v=o.crop(spot_x_,spot_y_,block_w_*2,block_h_*2).mt_lut(y=Select(plane_,3,-128,-128,-128,3),u=Select(plane_,-128,3,-128,3,3),v=Select(plane_,-128,-128,3,3,3)).AddBorders(0,0,o.width-block_w_*2,o.height-block_h_*2)
StackVertical(StackHorizontal(p,g3),StackHorizontal(v,o))
#StackVertical(d5.ColorYUV(cont_y=24*256,cont_u=24*256,cont_v=24*256),o)#.mt_lut(y=3,u=-128,v=-128)
spot_? is topleft starting point of the pattern in the block_?
you need latest masktools, otherwise convolution crashes
redfordxx
6th January 2006, 19:21
noiselist.avsImport ("noisedata.avs")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\TIVTC.dll")
#LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\mt_masktools.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\masktools.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\MVtools.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\fft3dfilter.dll")
mpeg2source("test.d2v",cpu2="xxxxxx",moderate_h=30, moderate_v=50)
crop(8,64,-8,-64)
AssumeTFF
o=TFM(order=-1,field=-1,mode=1,PP=6,ovr="",input="",output="tivtc1.log",debug=true,display=false,slow=0,mChroma=false,cthresh=10,MI=1,chroma=false,blockx=16,blocky=16,mthresh=5,d2v="")
g5=o.MyConvolution(5,25)
# here are noise patterns
g5.trim(frame0,-1).crop(spot_x0,spot_y0,block_w0*2,block_h0*2).mt_lut(y=Select(plane0,3,-128,-128,-128,3),u=Select(plane0,-128,3,-128,3,3),v=Select(plane0,-128,-128,3,3,3)).AddBorders(block_w0*3,0,o.width-block_w0*5,o.height-block_h0*2)
(is1==false) ? last : last+g5.trim(frame1,-1).crop(spot_x1,spot_y1,block_w1*2,block_h1*2).mt_lut(y=Select(plane1,3,-128,-128,-128,3),u=Select(plane1,-128,3,-128,3,3),v=Select(plane1,-128,-128,3,3,3)).AddBorders(block_w1*3,0,o.width-block_w1*5,o.height-block_h1*2)
(is2==false) ? last : last+g5.trim(frame2,-1).crop(spot_x2,spot_y2,block_w2*2,block_h2*2).mt_lut(y=Select(plane2,3,-128,-128,-128,3),u=Select(plane2,-128,3,-128,3,3),v=Select(plane2,-128,-128,3,3,3)).AddBorders(block_w2*3,0,o.width-block_w2*5,o.height-block_h2*2)
(is3==false) ? last : last+g5.trim(frame3,-1).crop(spot_x3,spot_y3,block_w3*2,block_h3*2).mt_lut(y=Select(plane3,3,-128,-128,-128,3),u=Select(plane3,-128,3,-128,3,3),v=Select(plane3,-128,-128,3,3,3)).AddBorders(block_w3*3,0,o.width-block_w3*5,o.height-block_h3*2)
#(is4==false) ? last : last+g5.trim(frame4,-1).crop(spot_x4,spot_y4,block_w4*2,block_h4*2).mt_lut(y=Select(plane4,3,-128,-128,-128,3),u=Select(plane4,-128,3,-128,3,3),v=Select(plane4,-128,-128,3,3,3)).AddBorders(block_w4*3,0,o.width-block_w4*5,o.height-block_h4*2)
noisedata.avsfunction FFTDenoise(clip source_, clip pattern_, int frame_, int spot_x_, int spot_y_, int block_w_, int block_h_, int plane_, int contrast_)
{
c=pattern_.trim(frame_,-1).crop(spot_x_,spot_y_,block_w_*2,block_h_*2).mt_lut(y=Select(plane_,3,-128,-128,-128,3),u=Select(plane_,-128,3,-128,3,3),v=Select(plane_,-128,-128,3,3,3))
c=c.ColorYUV(cont_y=contrast_,cont_u=contrast_,cont_v=contrast_)
c=c.AddBorders(0,0,source_.width-c.width,source_.height-c.height)
c=c.AssumeFPS(source_.framerate())+source_
c=c.fft3dfilter(pshow=false,pcutoff=0.02,pframe=0, pfactor=1.0, px=1, py=1, plane=plane_, bt=3, bw=block_w_, bh=block_h_, ow=block_w_/2, oh=block_h_/2, wintype=2, kratio=2.0, measure=true, interlaced=false, degrid=1)
c=c.trim(1,0)
return c
}
function MyConvolution(clip source_, int type_, float enhance_)
{
matrix_="1"
matrix_=(type_==3) ? "-1 -1 -1 -1 8 -1 -1 -1 -1" : matrix_
matrix_=(type_==5) ? "-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 24 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1" : matrix_
divisor_ = 9.0/enhance_
divisor_= (type_==5) ? 25.0/enhance_ : divisor_
g5y=source_.mt_lut(y=3,u=-128,v=-128).ConvertToRGB32("PC.601").GeneralConvolution(bias=128,matrix=matrix_,divisor=divisor_,auto=false).ConvertBackToYUY2("PC.601").ConvertToYV12()
g5u=source_.UtoY.mt_lut(y=3,u=-128,v=-128).ConvertToRGB32("PC.601").GeneralConvolution(bias=128,matrix=matrix_,divisor=divisor_,auto=false).ConvertBackToYUY2("PC.601").ConvertToYV12()
g5v=source_.VtoY.mt_lut(y=3,u=-128,v=-128).ConvertToRGB32("PC.601").GeneralConvolution(bias=128,matrix=matrix_,divisor=divisor_,auto=false).ConvertBackToYUY2("PC.601").ConvertToYV12()
return YtoUV(g5u,g5v,g5y)
}
#all planes dots in blocks
is0=true
block_h0=16
block_w0=16
frame0=4653
spot_x0=352
spot_y0=0
plane0=4
#blockiness
is1=true
block_h1=32
block_w1=48
frame1=4644
spot_x1=8
spot_y1=208
plane1=4
#
is2=true
block_h2=32
block_w2=32
frame2=4643
spot_x2=8
spot_y2=208
plane2=4
is3=false
here are blocks with noise pattern parameters. is?=true enables them in the scripts, where they are imported
redfordxx
6th January 2006, 19:43
Import ("noisedata.avs")
g_enhance=2#increase strenght when g? patteren is used (does not work for d? --- there is needed ColorYUV)
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\TIVTC.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\masktools.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\MVtools.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\fft3dfilter.dll")
LoadPlugin("C:\Program Files\Multimedia\AviSynth 2.5\plugins\undot.dll")
mpeg2source("test.d2v",cpu2="xxxxxx",moderate_h=30, moderate_v=50)
#crop(8,64,-8,-64)
crop(8,64,-72,-64)#crop, so it fits the screen (I have 1920x1200;-)
AssumeTFF
o=TFM(order=-1,field=-1,mode=1,PP=6,ovr="",input="",output="tivtc1.log",debug=true,display=false,slow=0,mChroma=false,cthresh=10,MI=1,chroma=false,blockx=16,blocky=16,mthresh=5,d2v="")
a3=o.mt_Convolution("1 1 1", "1 1 1",y=3,u=3,v=3)
a5=o.mt_Convolution("1 1 1 1 1", "1 1 1 1 1",y=3,u=3,v=3)
a7=o.mt_Convolution("1 1 1 1 1 1 1", "1 1 1 1 1 1 1",y=3,u=3,v=3)
a9=o.mt_Convolution("1 1 1 1 1 1 1 1 1", "1 1 1 1 1 1 1 1 1",y=3,u=3,v=3)
a11=o.mt_Convolution("1 1 1 1 1 1 1 1 1 1 1", "1 1 1 1 1 1 1 1 1 1 1",y=3,u=3,v=3)
d3=Subtract(o,a3).ColorYUV(off_y=2)
d5=Subtract(o,a5).ColorYUV(off_y=2)
d7=Subtract(o,a7).ColorYUV(off_y=2)
d9=Subtract(o,a9).ColorYUV(off_y=2)
d11=Subtract(o,a11).ColorYUV(off_y=2)
g5=o.MyConvolution(5,g_enhance)
vb = o.MVAnalyse(isb = true,blksize=4,chroma=true,search=3,searchparam=2,pel=2,idx=1,truemotion=true)
cb = o.MVFlow(vb, mode = 0,idx=1,thSCD1=300,thSCD2=130)
bb=mt_lutxy(cb,o,"x y - abs 4 > 0 255 ?",y=3,u=3,v=3)
mb=MaskedMerge(o,cb,bb,y=3,u=3,v=3)
vf = o.MVAnalyse(isb = false,blksize=4,chroma=true,search=3,searchparam=2,pel=2,idx=1,truemotion=true)
cf = o.MVFlow(vf, mode = 0,idx=1,thSCD1=300,thSCD2=130)
bf=mt_lutxy(cf,o,"x y - abs 4 > 0 255 ?",y=3,u=3,v=3)
mf=MaskedMerge(o,cf,bf,y=3,u=3,v=3)
i=Interleave(mf,o,mb)
#here is denoising - you can compare f0 with f1
f0=i
#f0= (is0==false) ? f0 : f0.FFTDenoise(g5,frame0,spot_x0,spot_y0,block_w0,block_h0,plane0,0)
#f0= (is1==false) ? f0 : f0.FFTDenoise(g5,frame1,spot_x1,spot_y1,block_w1,block_h1,plane1,0)
#f0= (is2==false) ? f0 : f0.FFTDenoise(g5,frame2,spot_x2,spot_y2,block_w2,block_h2,plane2,0)
#f0= (is3==false) ? f0 : f0.FFTDenoise(g5,frame3,spot_x3,spot_y3,block_w3,block_h3,plane3,0)
#f0= (is4==false) ? f0 : f0.FFTDenoise(g5,frame4,spot_x4,spot_y4,block_w4,block_h4,plane4,0)
f0=f0.SelectEvery(3,1)
f1=i
#f1= (is0==false) ? f1 : f1.FFTDenoise(d5,frame0,spot_x0,spot_y0,block_w0,block_h0,plane0,Int(g_enhance*256-256))
f1= (is0==false) ? f1 : f1.FFTDenoise(g5,frame0,spot_x0,spot_y0,block_w0,block_h0,plane0,0)
#f1= (is1==false) ? f1 : f1.FFTDenoise(g5,frame1,spot_x1,spot_y1,block_w1,block_h1,plane1,0)
#f1= (is2==false) ? f1 : f1.FFTDenoise(g5,frame2,spot_x2,spot_y2,block_w2,block_h2,plane2,0)
#f1= (is3==false) ? f1 : f1.FFTDenoise(g5,frame3,spot_x3,spot_y3,block_w3,block_h3,plane3,0)
#f1= (is4==false) ? f1 : f1.FFTDenoise(g5,frame4,spot_x4,spot_y4,block_w4,block_h4,plane4,0)
f1=f1.SelectEvery(3,1)
#for testing purposes - otherwise f? would be output
f0a3=f0.mt_Convolution("1 1 1", "1 1 1",y=3,u=3,v=3)
f0a5=f0.mt_Convolution("1 1 1 1 1", "1 1 1 1 1",y=3,u=3,v=3)
f0a7=f0.mt_Convolution("1 1 1 1 1 1 1", "1 1 1 1 1 1 1",y=3,u=3,v=3)
f0a9=f0.mt_Convolution("1 1 1 1 1 1 1 1 1", "1 1 1 1 1 1 1 1 1",y=3,u=3,v=3)
f0a11=f0.mt_Convolution("1 1 1 1 1 1 1 1 1 1 1", "1 1 1 1 1 1 1 1 1 1 1",y=3,u=3,v=3)
f0d3=Subtract(f0,f0a3).ColorYUV(off_y=2)
f0d5=Subtract(f0,f0a5).ColorYUV(off_y=2)
f0d7=Subtract(f0,f0a7).ColorYUV(off_y=2)
f0d9=Subtract(f0,f0a9).ColorYUV(off_y=2)
f0d11=Subtract(f0,f0a11).ColorYUV(off_y=2)
f1a3=f1.mt_Convolution("1 1 1", "1 1 1",y=3,u=3,v=3)
f1a5=f1.mt_Convolution("1 1 1 1 1", "1 1 1 1 1",y=3,u=3,v=3)
f1a7=f1.mt_Convolution("1 1 1 1 1 1 1", "1 1 1 1 1 1 1",y=3,u=3,v=3)
f1a9=f1.mt_Convolution("1 1 1 1 1 1 1 1 1", "1 1 1 1 1 1 1 1 1",y=3,u=3,v=3)
f1a11=f1.mt_Convolution("1 1 1 1 1 1 1 1 1 1 1", "1 1 1 1 1 1 1 1 1 1 1",y=3,u=3,v=3)
f1d3=Subtract(f1,f1a3).ColorYUV(off_y=2)
f1d5=Subtract(f1,f1a5).ColorYUV(off_y=2)
f1d7=Subtract(f1,f1a7).ColorYUV(off_y=2)
f1d9=Subtract(f1,f1a9).ColorYUV(off_y=2)
f1d11=Subtract(f1,f1a11).ColorYUV(off_y=2)
f1g5=f1.MyConvolution(5,25)
f1d5n=Subtract(f1a5,f1).ColorYUV(off_y=2)
f1d5s=Subtract(f1a5,f1d5n.mt_lut("x 128 - abs 2 > x 128 ?",y=3,u=3,v=3)).ColorYUV(off_y=2)
s0=Subtract(o,f0).ColorYUV(off_y=2).ColorYUV(cont_y=24*256,cont_u=24*256,cont_v=24*256)
s1=Subtract(o,f1).ColorYUV(off_y=2).ColorYUV(cont_y=24*256,cont_u=24*256,cont_v=24*256)
StackVertical(StackHorizontal(f1,f0,o),StackHorizontal(f1g5,s1,o.MyConvolution(5,25)))
here you can observe and compare, which pattern works best for you...and which d* or g* clip for given pattern
This script works for me exactly as it is. However, somebody reported error "Splice: Video framerate doesn't match"
Search for the reason here: ".AssumeFPS(i.framerate())" this is beacuse the FPS is increased with Interleave, but maybe it is not 100%.
redfordxx
6th January 2006, 20:02
There are things to improve, maybe you can help:
1-motion estimation is not very well tuned, and so the scene change decision.
2-are there general convolution filters with bigger kernel than GeneralConvolution (I think it has 5x5)? Moreover, it is not YV12.
3-What happens, when the noise is not everywhere in the referenced pattern block?
4-what is best method for using multiple noise patterns?
Example for 2 patterns:
a) get pattern1 --> MVFlow --> FFT3D pattern1 --> get pattern2 --> MVFlow --> FFT3D pattern2
-this is probably correct but slooow, lets forget it
b) get pattern1 --> MVFlow --> FFT3D pattern1 --> get pattern2 --> FFT3D pattern2
c) get pattern1 get pattern2 --> MVFlow --> FFT3D pattern1 --> FFT3D pattern2
d) get pattern1 get pattern2 create patternmix --> MVFlow --> FFT3D patternmix
now how to create patternmix:
-sum patterns?
-divide referenced pattern block in 2 parts and fill each part with one pattern?
Thanks,
By
R.
redfordxx
7th January 2006, 16:05
I updated the scripts, now all info is in noisedata.avs so I believe it is easier to manage...
Still.. any help with questions above?
tsp
7th January 2006, 16:08
redfordxx: If you only need a mean blur(that is a kernel with only 1's) you can try my variable blur filter (see link in sig)
redfordxx
7th January 2006, 20:13
Right now I need
-1 -1 -1
-1 8 -1
-1 -1 -1
and similar bigger.
I can't do that with masktools convolution.
Didée
7th January 2006, 21:35
The fastest (probably) variants of 3x3 conv blur modes are in kassandro's RemoveGrain package:
1 1 1 / 1 2 1 / 1 1 1 = RemoveGrain(11) (highly accurate, much more than blur(). Really.)
1 1 1 / 1 1 1 / 1 1 1 = RemoveGrain(20)
1 1 1 / 1 0 1 / 1 1 1 = RemoveGrain(19)
The last kernel you posted usually is used for (cheap) edgemasks, and is iplemented in MaskTools as EdgeMask("LaPlace") or mt_edge("LaPlace"). (it *should* be in, acc. to documentation, not sure if it actually is. If it's not, it can be build through DEdgeMask(0,255,0,255,"-1 -1 -1 -1 8 -1 -1 -1 -1") )
Dark Alchemist
7th January 2006, 22:12
1 1 1 / 1 2 1 / 1 1 1 WOW. I plugged that into my meager convolve plugin and all I can say is WOW. A very very very noisey video was cleaned up immensely.
Original (http://img438.imageshack.us/img438/2699/orig5lu.jpg)
Filtered (http://img425.imageshack.us/img425/4032/filtered6ol.jpg)
Didée
7th January 2006, 22:46
Nothing WOW. Leaving exactness-of-arithmetic out of the play, that kernel does just the same as blur(1) does. No magic, just a "dumb" gaussian blur /w radius=1. ;)
BTW, to me your screenshot doesn't look like "very very very noisy". It's moderately noisy. THIS (http://home.arcor.de/dhanselmann/_samples/Babylon5_snip.m2v) is very very very noisy (though Mug Funky might disagree ;) )
(BTW2 - for strong noise, no fun with just spatial filtering. Temporal domain is the mighty one, albeit dangerous as well.)
DeepDVD
7th January 2006, 23:04
I'm sorry if that's a noob question but I get stairs on gradients. It's in all plane-modes. As I can remember, MSU talked about reduced colorwidth.
Is there a chance to smooth the stairy gradient within FFT3D?
Sample: (made brighter and higher key to see a better difference)
http://img473.imageshack.us/img473/9818/stairs8tr.jpg
Dark Alchemist
7th January 2006, 23:27
Yeah, the really noisey parts are later in the movie I have and is from low light. That part is not as noisy as some other parts are.
redfordxx
7th January 2006, 23:28
The last kernel you posted usually is used for (cheap) edgemasks, and is iplemented in MaskTools as EdgeMask("LaPlace") or mt_edge("LaPlace"). (it *should* be in, acc. to documentation, not sure if it actually is. If it's not, it can be build through DEdgeMask(0,255,0,255,"-1 -1 -1 -1 8 -1 -1 -1 -1") )
thanks, but in mys script I need bigger...
The function MyConvolution I have there is not ideal;-)
Dark Alchemist
7th January 2006, 23:42
Temporal filtering can only be done via FFT or is there a temporal convolution scheme? In my searching via google I ran across something that said a 100x100 convolution pattern approaches the level of a fft.
Isochroma
8th January 2006, 00:07
By rotating the video in the third dimension, temporal can be made spacial and spacial made temporal... The best of spacial denoisers may be able to exceed temporal ones.
redfordxx
8th January 2006, 00:16
THIS (http://home.arcor.de/dhanselmann/_samples/Babylon5_snip.m2v) is very very very noisy
I experienced same type of "noise" too. In fact it is not noise of the video, it is something in the DCT --- it is block-oriented. It is possible to get rid of it with FFT3DFilter too, but with stronger parameters (in my script higher enhance_ or contrast_)
The problem is that after little stronger denoising FFD3DFilter produces horizontal and vertical lines pattern... As if the noise were combed out.
Probably a little postprocessing will be necessary.
Dark Alchemist
8th January 2006, 00:44
By rotating the video in the third dimension, temporal can be made spacial and spacial made temporal... The best of spacial denoisers may be able to exceed temporal ones.
Ahem, how do I take a 2d frame and move it into 3d? That part boggles my mind.
Didée
8th January 2006, 01:41
redforxx:
Ahmm ... not quite. The film source has a great amount of film grain. What we actually see is what DCT compression has made out of the grain. On playback, it sorta looks okay ... looking at the single frames, it's a good contra-example for the folks saying "No filtering! I want to keep the film grain!". (Because "the grain" is already gone ... what's left is loads of artefacts which fake the original grain ... rather poor on a per-frame basis, but somewhat succesfull at 24-25Hz ;) ). - Plus, one would need insane bitrates to reproduce it sufficiently.
FFT3D does not a bad job on this source, still its result is highly insufficent for my taste: depending on strength the noise is either only reduced, leaving the source still unstable; or the noise *is* reduced (around sigma=7~8), but detail is killed.
Actually B5 is one of my main test sources for MC'ed denoising, and I'm on the way to get a stable, death calm, sharp and detailed result out of it. Somewhen this year, hopefully ... I'll post something when it's ready. ;)
Ischroma:
We've heard that idea already. It does have its points, but it's not that easy by far. Given we had such a "3D rotation" filter, you can not just throw any spatial filter at it:
a) in "normal" 2D, there is a high probability that nearby pixels are correlated to the actual pixel. This probability is much weaker after rotation. Actually, exactly this is the general problem of temporal filters ... and rotating does not change the problem (the uncertainty of correlation) in any way.
b) A spatial filter works in 2 dimensions. A temporal filter works in 1 dimension. If you rotate & then filter 'spatial', what you effectively do is to filter the (rotated) temporal dimension plus ONE out of the TWO original spatial dimension. That's not good ...
BTW, wanna show us the superiority of NeatImage filtering compared to poor Avisynth filters? Sample was posted above ... :D
Isochroma
8th January 2006, 02:21
Yeah, I thought about that problem, and came up with two solutions:
1. Tell the spacial denoiser to operate on only one axis.
2. Rotate back to normal & then rotate the other way and denoise again, thus balancing x-y denoising. Each pass would be set to 1/2 strength. Only problem is that the temporal dimension would always get 2x the amount of denoising as spacial...
It's always so fun to think of weird ways of doing things, and then weird solutions to the strange problems they generate!
Wow that clip has some really nice noise... I will do voodoo magics with it if I dare!
DarkFoon
8th January 2006, 02:46
@ didee
have you tried my FFT3D settings? On delicate anime sources (fine detail, not something like Harvey Birdman) the detail retained is outstanding and the noise reduced was more than I thought possible with FFT3d.
as for the banding on gradients, I had that happen recently. It was irritating. My source was very noisy, but when I ran FFT3D it really messed up this one gradient and made it into a bunch of concentric rings of different shades.
I'll post a before&after as soon as I have it made
redfordxx
8th January 2006, 03:02
or the noise *is* reduced (around sigma=7~8), but detail is killed.
Don't use sigma, use patterns...
the difference in quality is huge.
That'swhy I made all these scripts...
Although, it depends on the noise... When it is dots, it's ok.
This here can have up to 8pixel long lines which is difficult to catch as a pattern. However, still quite good job compared to sigma approach.
Didée
8th January 2006, 03:16
@ didee
have you tried my FFT3D settings?
I did right now. Most noise is gone, except on some movement. Faces get plastic. Cloths turn into plastic. Fog/nebula turns into milk. And where detailed foreground meets 'flat' background, it leaves back mosquito noise on the background, in rectangular shapes.
@ redforxx
Patterns you say. Where every scene has different amounts & (partly) characteristics of noise (it's basically film grain, after all. Not mpeg artefacts out of thin air, and also not that noise like in analog captures.)
One scene shows noise like that. Next scene is dark, almost without any noise. Next-next scene is even worse than the 1st.
Noise Patterns? Manually set up for ~40 scenes per episode per 22 episodes per 5 seasons?
No, thanks. It's better to produce a general solution. More fun for me, and of more use for others. (somewhen.)
redfordxx
8th January 2006, 03:38
as for the banding on gradients, I had that happen recently. It was irritating. My source was very noisy, but when I ran FFT3D it really messed up this one gradient and made it into a bunch of concentric rings of different shades.
That's why I started to use patterns instead of sigma.
Dark Alchemist
8th January 2006, 03:59
Thank you didee I always get those mixed up. So the spatial is in 3d and the temporal is the 2d?
redfordxx
8th January 2006, 04:00
Original (http://img375.imageshack.us/img375/6075/original1ap.png)
Denoised (http://img375.imageshack.us/img375/5632/fft9cf.png)
Following are Subtract images with 25xcontrast enhancement
Original vs orig-blurred(5x5) (http://img375.imageshack.us/img375/118/g55wh.png)
Denoised vs denoised-blurred(5x5) (http://img355.imageshack.us/img355/5658/f0g51wy.png)
Orig vs. denoised (http://img355.imageshack.us/img355/3407/s01pr.png)
You see the noise disappeared fairly... (strange it is in 16x16blocks..)
On the Orig vs. denoised you see, that the edges not much visible... so, preserved.
On the Denoised vs denoised-blurred you see the vertical lines (sometimes horizontal) I was speaking about. Somehow I must get rid of them.
redfordxx
8th January 2006, 04:02
Thank you didee I always get those mixed up. So the spatial is in 3d and the temporal is the 2d?
spatial is 2d
temporal 1d
spatio-temporal 3d
(speaking about flat screens and oldfashioned cinemas...;)
redfordxx
8th January 2006, 04:07
Where every scene has different amounts & (partly) characteristics of noise (it's basically film grain, after all. Not mpeg artefacts out of thin air, and also not that noise like in analog captures.)
One scene shows noise like that. Next scene is dark, almost without any noise. Next-next scene is even worse than the 1st.
Noise Patterns? Manually set up for ~40 scenes per episode per 22 episodes per 5 seasons?
Of course, I assumed there is one or two noise patterns per movie.
OTOH, sometimes same noise in different colour or brightness looks different. I though also there are many noises in the movie, until I separated it like in the example Original vs orig-blurred(5x5)
Mug Funky
8th January 2006, 04:08
i find sigma to be not precise enough, but patterns to be too precise... you can often see the signature of the pattern in a grid in the output.
the 4 different sigma values are a good compromise - course but not too course. they work pretty well on (grainier than Didée's b5) animation. i will definitely have to post a sample of this noise... the good news with animation of this kind (ie woefully simple) is it doesn't matter if too much noise gets removed, the bad news is the signal to noise ratio is quite a bit below 1... (ie, more noise than signal).
[edit]
oh, and Didée, i wouldn't be too worried about manual NR settings per scene... if i remember that show correctly there were lots of CG sequences which will have zero film grain (only either analog noise or beta SP noise or both), so you'll have to do some chopping anyway.
Didée
8th January 2006, 04:23
the 4 different sigma values are a good compromise - course but not too course. they work pretty well on (grainier than Didée's b5) animation.
Well, if you have more noise than I have - fine for you, congratulations! :D
But then, your animations probably don't contain human faces which could end up looking like a bank robber wearing a stocking mask ...
if i remember that show correctly there were lots of CG sequences which will have zero film grain..., so you'll have to do some chopping anyway. The good thing about a good denoiser is that it does only little harm if no noise is present. ;)
(Worse is that the CG's are 'cbbc' fieldblended ... 30p->25i ... DOWN WITH NTSC!)
Dark Alchemist
8th January 2006, 04:36
Right temporal being along the timeline but 2d and 3d from a flat scene I still do not understand. I mean how can you makeup a 2nd dimension from a flat source (like film)?
foxyshadis
8th January 2006, 05:19
You can think of it as every 2d frame in the video stacked on top of each other, with a temporal width of 40ms or whatever the framerate happens to be. The metaphor isn't perfect, but it's good enough to enable effective temporal filtering and motion vector encoding within a scene.
Dark Alchemist
8th January 2006, 07:02
Huh?
So, every frame of the video is stacked one on top of the other then you lost me.
DarkFoon
8th January 2006, 21:57
I may not be a moderator or anything, but it seems that we've got 2 different conversations going on here that don't necesarily belong in FFT3D. One belongs in a thread about denoising technologies. And the other Should be in a denoising help thread of some kind.
That being said...
Didée,
I guess I forgot to mention that my FFT3D settings I use on anime. I tried them on a Law & Order: CI episode and they worked well. Especially when not going frame-by-frame (which is a hard thing for me NOT to do)
My cable signal is garbage (especially the L&W episode) tons of noise, and its made worse by the fact that I use a hauppauge winTV-250 which uses a hardware mpeg-2 encoder, so I get lots of that *fun* mpeg-2 artifacting that emulates the "film grain" (in my case, analog crap noise) in the signal. In anime, this is annoying as hell, so I kill it with fire. Anyways, I'm rambling here and I've forgotten where I was going with this... OH! You might want to try peachsmoother (if you haven't already). When FFT3D lets me down (by smoothing away quality or whatnot) peach does an excellent job, because it leaves the detail or "noise" in the image, it makes it static, though. (this is a bad description so don't let it discourage you from trying it if you haven't already) So there is no extra motion(except that actual motion) and the detail is retained. I used it on everything until I found FFT3D.
Anyways.
Good luck!
levi
13th January 2006, 04:30
My plugins are at my site http://bag.hotmail.ru and its mirror at http://www.avisynth.org/fizick
I can't find any working links for 1.8.5. Warpenterprises seems to be only 1.6. Any suggestions?
Revgen
13th January 2006, 04:38
Download here. (http://www.avisynth.org/fizick/fft3dfilter/fft3dfilter185.zip)
levi
13th January 2006, 04:44
that works for you? I'm getting 404.shtml
DarkFoon
13th January 2006, 05:07
@levi
I get teh same thing when I click the avisynth link,
but fizick's site works just fine for me.
just scroll down, click on FFT3D, then scroll down until you see the download links at the very bottom.
foxyshadis
13th January 2006, 06:05
DF, you should try clicking the links first. ;) Fizick removed the downloads today, for what reason isn't clear yet, but hopefully they'll be back soon.
Fortunately I am not lacking for webspace. Download latest version here (http://foxyshadis.slightlydark.com/random/fft3dfilter185.zip).
Egh
13th January 2006, 07:24
You haven't read the site yet? :O Orly? :)
In short: Fizick went donationware. I.e. at the moment all download links are removed from the site.
Long explanation:
http://bag.hotmail.ru/donate.dhtml (with some errors in english though his russian is not really that clear as well :P)
Most important part (text improvements, based on russian version as well, are in bold ^^)
I temporary remove (removed) all my plugins from my site and change (changed) license of all my plugins to donation-ware.
I will make announcement of new developed (for myself) filters versions (i will announce new versions of the filters ) and wait some sum of donations ( and I expect to receive some amount of donations upon announcement). All donors will become the registered users who will immediately get ( receive after donating ) current and next ( all the following ) beta versions of this filter and (will receive) my technical support (by e-mail or private messages). I will minimize the technical support at public forums.
I guess you won't see Fizick here anytime soon :) Nor new versions of fft3d and other filters :(
BTW, not mentioned in english version whatsoever, but in russian it's clear: the sum of money per donation is expected to be no less than 7$ :)
Revgen
13th January 2006, 09:43
I don't mind donating, as long as he uses the money to pay for english language courses.:D
Wilbert
13th January 2006, 11:01
Hmm, that's bad news :( Last coupled of days I got the feeling something was wrong. Luckely his intention is to keep releasing future versions as OS.
Does someone has his latest mvtools including source (1.0.3 i think)?
Boulder
13th January 2006, 11:28
It can be found at Didée's online directory:
http://home.arcor.de/dhanselmann/_stuff/
BigDid
13th January 2006, 20:22
http://www.avisynth.org/fizick/
still online
last fft3d 1.85
For mvtools links to http://manao4.free.fr/
but rev 0.991 only
Anyway good luck to Fizick for his projects
Did
Fizick
14th January 2006, 20:34
Revgen,
Yes, my English is bad :(.
But if your English is good,
why you never suggest me your help in filters manuals improving (editing)?
Revgen
14th January 2006, 21:50
Your English has never been terrible, but it has gotten a lot better since the first time you started posting here. It will improve as you keep using it.
Heck, I've been speaking English all my life and I still haven't figured it out yet.:)
It was kind of a half-joke.
Anyhoo, you're manuals are okay as far as English goes, but they aren't as visually detailed as they could be.
The plugins that you've programmed are very powerful yet also complicated, and any kind of visual cues that you could show us could help make them easier to understand.
For example, in the DeFreq manual it would be better to have a grid pattern graph overlaying a .JPG vidcap to show people a better example of how to set X and Y window values. Giving examples of which settings in Defreq affect which areas in the grid pattern could help people understand the settings easier.
Egh
15th January 2006, 04:01
Revgen,
Yes, my English is bad :(.
But if your English is good,
why you never suggest me your help in filters manuals improving (editing)?
First, I don't recall if you actually asked here for that :)
Second, the problem as I see it... Well that the original (aka russian manuals) also need some overhaul aka editing. They certainly need better structural representation, layout and even language corrected.
I recall once I read some paragraph in fft3d manual (in russian :P) and had to read some obscure phrase 3 times finally to get the meaning behind it.
As for DegrainMedian manual, for example, take that part which describes the method used, and e.g. reference to PixieDust has very vague meaning. And I'm very interested in pixiedust comparison and still hope someone would finally implement it as YV12 avs 2.5 plugin. But if you plugin does that functionality, it's very good. But to what extend, how good and so on are quite tough to understand from the manual.
As for help with translation, post the request what to do and I'll take a look.
Mug Funky
15th January 2006, 04:15
@ fizick:
i use your stuff commercially, but have no problem with donating :)
i have no credit card at the moment (never liked the idea to be honest), but i'll figure something out. i'll have to pore through the shareit site to see what other options i have.
FWIW, i never really had a problem with your docs - it all made sense, even if i had to re-read a couple of things. structure and flow are all good, and grammar was better than a lot of native english speakers can produce. the good thing about language is there's so much redundancy that context-based error correction is quite easy :)
Soulhunter
21st January 2006, 12:25
Hi Fizik! Some time ago Didèe pointed out that FFT3DFilter produces visible ringing in some cases, so I checked his presumption...
Source / FFT3DFilter(BW=48,BH=48,Sigma=5)
http://img13.imageshack.us/img13/1804/normal7fi.th.png (http://img13.imageshack.us/img13/1804/normal7fi.png) http://img13.imageshack.us/img13/1372/zoom9ii.th.png (http://img13.imageshack.us/img13/1372/zoom9ii.png)
Its even more visible in motion: Source (http://www.mytempdir.com/398663) / Filtered (http://www.mytempdir.com/398654)
The only way to get rid of the ringing is to lower the blocksize to something like 8, but then the denoising is to way to weak. So, is there maybe a way to modify FFT3DFilter so that its produces less (or none) ringing?
Tia n' Bye
DarkFoon
21st January 2006, 23:37
have you tried different wintype= settings?
2 apparently gives less ringing.
Didée
22nd January 2006, 00:59
Hmh no, that just makes the ringing more mosquito-like, and masks it by less overall noise reduction compared to wintype=0|1. (Seems like I have to raise sigma's by *1.5 to *2 to get the same NR from wintype=2 as from 0|1 - and if doing so, more detail gets wiped.)
IMO it's a inherent conceptual issue of the window'ed frequency analysis. If there's a detailed foreground object against a flat background, it gets difficult to seperate the frequencies of foreground's detail from those of background's noise, for where both fall into the same window.
Only way to reduce the artefact is to decrease window size ... but going "small enough" will hurt the denoising efficiency.
A source frame with some noise:
http://img8.imageshack.us/img8/7918/thesourceforfft3d4no.th.png (http://img8.imageshack.us/my.php?image=thesourceforfft3d4no.png)
A script with some settings:
Mpeg2Source("I:\_UnderWork\Babylon5\2x05 - Der unsichbare Feind\vts_01.d2v")
crop(0+40,88,-0-40,-88,true) # reduce size for stacking several outputs
o = last
fft1 = o.fft3dfilter(sigma=3,sigma2=4,sigma3=4,sigma4=3,bt=4,bw=32,bh=32,ow=16,oh=16,degrid=1,wintype=0,plane=4)
fft2 = o.fft3dfilter(sigma=3,sigma2=6,sigma3=6,sigma4=3,bt=4,bw=32,bh=32,ow=16,oh=16,degrid=1,wintype=1,plane=4)
fft3 = o.fft3dfilter(sigma=4,sigma2=7,sigma3=7,sigma4=4,bt=4,bw=32,bh=32,ow=16,oh=16,degrid=1,wintype=2,plane=4)
o2 = o.fluxsmoothST(20,2).temporalsoften(2,24,24,24,2)
stackhorizontal( stackvertical(o2 .subtitle("source (heavvy TS)"),fft3.subtitle("wintype=2")),
\ stackvertical(fft1.subtitle("wintype=0"), fft2.subtitle("wintype=1")) )
return last.yv12lut("x 24 +",U=2,V=2) # a dark monitor I have ;)
(Note the sigma's increase along with wintype.)
The result:
http://img41.imageshack.us/img41/2609/fft3dwintypes2xh.th.png (http://img41.imageshack.us/my.php?image=fft3dwintypes2xh.png)
Look around all edges of faces and uniforms, and in particular beneath the emblem on Ivanova's sleeve.
Lemonzest
22nd January 2006, 01:31
where can i download version 1.85 (latest??) cant get it any where :(
Wilbert
22nd January 2006, 02:04
I attached version 1.85 for you.
Lemonzest
22nd January 2006, 17:36
thanks :)
Fizick
22nd January 2006, 19:32
As for help with translation, post the request what to do and I'll take a look.
I do not know what is bad in current translations. So, I can not request. But any specific (concrete) suggestions and corrections to any filters manuals are welcome.
Such small corrections I can put to manuals.
Soulhunter,
I know about this "ringing". It is compromise (as was noted by Didee)
Egh
23rd January 2006, 04:17
I do not know what is bad in current translations. So, I can not request. But any specific (concrete) suggestions and corrections to any filters manuals are welcome.
Such small corrections I can put to manuals.
Well generally it's needs more editing, even in russian. So I'd suggest you first find someone volunteering to edit manuals to make them more readable and comprehensive. Not that they are bad for freeware, lots of programs don't have any manuals whatsoever ^^ But I'd say for any commercial software that documentation would be far from being enough. For example that fragment from DegrainManual referencing PixieDust. I probably still don't understand fully the meaning of that phrase :)
Soulhunter
23rd January 2006, 13:17
Soulhunter,
I know about this "ringing". It is compromise (as was noted by Didee)
So, nothing that could be done about it? :\
Bye
Soulhunter
25th January 2006, 02:12
FFT3DFilter(Sigma=5,BW=48,BH=48) (http://img229.imageshack.us/img229/1606/fft3dfiltersigma5bw48bh480tm.png) / Zoomed (http://img229.imageshack.us/img229/7082/zoomfft3dfiltersigma5bw48bh488.png)
FFT3DFilter(Sigma=3,BW=16,BH=16).Deen("c3d",1,3,3,25) (http://img229.imageshack.us/img229/6831/fft3dfiltersigma3bw16bh16deenc.png) / Zoomed (http://img229.imageshack.us/img229/8734/zoomfft3dfiltersigma3bw16bh16d.png)
Seems to work, equal compressibility but near like no ringing... ^_^
Bye
Soulhunter
1st February 2006, 08:07
Wouldnt it be possible to use smaller blocks around edges and big blocks for the rest?
http://img98.imageshack.us/img98/1823/normal7fi9dp.png
Bye
Didée
1st February 2006, 10:10
Wouldnt it be possible to use smaller blocks around edges and big blocks for the rest?
http://img98.imageshack.us/img98/1823/normal7fi9dp.png
Bye
Hihi ... in an ancient time where a basic DOS-shell just had appeared ("Windows", 15 to 20 years ago), this method was already used in FractInt. They called it "tesselation".
Basically, the method should be implementable into FFT3D. Use a robust edgemask like Prewitt and perform tesselation on the basic blocks, breaking a new piece when a boundary of a tesseled piece hits an edge value bigger than <threshold>.
tsp
1st February 2006, 18:24
it might be a problem to get blocks of different size to overlap the right way (that is a gentle roll-off to black at the edge and when the overlapped blocks are added togetger it should give the same intensity)
Fizick
21st February 2006, 19:45
Recently new version 3.1 of fftw library is released at http://www.fftw.org
Provided new binary (after renaming to fftw3.dll ) can be used with fft3dfilter,
but the speed is not faster with my Athlon.
zyrill
21st February 2006, 23:07
Regarding Soulhunter's problem with ringing around the edges: I encountered the same problem while using FFT3D but found a way to counter it: I now invoke FFT3D twice, once with a block size of 48 and once with a block size of 4. It's dreadfully inefficient but I don't really care since I want the best possible quality and using FFT3DGPU framerate is not a concern anymore (following values only for reference since taken from VDub while encoding to XviD. FFT3D: ~2.5fps; FFT3DGPU: ~12fps working on a 712 px by 420 px file).
Prior to looking more deeply into FFT3D I tried the whole spread of denoising-solutions available and after having seen that FFT3D yielded the best results, I tried refining the parameters to achieve the best possible result. The result is actually so good that, given any (even a recent) DVD, the output of the avisynth script looks much cleaner and clearer then the input - it's like having pulled the curtains away. And while getting rid of all the noise, no detail is lost! It's really most amazing and I'm most thankful that such a plugin exists.
Anyway, without much further ado, here's the script I ripped together:
# Denoising every color plane discretely by multiple FFTs using motion compensation
Motion=DepanEstimate(trust=2.5, fftw=true)
DepanInterleave(data=Motion)
YToUV(FFT3DGPU(sigma=3, plane=1, bw=32, bh=32).UToY,\
FFT3DGPU(sigma=3, plane=2, bw=32, bh=32).VToY,\
FFT3DGPU(sigma=2, plane=0, bw=32, bh=32))
YToUV(FFT3DGPU(sigma=3, plane=1, bw=4, bh=4).UToY,\
FFT3DGPU(sigma=3, plane=2, bw=4, bh=4).VToY,\
FFT3DGPU(sigma=2, plane=0, bw=4, bh=4))
SelectEvery(3,1)
I hope you'll find it equally useful.
Cheers!
ariga
23rd February 2006, 14:07
Recently new version 3.1 of fftw library is released at http://www.fftw.org
Provided new binary (after renaming to fftw3.dll ) can be used with fft3dfilter,
but the speed is not faster with my Athlon.
The new library didn't work even after renaming! Strange... Is a reboot required ?
Fizick
23rd February 2006, 14:26
ariga, see here
http://forum.doom9.org/showthread.php?p=781111#post781111
ariga
27th February 2006, 08:35
Thanks. Used the *f.dll and it works fine. Wonder why the other .dll didn't work.
Fizick
27th February 2006, 09:13
Other new dll includes not single prcecision, but double precision functions with other (different) names and calling parameters.
AI
27th February 2006, 14:25
2 zyrill
very small comments, becose I am not English man
------------- First --------------
# Denoising every color plane discretely by multiple FFTs using motion compensation
Motion=DepanEstimate(trust=2.5, fftw=true)
DepanInterleave(data=Motion)
MergeChroma(FFT3DGPU(sigma=2, plane=0, bw=32, bh=32),\
FFT3DGPU(sigma=3, plane=1, bw=32, bh=32))
SelectEvery(3,1)
(see Bold) - becose in GPU version
"plane=1" = "plane=2" = "plane=3" - alwase use both U and V
-------- Second ----------
if you use 2 or more temporal filters in
DepanInterleave(...)
....
SelectEvery(...)needDePanInterleave(...)
filtre1()
selectevery(3,1)
DePanInterleave(...)
filtre2()
selectevery(3,1)
DePanInterleave(...)
filtre3()
selectevery(3,1)orDePanInterleave(prev=3, next=3)
filtre1()
filtre2()
filtre3()
selectevery(7,3)orDePanInterleave(prev=1, next=1)
MergeChroma(filtre1(),filtre2())
selectevery(3,1)
leonid_makarovsky
1st March 2006, 23:10
I've tried the latest version of Fizick's fft3d filter plugin. I found it better than the previous versions. I can't measure how fast it is alone 'cause I use it with bunch of other stuff. Yet, I am not using any sharpening features on that one. And yet I do NOT use fft3dfilter alone. Before that I use PixieDust for VHS noise removal.
This is the code fragment I use to clean the factory made NTSC or PAL interlaced VHS cassettes with new like condition:
myclip = SeparateFields(myclip)
myclip = PixieDust(myclip, limit = 4)
myclip = fft3dfilter(myclip, sigma = 2, bt = 4, plane = 0, sharpen = 0, svr = 0)
myclip = LimitedSharpen(myclip, ss_x = 1, ss_y = 1, Smode = 3, dest_width = 352)
myclip = Weave(myclip)
Separating fields and using fft3dfilter as progressive gives me better results for my projects.
If I have a progressive scan PAL VHS, then I am now trying to decide whether to treat as if it's interlaced or to do something like this:
# PixieDust cleans 2 separate fields of a progressive frame
# better then it cleans a progressive frame
myclip = SeparateFields(myclip)
myclip = PixieDust(myclip, limit = 4)
myclip = Weave(myclip)
# use fft3dfilter to feed a progressive frame
myclip = fft3dfilter(myclip, sigma = 2, bt = 4, plane = 0, sharpen = 0, svr = 0)
# LimitedSharpen sharpens 2 separate fields of a progressive
# frame better then it sharpens just a progressive frame
myclip = SeparateFields(myclip)
myclip = LimitedSharpen(myclip, ss_x = 1, ss_y = 1, Smode = 3, dest_width = 352)
myclip = Weave(myclip)
--Leonid
PS. I feed this code to TMPGEnc. 97 minutes and 18 seconds of PAL video takes 28 hours to process from 704x576 Huffyuv AVI.
DarkFoon
24th March 2006, 08:04
using the new FFTW DLL on pentium 4 2.4GHz FFT3D seems a little faster than the older one using the script from zyrill (except I modified it to use FFT3D not FFTGPU, because the latter crashes on my computer).
by the way zyrill, good work! it's a high quality script! I use it on my TV captures. It makes animation really look good. (Live action looks a little over filtered, but I think I know how to fix that)
here's the one I'm using:
Motion = depanestimate(fftw=true)
DepanInterleave(data=Motion)
YToUV(FFT3Dfilter(sigma=3, plane=1, bw=32, bh=32, sharpen=.25).UToY,\
FFT3Dfilter(sigma=3, plane=2, bw=32, bh=32, sharpen=.25).VToY,\
FFT3Dfilter(sigma=2, plane=0, bw=32, bh=32, sharpen=.25))
YToUV(FFT3Dfilter(sigma=3, plane=1, bw=4, bh=4, sharpen=.25).UToY,\
FFT3Dfilter(sigma=3, plane=2, bw=4, bh=4, sharpen=.25).VToY,\
FFT3Dfilter(sigma=2, plane=0, bw=4, bh=4, sharpen=.25))
SelectEvery(3,1)
DarkFoon
you read my post?
http://forum.doom9.org/showthread.php?p=791552#post791552
note: CPU version have ""plane=3" - use both U and V" too
DarkFoon
27th March 2006, 06:48
yes AI, I did see your post.
But I don't quite understand what you mean with your examples. I tried some of them, and I didn't see any difference. It may be because I don't really understand how DePan works.
1) now better use MergeChroma then YtoUV, becouse now GPU and CPU version have "plane=3" - use both U and V
2) You know "triangle Pascal"?
1
11
121
1331
14641
...
if we use temporal filter with matrix [121],
then we use filter 2 pass = we have use 1 pass with matrix [14641]
i.e. temporal filters with many passes - "swell" in temporal...
i.e. if you use DePanInterleave you need use "Last=2" and "Next=2" or more
Or use several DePanInterleave
I can't explain better. Becose my English is very bad.
DarkNite
27th March 2006, 23:19
I understood what you were saying well enough to use it. Thank you for the pointer. That saves me hours of trial and error, and possibly a few grey hairs. ;)
Alain2
28th March 2006, 11:13
I think I understand as well, but to be sure, is it possible to post the full script from zyrill or DarkFoon translated the hints AI gave, that would be also the fastest? (not sure what is better between longer temporal compensated frames playing with prev/next or several applications of ff3dfilter)
Also is it really an issue to apply the 2 fft3d at once, the idea being to cancel out the ring edge effects of using only one fft3d instance with a fixed grid (blocks) dimensions?
Here is what I am doing:
Motion = DePanEstimate(fftw=True)
DePanInterleave(data=Motion)
MergeChroma( FFT3Dgpu(sigma=2, plane=0, bt=3, bw=48, bh=48, sharpen=.5),
\ FFT3Dgpu(sigma=3, plane=3, bt=3, bw=48, bh=48, sharpen=.5))
MergeChroma( FFT3Dgpu(sigma=2, plane=0, bt=3, bw=4, bh=4, sharpen=.5),
\ FFT3Dgpu(sigma=3, plane=3, bt=3, bw=4, bh=4, sharpen=.5))
SelectEvery(3,1)
DeHalo_alpha()
DarkFoon
14th April 2006, 16:45
fast and good are oxymorons.
It's not as good (quality wise) as AI's method, is it?
Fizick
14th April 2006, 18:25
BTW, here is my "to do" list:
"DeHalo" option.
Alain2
14th April 2006, 19:21
Show me what is you call AI's method if you think what I'm doing is incorrect..
Anyway, I am not using this filter chain, tried it as written by zyrill or me, and the result is bad (way too much smoothing, no improvement on the ringing)
You have two temporal filters between DePanInterleave and SelectEvery
First:MergeChroma( FFT3Dgpu(sigma=2, plane=0, bt=3, bw=48, bh=48, sharpen=.5),
\ FFT3Dgpu(sigma=3, plane=3, bt=3, bw=48, bh=48, sharpen=.5))second:MergeChroma( FFT3Dgpu(sigma=2, plane=0, bt=3, bw=4, bh=4, sharpen=.5),
\ FFT3Dgpu(sigma=3, plane=3, bt=3, bw=4, bh=4, sharpen=.5))
i.e. for simply look this script:DePanInterleave(data=Motion)
FFT3Dfilter()
FFT3Dgpu()
SelectEvery(3,1)1) AVISynth ask frame from SelectEvery
2) SelectEvery ask medium frame from FFT3Dgpu
3) FFT3dgpu ask 3 frames (compensate.prev,curr,compensate
.next) from FFT3dfilter
4) FFT3dfilter filtred not only medium frame,
but every frames (compensate.prev,curr,compensate
.next)
---------------or--------------------
after DePanInterleave we have order frames:
curr(n-1),next(n-1),prev(n),curr(n),next(n),prev(n+1),curr(n+1)
prev(n) = compensate prev.frame to current
next(n) = compensate next.frame to current
we have 3 fft3dfilters:
1) prev'(n)=fft3filter(next(n-1),prev(n),curr(n))
2) curr'(n)=fft3filter(prev(n),curr(n),next(n)) #right
3) next'(n)=fft3filter(curr(n),next(n),prev(n+1))
curr''(n)=fft3gpu(prev'(n),curr'(n),next'(n)) #after SelectEvery we have only this frame
Fizick
you can add aviable GPUFFTW (http://gamma.cs.unc.edu/GPUFFTW/download.html) on your filters?
Fizick
30th May 2006, 20:47
May be later, when it will support 2D and ATI.
Thanks for link.
krieger2005
8th July 2006, 13:21
Hi Fizick,
i wounder why you don't add a "up-size" option to fft. Since you get get the frequencies of the blocks, why not upscaling at the same time. The Results should look good on texture...
Fizick
9th September 2006, 20:12
Released version 1.9.1. Summary changes:
- added dehalo options;
- corrected sharpen mode;
- re-enabled SSE optimization for degrid=0;
- added SSE optimization for bt=3,-1 with degrid>0 (faster by 15%)
- added SSE optimization for bt=4 with degrid>0 (faster by 30%).
v1.9.2 with bt=5 is in beta stage
Pookie
10th September 2006, 03:12
Thank you very much, Fizick :D
http://amazingsounds.iespana.es/applause5.wav
elguaxo
16th September 2006, 19:32
The SSE optimizations are great! Now 2 questions. corrected sharpen mode
What was corrected?
2nd. I really like having a dehalo feature. After denoising and sharpening I saw halos many times. The readme says:
dehalo - halo removal strength (float>0, default=50)
Is dehalo activated by default?
foxyshadis
16th September 2006, 19:54
Oh, a new halo remover, how cool. I'll have to test it out. Is it possible to separate it from the rest of the functionality, eg, sigma=0 and sharpen=0 but dehalo=100? Or is dehalo then automatically disabled?
Fizick
16th September 2006, 19:55
1st. I do not remember, what was corrected. :)
2nd. Thanks, it is documentation bug. default dehalo=0
elguaxo
16th September 2006, 21:04
:thanks:
And thanks again for the speed optimizations. I am already enjoying the SSE optimization for bt=3 :D
netrex
17th September 2006, 05:32
Thanks for this :) Been looking around a lot for something that does a good job without blurring it too much. The one I tried before this blurred it a lot and took 11 hours for an hour of footage :P this take 3 :)
:thanks:
Caroliano
24th September 2006, 21:04
I had trouble finding the lastest FFT3DFilter for downloading. The right page seems to be http://avisynth.org.ru/fft3dfilter/fft3dfilter.html but the first google hit was http://www.avisynth.org/fizick/fft3dfilter/fft3dfilter.html
This page is not updated since Version 1.8.5 - 4 December 2005.... Why that? Why it was not deleted?
G_M_C
24th September 2006, 21:59
I had trouble finding the lastest FFT3DFilter for downloading. The right page seems to be http://avisynth.org.ru/fft3dfilter/fft3dfilter.html but the first google hit was http://www.avisynth.org/fizick/fft3dfilter/fft3dfilter.html
This page is not updated since Version 1.8.5 - 4 December 2005.... Why that? Why it was not deleted?
Pssst: If you still need a new version .... look 3 posts up @ fizick's signature. He's got the adress to his new page in his sig ;)
Bh4i
15th October 2006, 16:54
Are there any clues this filter might run extra slow on a Core2Duo?? (E6600)
Thunderbolt8
7th December 2006, 03:03
does this filter also work with medui/x264 as well as it does with xvid/divx (different settings to make for that ?)
this is said to be a spatial-temporal filter, but in megui I can only set the option direct spatial, direct temporal or direct auto (for x264). which option would fit best fot that filter here, direct temporal ?
foxyshadis
7th December 2006, 13:39
That has absolutely nothing to do with filtering or denoising, that's a b-frame decision mode. The --nr parameter of x264 is a very simple form of fft filtering though.
To use fft3dfilter in megui, or any custom avisynth filters, you should use the avisynth script creator.
Thunderbolt8
7th December 2006, 15:42
yes, I insert them with avisynth of course and add options there, but you basically say that the options of direct auto, temporal etc. has nothing to do with the filters ?
what about the megui deblocking, which is -2 -1 by default, does this have any effect when using filters via scripts, or will only the options for the filters entered in the script take place and the rest is ignored ?
foxyshadis
7th December 2006, 17:50
Again, that has nothing to do with the filtering whatsoever. Those are both options used by x264 to encode the video. The only part of megui that touches avisynth is the avisynth script creator, while the settings accessed from the "config" button on the main panel are all x264 options.
x264 deblocking will not preprocess video, it only sets how much deblocking is done on the encoded output; if the source is already blocky, it needs to be fixed first, or that'll get encoded into the new video.
Thunderbolt8
8th December 2006, 15:45
I got a problem with that filter now, when clicking on preview in megui, a message keeps saying: "avisynth script error: fft3dfilter: cannot load fftw3.dll !"
I have the fftw3.dll in the same directory as the filter files are (avisynth\plugins) and also in windows\system(32) directory, but it still doesnt work :S
Pookie
8th December 2006, 19:01
Take it OUT of the same folder as fft3dfilter.dll. Keep the copy in c:\windows\system32.
Thunderbolt8
8th December 2006, 21:11
did now, but when I enter the command for it (e.g. FFT3DFilter(bt=-1, sharpen=0.7)) and then press preview I get an error message, saying like theres something wrong with the colour matrix (megui colour correction) line "ColorMatrix(hints=true)". when I remove this line, then its fine. but its strange, since colourmatrix also works on that file without the fft3dfilter command, why cant it work together with it ?
foxyshadis
9th December 2006, 08:22
Colormatrix(hints=true) has to come before fft3dfilter. In fact, it has to be the first filter after DGDecode. If not, the hints will be destroyed, and you'll have to sort out the color matrices manually. (Not fun.)
Fizick
15th January 2007, 19:19
Released FFT3Dfilter v1.9.2 with mode bt=5
Fizick
17th January 2007, 21:31
Full silense...
O.K., next attempt:
Released version 2.1.0 with internal multi-thread support (Core duo, trio, quadro et cetera)
please test
TheBashar
17th January 2007, 22:09
I won't get to try it out for a couple weeks, but rather than silence, I thought I'd say, "Thank you!". I have an AMD X2. I guess it will be able to take advantage of the multithreaded support too. But regardless, thanks!
Pookie
17th January 2007, 22:15
More motivation to buy a Duo Core. :D Thanks, Fizick.
Single thread: bench: utime=283.656s
2Threads: bench: utime=270.657s
tsp
18th January 2007, 00:31
preliminary test with 1000 frames 720x576 YV12 source
Virtualdub->Run video analysis pass
fft3dfilter():
70 sec
fft3dfilter(ncpu=2):
65 sec (7% faster)
mt("fft3dfilter()")
53 sec (24% faster)
this is with an opteron 165 at 2.4 GHz 2.5 GB memory
Fizick
18th January 2007, 19:37
So, it is works :)
Moitah
18th January 2007, 23:30
500 frames 720x480 YUY2 (from HuffYUV AVI), Core 2 Duo E6600, FFT3DFilter is the only filter in this script.
FFT3DFilter(plane=4, ow=16, oh=16, sigma=4, sharpen=0.3): 79.498 seconds
CPU: http://www.moitah.net/misc/fft3dncpu1.png
FFT3DFilter(plane=4, ow=16, oh=16, sigma=4, sharpen=0.3, ncpu=2): 71.382 seconds
CPU: http://www.moitah.net/misc/fft3dncpu2.png
10% faster
tsp
19th January 2007, 11:31
42000 frames with fft3dfilter(ncpu=2) seems stable to me :)
Serbianboss
19th January 2007, 20:04
Source DV avi, yuy2, 1500 frames
with fft3dfilter(sigma=4,interlaced=true) 2.30
with fft3d filter(sigma=4,interlaced=true,ncpu=2) 2.17
AMD X2 3800
AI
20th January 2007, 10:30
So, it is works :)
Probably need pipes in filter core, but not in dll-FFTWv3 (only)
anaqim
26th January 2007, 16:20
I suppose this fits in this thread.
I have been reading up, testing etc etc on how TTF3Dfilter & TTF3DGPU work (you know the drill).
My general objective is easy but high quality converts from DVDs to x264 and i'd like your comments on the setup i've settled for so far as I am new to AVSynth scripting and the TTF3D filter:
1) I re-author a DVD losslessly using DVD Shrink choosing the audio and the subtitle tracks i require (the basic stuff)
2) I use StaxRip for processing and encoding the video with the following settings:
2.1) The scripting:
a. (MPEG2Source("%source_file%",info=3).colormatrix(hints=true,threads=2))
b. Crop borders (manual check also)
c. Resize Very Sharp (Lancosz4Resize) (also rezise resolution usually to 720x)
d. FFT3Dfilter with the following script:
Motion=DepanEstimate(trust=2.5, fftw=true)
DepanInterleave(data=Motion)
YToUV(FFT3Dfilter(sigma=3,plane=1,bw=32,bh=32,wintype=2,degrid=1,ncpu=2).UToY,\
FFT3Dfilter(sigma=3,plane=2,bw=32,bh=32,wintype=2,degrid=1,ncpu=2).VToY,\
FFT3Dfilter(sigma=2,plane=0,bw=32,bh=32,wintype=2,degrid=1,ncpu=2))
YToUV(FFT3Dfilter(sigma=3,plane=1,bw=4,bh=4,wintype=2,degrid=1,ncpu=2).UToY,\
FFT3Dfilter(sigma=3,plane=2,bw=4,bh=4,wintype=2,degrid=1,ncpu=2).VToY,\
FFT3Dfilter(sigma=2,plane=0,bw=4,bh=4,wintype=2,degrid=1,ncpu=2))
SelectEvery(3,1)
Note1! I am using Wintype 2 as anyway the second small frame run should remove any potential Ringing
Note2! This is basicaly Zyrill's slightly modified script
Note3!I tryed adding both a Deen() filter as well as using Sharpen=0.3 with TTF3Dfilter but Deen dont visually mean any improvement in this script and also Sharpen is a waste due to the very sharpen resize (i see no visual point to sharpen more, it will just degrade the video).
2.2) The x264 encoder:
Basically all settings maxed out with the more important ones being:
Single Pass Quality
Quality 22
B-Frames 16
Ref Frames 5
Loop Filter on with Alpha/Beta settings -1/-1
Direct mode Spatial
Mixed Refs
Adaptive B-Frames
Cabac
Motion Estimate Method Multi-Hex
Subpixel Motion Estimation 7 (best)
Trellis 2 (Always)
Using Sharktooths excellent custom matrix eqm_avc_hr.cfg
2.3) Audio Subtitles and Container
Here I use Matroska (MKV) as container which supports the ripped subtitles for easy access (ripped using VSRip)
Audio is encoded either in stereo or 5.1 depending on source and in AAC quality 0.2 which is excellent and small in size.
3) Results are of course rather slow encodes (3-6 fps) but the quality and the file sizes are lovely :o)
Thank you for reading and any hints/comments are appreciated :o)
Anaqim
digitalone
26th January 2007, 23:33
thx for this plugin Fizick. i am using StaxRip for processing & encoding video. when i add FFT3D plugin i get following message..
Unsupported Colorspace: x264 requires YV12 input.
SS: http://maxupload.com/img/67E7326B.jpg
i've written a sample script from your manual but the message still persists.
loadplugin("fft3dfilter.dll")
YToUV(fft3dfilter(sigma=3, plane=1).UToY,\
fft3dfilter(sigma=3, plane=2).VToY,\
fft3dfilter(sigma=2, plane=0))
am i missing something?
tsp
26th January 2007, 23:36
add converttoyv12() to the end of the script
anaqim
26th January 2007, 23:42
He is using StaxRip. It makes a difference. I usually get that message every time something is wrong in the script. It is not about adding what tsp suggests though im sure thats how it works if you use another GUI.
The mistake is probably that you wrote "loadplugin("fft3dfilter.dll")"
You do not have to load plugins in StaxRip, provided you put them in the default AviSynth Plugins directory. Since your line doesnt contain a complete path I assume this is the case.
See my post above yours for tips on how to use this with StaxRip (which i am using too)
Good luck!
Anaqim
foxyshadis
27th January 2007, 03:38
You'll also find that
fft3dfilter(sigma=3,plane=3)
fft3dfilter(sigma=2,plane=0)
is a little faster and a little easier to understand & manage. Although if you're not going to be editing often it's not a big deal.
digitalone
27th January 2007, 09:19
@Anaqim: thx for your help mate..but the problem was something else..the file "depan.dll" was missing...now it's working fine. also, i wanted to ask certain questions regarding the parameters u've set in StaxRip. pls check ur inbox.
@foxyshadis: ok mate..i'll try your suggestion. also, i wanted your opinion on setting up Levels. i'll PM you about it. thx. :)
anaqim
27th January 2007, 15:48
Question from Digitalone!
Hey,
First of all thx for your help mate. I wanted to discuss a few parameters u've set for StaxRip scripting & x264.
Scripting:
you've called FFT3DFilter twice using BW/BH=32 & 4 respectively. how much impact does it make on quality? since FFT3D is slow i was wondering if calling the routine once was sufficient enough.
x264:
shouldn't B-Frame value set to 3 and ref. frames set to 10 be good enough? coz we are checking "Adaptive" option so that x264 can decide best number of B-Frames to use.
and finally, how can i use sharktooth's custom matrix with StaxRip?
looking forward to your reply. thx mate.
Rgds,
digitalone
My Reply!
Hi Mate,
Im quite new to scripting too though I have been encoding for some time but yes you are right. The script is very very slow and I guess at some point you have to set a limit at how slow you want to go :o) My initial tests show an encoding time of around 20 hours.
The idea of the script as I understand it is to first sharpen using larger blocks and a little tougher conditions (sigma) than during the 2nd run. The reason for the second run is to deal with the ringing effect using mini blocks with settings 1 step looser than the image has already been processed. This way only "newly created" ringing should be affected. Yes it works but its just oh so slow.
There is an alternative I am testing right now which is a little faster and which is based on a similar idea. This is the script:
Motion=DepanEstimate(trust=2.5, fftw=true)
DepanInterleave(data=Motion)
FFT3DGPU(sigma=1.5,plane=4,bw=16,bh=16,wintype=2,degrid=1,bt=4).Deen("c3d",1,3,3,25)
SelectEvery(3,1)
The results are similar to the first though not equalily good. Remember we are basically talking details i bet noone will even notice when casualy watching a movie. This script uses relatively small blocks and the try to even out the artifacts using deen (dont ask me about the deen syntax cause i didnt make these settings)
Getting back to the idea of not exaggarating I am also currently trying this one which is again somewhat faster and which I think will be my script until I get a super computer. Even with this one it will take me around 7-8 hours to code a movie.
Motion=DepanEstimate(trust=2.5, fftw=true)
DepanInterleave(data=Motion)
FFT3DGPU(sigma=2,plane=4,wintype=1,degrid=1,bt=4)
SelectEvery(3,1)
Using wintype=1 and degrid=1 as well as default frame sizes (32) I hope to deal with artfacts without exaggerating the loss of speed.
About bframes, most will say that 3 bframes and 5 ref frames are enough. My tests shows that adaptive use of bframes works so if you set it to 5, 10 or 16 probably dont matter but I prefer not to limit the encoder so I use 16.
About ref frames, i am not quite sure what to believe. Peple use and report different things. The answer to my recent post about this was that ref frames over 8 can give uneven results and that trellis is not for single pass encodes. Yet Sharktooth's best profile uses 16 ref frames and full trellis for single pass encodes. So again, my tests show that using 16 does influence both filesize and encoding time. Ultimately, its your choice.
Note about bframe, fro a long time i used 5 bframes and 5 ref frames which seems to be a good choice if you dont want to hit 16.
Here is a link to Sharktooths post regarding his builds and his EQM AVC-HR custom matrix (see his signature) which does inclrease the bitrate quite alot but also works well in preventing blocks. With it I use deblock settings -2/-1
http://forum.doom9.org/showthread.php?s=&threadid=89979
Good luck!
Anaqim
foxyshadis
28th January 2007, 01:10
@Anaqim: thx for your help mate..but the problem was something else..the file "depan.dll" was missing...now it's working fine. also, i wanted to ask certain questions regarding the parameters u've set in StaxRip. pls check ur inbox.
@foxyshadis: ok mate..i'll try your suggestion. also, i wanted your opinion on setting up Levels. i'll PM you about it. thx. :)
I think the best thing to do is to load up AVSp and play with levels (or curves if you're adventurous) until you find something satisfying. I don't really have a clue what the proper levels should be, I just go with what looks decent if I'm ever in need.
Levels([<"Min",0,255,0>],[<"gamma", 0.1, 10, 1.00>],[<"Max",0,255,255>],0,255,false)
You can't play with gamma through a slider yet, because it can't do fractional sliders, but feel free to try moving it.
Alain2
28th January 2007, 01:27
You can't play with gamma through a slider yet, because it can't do fractional sliders, but feel free to try moving it.
I read that from you before and forgot to answer.. If you do levels(16,[<"gamma", 0, 10, 1.00>],235,16,235) for instance, the slider values are adjustable to 0.01 precision for instance ; is that what you meant or something else ? (btw for qwerpoi it would be good maybe to extend the modulo (%) that we can specify to decimal numbers like 0.05)
foxyshadis
28th January 2007, 01:48
!!! I didn't realize you could do decimal that way. Silly me. I'll steal your syntax, if you don't mind.
digitalone
29th January 2007, 07:35
@Anaqim: i need to tweak my script a bit in that case. FFT3DGPU won't work for me as i don't have required graphics card.
I think the best thing to do is to load up AVSp and play with levels (or curves if you're adventurous) until you find something satisfying. I don't really have a clue what the proper levels should be, I just go with what looks decent if I'm ever in need.
Levels([<"Min",0,255,0>],[<"gamma", 0.1, 10, 1.00>],[<"Max",0,255,255>],0,255,false)
You can't play with gamma through a slider yet, because it can't do fractional sliders, but feel free to try moving it.
thx foxyshadis. will play with da function. sorry, but where can i find AVSp? is it some GUI? :o
foxyshadis
29th January 2007, 11:33
Sorry, I'm not linking stuff as often as I used to. It'd come right up in a search, though.
AVSp thread (http://forum.doom9.org/showthread.php?t=115506)
anaqim
29th January 2007, 13:14
Just use FFT3DFILTER with the same settings and you'll get the same result. It uses your CPU instead.
Anaqim
digitalone
30th January 2007, 05:19
@foxyshadis: thx mate. simply awesome utility.
@anaqim: yup...results are good with fast encoding speed.
Bankis
5th February 2007, 21:48
Fizick, want to ask about sigma values to get better compressability. What values should I use for that - 0.5, 1 or others for really clean video (DVD)? are other fft3d parameters to achieve bigger compressability, but not sacrifying (visual) quality?
As I understand, bt=4 mode increases processing time, but also should increase quality (better noise filtering)?
HeadBangeR77
5th February 2007, 23:44
Fizick, want to ask about sigma values to get better compressability. What values should I use for that - 0.5, 1 or others for really clean video (DVD)? are other fft3d parameters to achieve bigger compressability, but not sacrifying (visual) quality?
As I understand, bt=4 mode increases processing time, but also should increase quality (better noise filtering)?
I'm not Fizick himself (:p), but I usually use sigma=0.5-0.7; at 1.0 I've seen some details degradation already. You could also use plane=4 to filter luma and both chroma planes at the same time, which would result in a tad better compressability. The rest at default.
cheers.
EDIT: If you don't mind loosing filmgrain (or most of it) - I don't know your source or your personal preferations - you could also do some more middle-low frequencies filtering without loosing details. For instance:
fft3dgpu(sigma=0.5,bt=3,plane=0,mode=1,degrid=1.0,sigma2=0.6,sigma3=0.7,sigma4=0.8)
fft3dgpu(sigma=0.5,bt=3,plane=3,mode=1,degrid=1.0,sigma2=0.6,sigma3=0.7,sigma4=0.8)
PS. There's a bug in fft3dgpu, that results in the above script being faster than just pure "plane=4". I don't think it affects fft3dfilter though.
HeadBangeR77
13th February 2007, 17:30
I've tested the de-halo function quickly, but I didn't have an appropriate comparison background, so don't take it too seriously. ;) I'm gonna post some screenshots and describe some experiences later on, this night hopefully.
To be updated
HeadBangeR77
15th February 2007, 02:50
Finally I've managed to encode some samples and take some screenshots. I'm not comparing the embedded de-halo function with Didee's scripts (like BlindDeHalo3 or DeHaloAlpha), since I've got very limited experience with those functions. I can only judge on the end effect in comparison with normal and sharpened encodes. My crappy beloved source (shrunk "Black Pearl" DVD) seemed useful for this task ;), since it suffers from some edges enhancement already before sharpening.
1) The first sample, just cropped and resized (nothing more!) - 163MB.
After deblocking and sharpening (LSF + Soothe) - 196MB (I don't include screenshots of this one).
2) The second sample (deblocking, very light denoising, and sharpening) - 184MB.
fft3dfilter(sigma=0.5, plane=3)
fft3dfilter(sigma=0.5, plane=0)
3) The last sample (deblocking, very light denoising with default de-halo values, and sharpening) - 179MB.
fft3dfilter(sigma=0.5, plane=3)
fft3dfilter(sigma=0.5, plane=0, dehalo=1.0, hr=2.0, ht=50)
...screenshots... (http://rapidshare.com/files/16509190/DeHalo.rar)
I couldn't see any details washed away, neither while watching nor while comparing still frames. Some nasty enhanced edges + some textures were darkened (or brightened sometimes) and sort of softened, yet without loosing any details I could spot. Some effects of LSF were undone, though the image remained sharper than the original encode with no filters at all. I must admit I like the end effect - seems more natural than the first two samples. Two examples beneath:
1) http://www.hidebehind.com/thumbs3/7E18F8.png (http://www.hidebehind.com/7E18F8)
2) http://www.hidebehind.com/thumbs3/AE5C2C12.png (http://www.hidebehind.com/AE5C2C12)
3) http://www.hidebehind.com/thumbs3/8266C41F.png (http://www.hidebehind.com/8266C41F)
1) http://www.hidebehind.com/thumbs3/7211839E.png (http://www.hidebehind.com/7211839E)
2) http://www.hidebehind.com/thumbs3/39D42BD.png (http://www.hidebehind.com/39D42BD)
3) http://www.hidebehind.com/thumbs3/EC6C5436.png (http://www.hidebehind.com/EC6C5436)
cheers,
HDBR77
PS. Some ghosting (hard to say if it came from sharpening or from de-halo) can be undone with BlindDeHalo3(PPmode=-3).
Blue_MiSfit
15th February 2007, 15:50
I really like running fft3dfilter/gpu in two instances, one with stronger chroma denoising and one with gentle luma denoising and adding sharpening. I've found that it increases compressibility and image quality at the same time for most sources.
This filter is probably the best chroma denoiser I've ever worked with. Not that I'm an expert or anything..
~MiSfit
Chainmax
16th February 2007, 03:26
I notice that many people prefer to use bt=3 instead of bt=5, why is that?
HeadBangeR77
16th February 2007, 17:19
@ B.MiSfit
I'm no expert at all, but I agree with you. :)
Though in the above sample-case I wanted to keep the grain, so I did a very gentle denoising. De-halo function was my main goal - to see how it works.
@ Chainmax
Most probably from speed reasons. I rarely do any strong denoising, so with values of sigma about 0.5-1.0 I don't think anything can go wrong with bt=3 in terms of accuracy of filtering.
cheers,
HDBR77
HeadBangeR77
19th February 2007, 01:03
@ Fizick:
Since I've noticed you around in some other threads, could you elaborate more on some de-halo settings of your fft3dfilter? As stated above, it basically works very well (at least to my eyes) with default values. Yet some tweaking gave a headache, and the documentation is poor.
Is "dehalo" either enabled (1) or disabled (0) or could it work with some other values, 'cause I can't see any strength settings, just the threshold?
Lowering the threshold setting gave me a bit larger file-sizes while rising a bit smaller. I couldn't see any difference however, even while staring at still frames. Is it supposed to work this way? :confused:
And thanks very much for your work on the filter - appreciated. :)
cheers,
HDBR77
foxyshadis
19th February 2007, 02:24
I notice that many people prefer to use bt=3 instead of bt=5, why is that?
Also, besides the speed: Without any compensation, the further away frames are the less correlation each block has to its counterpart. And if you go through the trouble to invent some map of what matches close enough, so mostly static scenes still get the benefit, you might as well just compensate it anyway. The analysis is a large portion of the time taken.
Fizick
19th February 2007, 06:32
From the offline doc:
dehalo - halo removal strength (float>0, default=50)
It is wrong. :) I fixed doc. Default = 0.0
so you may use 0.0 or 0.1 or 0.5 or 1.0, or 2.5.
Recommended value is about 1.0 for weak dehalo
foxyshadis
19th February 2007, 07:57
My own dehalo question, since I couldn't figure it out from the source - what frequency ranges does it work on? Huge halos, subpixel halos? How exactly does it find them, and how much chance is there of artifacts? Is there any suggested way to tune the parameter, besides trying lots of values and staring really hard?
HeadBangeR77
19th February 2007, 12:17
From the offline doc:
dehalo - halo removal strength (float>0, default=50)
It is wrong. :) I fixed doc. Default = 0.0
I already knew it was wrong, since someone had written that in this thread. I was just wondering if this parameter could work as some kind of strength setting, and ...
so you may use 0.0 or 0.1 or 0.5 or 1.0, or 2.5.
Recommended value is about 1.0 for weak dehalo
This is the answer I was waiting for. :)
Thanks very much for the quick reply. Now I'm ready to tweak and test more. ;)
@ foxyshadis:
I'm almost a complete newbie as to halos-removal, yet I've marked it changes a lot: from the colour of a shirt, through some smaller edges (look at the barrel in the background of the first screenshots) to a thin hair swinging in the air. This with the default values.
I've made a mistake as to the threshold. With the default value of 50 I had smaller files than with e.g. ht=80. So the lower the threshold the more halos are removed, most probably more subtle ones (just a guess, since I couldn't spot differences).
cheers,
HDBR77
PS. As to artefacts, I could see some ghosting, most probably from the poor source and additional sharpening, yet they were just a bit more noticeable with denoising + de-halo + sharpening than without de-halo (the rest of the filter-chain remained the same). BlinDeHalo3 PP is good at fighting the problem, but sometimes it's got a weird darkening effect on small things like eye's iris. :confused:
Fizick
19th February 2007, 18:49
For dehaloing I use some frequecy window with max around 1/hr, small at low and high frequencies.
hr is halo radius (in pixels).
I am not sure, that the formula is optimal. But it works somehow :)
But general rule: do not overdenoise, do not oversharp, do not overdehals.
HeadBangeR77
19th February 2007, 23:34
For dehaloing I use some frequecy window with max around 1/hr, small at low and high frequencies.
hr is halo radius (in pixels).
I am not sure, that the formula is optimal. But it works somehow :)
But general rule: do not overdenoise, do not oversharp, do not overdehals.
I try to stick to the rule, you must have noticed on the basis of my fft3dfilter's parameters. ;)
I don't care how it works (some guys here are probably very interested in the matter), as long as it works, and, I must admit, I haven't seen any details removed with your default de-halo values. And I suffer enormously if I have to compromise between a certain details' loss and removing artefacts or any other unwanted stuff.
Just one remark/question, and I'm gonna leave you in peace (:D): I've noticed a bit more ghosting (or gentle ringing) with de-halo enabled (the rest of my scripts were exactly the same). Is there any way to get rid of this?
cheers,
HDBR77
Fizick
20th February 2007, 01:36
dehalo is pure spatial. It is applied after denoising.
HeadBangeR77
20th February 2007, 02:35
Must have been one step too far with all those edges operations (Deblock-QED, De-Halo, LSF). ;)
I will risk doing the things the other way round and put BlindDeHalo3 PP before fft3dfilter. It does wonders when applied before sharpening, and works much worse after sharpening, most probably because of some ringing/ghosting in the source, that could be eliminated before LSF, and after LSF the artefacts are simply too strong. Never mind. ;)
cheers and thanks again for clarifying. :)
Fizick
21st February 2007, 14:36
released new version 2.1.1 - February 20, 2007 - fixed bug with bw not mod 4 (restored v1.9.2 method, thanks to JKinG for report).
HeadBangeR77
22nd February 2007, 03:04
Thanks very much!
Btw. De-halo works like charm, shame I don't have enough time to compare it against Didee's scripts, but "my need was dire, and the time was short". ;)
Keepitsimple
6th March 2007, 21:36
can this script be run in real time?
708145
7th March 2007, 13:25
can this script be run in real time?
Yes, if you use a cluster encoder like x264farm or ELDER. ;)
netrex
20th March 2007, 08:20
I only get this message:
FFT3DFilter: Can not load FFTW3.DLL!
(info about where the error is)
When I add FFT3.DLL I get the message:
fftw3.dll is not an AviSynth 2.5 plugin.
I get this using versions 1.8.5, 1.9.1 and 2.1.1. And I have AviSynth 2.5.7 installed. I got the same with 2.5.6 as well.
Maybe I have the wrong version of fftw3.dll?
:stupid:
I realized that the fftw3.dll file had to go in my system32 folder :P NOT the AviSynth\plugins folder :) So now it works like I had it before.
Thanks again for this wonderfull tool :thanks:
Boulder
20th March 2007, 08:23
Did you put the file in your Windows\System32 directory? And don't load it in your script, it is automatically used if it's in the correct place.
netrex
20th March 2007, 08:26
Did you put the file in your Windows\System32 directory? And don't load it in your script, it is automatically used if it's in the correct place.
I just edited my previous post as you posted this :) Thansk still though :)
superuser
10th April 2007, 22:37
did not notice fizick had newer version of fft3d out. will give it a try. thnxs fizick for ur efforts :thumbup:
turstar
15th April 2007, 18:45
Script error!
Import("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\LimitedSharpen.avs")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\undot.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\MaskTools.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\WarpSharp.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\colormatrix.dll")
LoadPlugin("C:\PROGRA~1\GORDIA~1\AviSynthPlugins\fft3dfilter.dll")
mpeg2source("D:\DVD\RAISING_CAIN\VIDEO_TS\VTS_01_5.gk.d2v")
crop(4,16,712,546)
LanczosResize(704,384)
FFT3dFilter(sigma=2.0, plane=0, bt=-1, bh=32 ,bw=32, measure=false, sharpen=0.5)
LimitedSharpen( ss_x=1.5, ss_y=1.5,
\ Smode=3, strength=40, radius=2,
\ Lmode=1, wide=false, overshoot=1,
\ soft=false, edgemode=0, special=false,
\ exborder=0 )
UnDot()
ColorMatrix()
http://img160.imageshack.us/img160/1439/aaaaaaadu0.jpg
problems ???
Fizick
15th April 2007, 21:51
Tamam
steve77
17th June 2007, 22:02
Hey,
I've just installed Windows Vista and have restored my collection of filters.
However, for some strange reason, FFT3DFilter is actually going MUCH faster than it used to in XP!
Mpeg2Source("TV.d2v")
Lanczos4Resize(720,400)
FFT3DFilter(sigma=2,bw=32,bh=32,ow=16,oh=16)
Using the following settings in MeGUI:
--pass 1 --bitrate 1427 --stats "D:\Feed.stats" --ref 5 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --bime --weightb --filter -1,-1 --trellis 1 --analyse all --8x8dct --me umh --merange 24 --threads 2 --thread-input --progress --no-dct-decimate --no-psnr --no-ssim --output NUL "D:\Feed.avs"
successfully started encoding
Is yielding me nearly 10FPS!
I made sure the filter was working by using the "#" in front of the FFT3DFilter line, and comparing some frames with or without FFT3DFilter.
I'm running a core 2 duo E6300 @ 2.4GHz... but in XP it would be about 1FPS, not 10x that!
Any insight? If you need more info, I'll gladly post what I can.
ficofico
17th June 2007, 22:09
maybe you have forget bt=5
grannyGeek
20th June 2007, 02:27
Could someone post Fizick's newest FFT3d version 2.5 to RapidShare or some other file-hosting site?
Pretty Please?
I've been trying several times a day for a week to access Fizick's site to get the filter, and always get Network Error (tcp_error)
(it might be our corporate firewall that blocks me.)
I will be most grateful for any assistance. I'm hoping the new version will fix my dehalo call glitch that I posted about on anot6her thread.
:thanks:
Boulder
20th June 2007, 03:31
Here's the latest version (v2.1.1):
http://www.savefile.com/files/824261
superuser
20th June 2007, 04:29
^ i also went to check out for fft3d 2.5.* and found 2.1.1 was the latest (which m using happily for more than past 2 months :) ) ... though I m able to access the fizicks site where he hosts all the filters.
had question for Fizick: in 2.0.0 rev you had included internal MC and in 2.1.0 you had temporarily removed it. Is inbuilt MC feature going to be supported in your upcoming release?
Fizick
20th June 2007, 14:28
What upcoming release? I have no any plan for it.
Attemt of internal MC was not ver good (many artefactes)
superuser
22nd June 2007, 05:49
^ thnxs for the feeback.
by upcoming release I meant one of the next fft3d releases, whenever u plan to release it.
was the MC idea in fft3d which u had previously on similar lines what you and Manao have implemented in MVTools? Currently I use fft3d as external denoiser with MC (mvtools) and it works gr8 for me ... is internal MC one of the features you will be working on for upcoming releases, not immediate ones but sometime in future whenever u feel it is appropriate time to work on.
Fizick
22nd June 2007, 15:19
no, i tried to use phase shift method for MC
superuser
23rd June 2007, 05:13
^ oh k .... thnxs ...
grannyGeek
25th June 2007, 03:19
@ boulder -
Thank you so much for the dl link.
Using the new version now, very nice.
Sadly, doesn't fix my "lock-up with multiple dehalo calls", but that's ok.
fjhdavid
12th July 2007, 09:20
Dear all,
Thanks for this great filter!
I use it a lot
after reading the documentation I am still asking a question:
what are the default settings for bw,bh,ow and oh in the last fft3dfilter version?
thanks
Francois
Boulder
12th July 2007, 09:25
They are explained in the Function parameters section in the docs..
fjhdavid
12th July 2007, 09:57
yes but it changes many times and I just would like to be sure
I think it is (last release): bw=bh=32 and ow=oh=16
could you confirm please?
thanks
Boulder
12th July 2007, 10:14
Straight from http://avisynth.org.ru/fft3dfilter/fft3dfilter.html:
bw - block width (integer, default = 48 since v.1.2)
bh - block height (integer, default = 48 since v.1.2)
ow - overlap width (default=bw/3 since v.1.2)
oh - overlap height (default=bh/3 since v.1.2)
fjhdavid
12th July 2007, 10:53
no in the change log it said that since version 1.9.2 (11 september 2006)
"changed default bw=bh=32"
but nothing about oh and ow, so if they stay unchanged to bw/3 and bh/3, there is a problem as 32 is not a multiple of 3
so this is why I post this question.
thanks for your help.
Boulder
12th July 2007, 10:59
Oh, I see that Fizick hasn't updated the actual documentation but the changes are only in the change log. In v2.1.1 it says that "fixed bug with bw not mod 4 (restored v1.9.2 method, thanks to JKinG for report)". Whatever that means..
fjhdavid
12th July 2007, 11:13
so what does it means?
fjhdavid
13th July 2007, 13:05
dear all,
I saw in the documentation that sigma for dvd should be between 1.5 and 2.5 with a default value of 2. For analogue record a sigma of 3 and above is better.
Does somebody has used this filter for DVD which was recording from a digital satellite with an analogue conversion between.
Which value of sigma did you use then?
thanks
Francois
canuckerfan
25th July 2007, 20:35
would the dll in ftp://ftp.fftw.org/pub/fftw/fftw3win32mingw2.zip be compatible with this filter?
SuperDuperDave
26th July 2007, 02:19
would the dll in ftp://ftp.fftw.org/pub/fftw/fftw3win32mingw2.zip be compatible with this filter?
If that's the official build, it works for me. Just make sure you use the right DLL.
canuckerfan
26th July 2007, 03:37
well I was just curious because it is newer than the dll posted at: ftp://ftp.fftw.org/pub/fftw/fftw3win32mingw.zip
TheRyuu
26th July 2007, 05:34
well I was just curious because it is newer than the dll posted at: ftp://ftp.fftw.org/pub/fftw/fftw3win32mingw.zip
They're basically the same. Read the readme that comes with the "newer" one.
Alessio didn't include gcc library file (*.a) with his distribution, so extra work was needed to use fftw3 with MinGW.
So only difference would be an added *.a file as far as I can tell.
Correct me if I'm wrong though. :)
BTW, I'm loving fft3dfilter. Just started to use it though. Playing around with all those settings. I'm finding it more powerful then the degrain median I was using. Although removegrain+vague denoiser I still use for extremely noisy animation sources.
SetMTMode almost doubles the speed of it (yay). :)
It is slow, but 15-20fps on a first pass isn't that slow is it? (I can hit about 9fps on the second pass).
Thanks Fizick for all your hard work on it.
:thanks:
grannyGeek
30th July 2007, 07:31
wizboy11, (or anybody who knows) please explain
SetMTMode almost doubles the speed of it (yay).
Where is this "SetMTMode " found?
thanks for any help.
Boulder
30th July 2007, 07:32
http://forum.doom9.org/showthread.php?t=94996
grannyGeek
30th July 2007, 08:48
Boulder, once again you come to my rescue!
Many thanks for the info --- maybe I will now be able to achieve better than 5 fps with my fft3d script :)
Fizick
22nd September 2007, 09:26
Hi Fizick. It's me Jeremy.
I started to use you FFT3DFILTER and I think it's very nice.
I looked at the link to FFTW in the readme and they have newer versions of FFTW than the 3.0 version in use now.
I'm hoping you can update the FFTW3.dll and your FFT3DFILTER so it uses the new FFTW3.dll :)
I'm know that FFT3DFILTER can be used in realtime in FFDshow, so that's why I want to see if it can get faster with the new FFTW, for realtime.
Here's the link: Link (http://www.fftw.org/release-notes.html)
Answer was written here:
New FFTW Version 3.1 is out http://www.fftw.org !
Download the Win32 binaries, extract libfftw3f-3.dll, rename it to fftw3.dll and replace the old one in the \windows\system32 folder.
Somehow it was a bit slower than the old binary (AthlonXP 3000+ / Barton core). Please post some of your benchmarks (can be done with benchf.exe from the archive)
...
FFFTFliter use dynamic linkage of FFT3W.DLL (with LoadLibrary), so it should work for all new versions of FFTW3 (until API is preserved).
Please test and report here
Demi9OD
22nd September 2007, 14:53
I found it to be slower by a couple of FPS as well. I get 67fps with whatever version is packaged with fft3dfilter (mpeg2source video analysis pass in vdub) and 65fps with this version.
Jeremy Duncan
23rd September 2007, 21:19
Will this setting include Temporal denoising, spatial denoising or both ?
FFT3DFILTER(sigma=0.6, ncpu=4, bw=14, bh=14, ow=7, oh=7, bt=2, dehalo=1, hr=1, sharpen=0.9)
I ask because in the read me, only bt=0 mentions temporal.
Fizick
23rd September 2007, 22:04
both.
Jeremy Duncan
4th October 2007, 02:16
One feature request.
I use fluxsmootht before fft3dfilter because I'm not happy with the temporal denoising strength of fft3dfilter using these settings:
FFT3DFILTER(sigma=0.6, ncpu=2, bw=14, bh=14, ow=7, oh=7, bt=2, dehalo=1, hr=1, sharpen=0.9)
Spatial denoising is fine though.
What would be nice is a setting that adjusts the temporal denoising, specifically.
Then i wouldn't need to use fluxsmootht. :)
Also, ncpu doesn't use the maximum avail cpu.
Fizick
5th October 2007, 05:07
What is "not happy" in technical language?
Dark Shikari
5th October 2007, 05:10
TTempSmooth is quite good for extra temporal denoising IMO :cool:
My favorite denoising script is:
MVAnalyze crap
MVflow/interleave crap, interleave 3 frames (one in each direction)
FFT3DFilter/GPU
TTempSmooth radius 1
selectevery, etc
TTempSmooth radius 7
Jeremy Duncan
5th October 2007, 20:25
What is "not happy" in technical language?
No FluxsmoothT
Picture of No FluxsmoothT (http://fileserver2.jpghosting.com/images/NoFluxsmoothT_01375d61cbbbf00e2e9572b3b4d969b1.JPG)
Using FluxsmoothT
Picture of FluxsmoothT (http://fileserver2.jpghosting.com/images/UsingFluxsmoothT_94b4785448701d3296811f0e605b983f.JPG)
Subtract
Picture of Subtract (http://fileserver2.jpghosting.com/images/Subtract_42c9a1ec5bb5d22f3d3ed6d192c1a585.JPG)
Unprocessed clip from Rapidshare (http://rapidshare.com/files/60508294/Tears_of_the_Sun_2.zip.html)
Unprocessed clip from Megaupload (http://www.megaupload.com/?d=O13C2XKP)
If you compare the pictures of No FluxsmoothT and Using FluxsmoothT, you'll see there is difference in the dark area on the right of the picture.
This difference flickers rapidly if I don't use fluxsmoothT(1).
So, then if fluxsmootht(1) fixes it, then the temporal denoising of FFT3DFILTER is just shy of the nessessary strength.
Which is why I asked for a temporal knob to turn to set the temporal denoising strength. :)
That difference in subtract is a result of noise flickering.
And I was wondering if tsp could help you tweak the ncpu so it uses the maximum cpu available. :)
Fizick
5th October 2007, 21:30
If you need in simple deflick, use fluxsmooth.
fft3dfilter has quite different algo than fluxsmoothT.
The "defilicking" strength of fft3dfilter is controlled by bt parameter. For bt=2 it is minimal. Did you try bt=5? ;)
(but may be there are some rounding semi-bug in fft3dfilter)
sorry for weak ncpu support. consider it as preliminary blind attempt. IMHO we must have official multi-cpu avisynth 2.6 at first. Make a present (core 2 duo) to IanB ! :)
Jeremy Duncan
6th October 2007, 13:59
"The "defilicking" strength of fft3dfilter is controlled by bt parameter. For bt=2 it is minimal. Did you try bt=5? " - Fizick
Does the BT also affect the spatial denoising too ?
Fizick
6th October 2007, 21:01
yes, of course.
It is spatio-temporal (really mixed, not by sequence) filter.
i am still think how to make variable temporal stength in fft3d....
Vesi
23rd October 2007, 16:31
Hi All!
i'm compeletly new to this filter, i read this thread a bit and fft3d documments.
Most of the time i do rips from DVD Movies to xvid and x264, and i want to know, what are the good and important settings, like to set light denoising and strong?
Like i used this script fft3dfilter(sigma=1.5, bt=3, bw=32, bh=32, ow=16, oh=16, sharpen=0.5)
for one test, and the result was good to me, but still wondering, did i chose the right parmeters or it is strong for New good locking DVD?
2.FFT3D Filter already has it's own sharpener, is it relay nesesery to use other sharpner, like seesaw or LSFwith FFT3D filter? and what are the differences between thes sharpners?
Sorry for bad English :)
Demi9OD
24th October 2007, 02:14
If you have a clean source .7-1.0 sigma is sufficient. Anywhere over 2.0 sigma is for strong noise. 1.5 is a happy median. Those parameters you have are good, I run something very similar real time for DVD playback. The sharpening in fft3d is also quite good, I personally don't think you need LSF or seesaw with fft3d. .4-.7 are good sharpen values, above that you start to get halo'ing, which I don't feel is handled well by fft3d's dehalo.
Vesi
24th October 2007, 10:48
Demi9OD thanks for the replay.
what bt=1-5 do? and which one is recommended?
if i get halo'ing, which filter you recommend?
Demi9OD
25th October 2007, 20:57
The higher the bt, the more frames it uses to detect noise. I like using bt=3, and don't see personally see the benefit of going higher, but I am sure there is some, at the cost of speed.
dehalo_alpha does a great job of removing Halos, but it is processor intensive as well. This is my realtime script, I would use higher bw/bt/ow/oh for encoding, but I can manage this on my quadcore at 3.1ghz.
MT("FFT3DFILTER(sigma=1.5,bw=16,bh=16,bt=3, sharpen=1).dehalo_alpha(darkstr=.3).gradfun2db()",6,2)
aWarpSharp(depth=20, blurlevel=2, thresh=0.21, cm=0)
I strongly recommend against using a sharpen as strong as 1 without a dehalo afterwards.
Vesi
24th November 2007, 22:25
nOOb question ;
I have tried to uderstand, but I couldn't.
ow - overlap width (default=bw/3 since v.1.2)
oh - overlap height (default=bh/3 since v.1.2)
as for bw and bh the default values are 48.
What are default values for ow and oh? is it 3? or i got it wrong.
how to use them in strong denoising and in light?
show them in two defrint script "strong and light", well be great and easy to understand. thanks
Dark Shikari
24th November 2007, 22:32
nOOb question ;
I have tried to uderstand, but I couldn't.
ow - overlap width (default=bw/3 since v.1.2)
oh - overlap height (default=bh/3 since v.1.2)
as for bw and bh the default values are 48.
What are default values for ow and oh? is it 3? or i got it wrong.
how to use them in strong denoising and in light?
show them in two defrint script "strong and light", well be great and easy to understand. thanks
bw = 48
bw / 3 = 48 / 3 = 16
Vesi
24th November 2007, 23:16
thanks Dark Shikari for the Quick answer.
what are the good values for the "bw & bh" and "ow & oh" for light and strong denoising?
Dark Shikari
24th November 2007, 23:23
thanks Dark Shikari for the Quick answer.
what are the good values for the "bw & bh" and "ow & oh" for light and strong denoising?Leave them as they are.
Spuds
25th November 2007, 00:43
what are the good values for the "bw & bh" and "ow & oh" for light and strong denoising?
Before you play with the block sizes and overlap start with changing the sigma value which is the denoising strength. Generally apply a higher sigma to plane 0 (luma) and lesser to plane 4 (color).
talen9
25th November 2007, 02:19
Before you play with the block sizes and overlap start with changing the sigma value which is the denoising strength. Generally apply a higher sigma to plane 0 (luma) and lesser to plane 4 (color).
Sorry Spuds ... IIRC, that was the other way around. That is, it's possible to apply a higher sigma to the color planes than to the luma ones, because the eye is more sensible to luminosity variations than to chroma ones ... am I mistaken? :confused:
EDIT: in the examples given in the documentation, chroma's sigma is actually always slightly higher than luma's ...
Dark Shikari
25th November 2007, 04:44
Sorry Spuds ... IIRC, that was the other way around. That is, it's possible to apply a higher sigma to the color planes than to the luma ones, because the eye is more sensible to luminosity variations than to chroma ones ... am I mistaken? :confused:
EDIT: in the examples given in the documentation, chroma's sigma is actually always slightly higher than luma's ...But in most film footage (not low-quality camera footage, but real film), most of the noise is in luma, not chroma--so even while you'll notice chroma artifacting less, most of the noise is in luma anyways.
talen9
25th November 2007, 15:12
Hmmm ... true :)
Anyway, I suppose that it depends on what is the target of the denoising action.
If it is to improve the visual quality of the clip, then it is correct not to denoise too much the chroma planes ('cause you won't get much visual improvement).
Then again, if you're bitrate-wise hungry, one could slightly force the denoising on chroma without worsening too much the quality, right?
Even if, i must tell the truth, in doing so i started to notice some blocking, especially when the output is to be encoded by x264 ...
Spuds
25th November 2007, 18:29
I should know better then to make generalized statements ! I now want to update my previous generalization with this paradoxical one instead .. Generally no two video clips are the same so no generalizations should be made.
Great Dragon
10th January 2008, 14:59
I've receive an ugly color gradient after filter processing (on wall)
Original:
http://img141.imageshack.us/img141/5584/172497originalnk5.th.jpg (http://img141.imageshack.us/my.php?image=172497originalnk5.jpg)
Filtered:
http://img140.imageshack.us/img140/5185/172497fft3dle9.th.jpg (http://img140.imageshack.us/my.php?image=172497fft3dle9.jpg)
How can i fix it or avoid it...?
mpeg2source("D:\DVD\MainMovie\XMEN2 DISC1\VTS_01_1.d2v", idct=5, cpu2="ooooxx")
Colormatrix(mode="Rec.709->Rec.601")
FFT3DFilter(sigma=2, bt=5, bw=32, bh=32, ow=16, oh=16, plane=4)
tsp
10th January 2008, 17:34
great dragon: read this thread: http://forum.doom9.org/showthread.php?t=132791 for a fix
Great Dragon
11th January 2008, 16:43
tsp
Thanx for advice but gradient is to strong.
I've also try gradfun2db filter but it makes picture even worse :(
tsp
11th January 2008, 19:21
FFT3DFilter(sigma=2,sigma2=0.1,sigma3=0.5,sigma4=1, bt=5, bw=32, bh=32, ow=16, oh=16, plane=4)
or try lowering sigma2 or sigma3 even more. You can see the gradient because you filter out all the grain that are hiding it.
anonova
17th April 2008, 13:30
I've been using dfftest for a while, and fft3dfilter seems to be much faster alternative. Though when I try it, why does it produce much darker results? I thought it was because I was using plane=4, but dfftest filters all three planes by default and does not darken the image.
Also, what is the difference between increasing the overlap and block widths versus increasing just the sigma?
thetoof
17th April 2008, 16:17
much darker results
Could you post some screenshots? It's easier to see images than try to figure out what "much darker" is ;)
I've been using both for a while and I've never seen what you described...
edit: about block size and sigma: too big or too small = miss some noise, sigma=strenght of the filter. One is how the analysis is done and the other is how the filter acts based on that analysis. (well... if I'm not mistaken :p)
anonova
17th April 2008, 21:07
Could you post some screenshots? It's easier to see images than try to figure out what "much darker" is ;)
I suppose me saying much was exaggerated, but it does produce a darker image. I noticed it when I was flipping through tabs on AvsP.
source (http://img236.imageshack.us/img236/5518/sourcekw1.png)
dfftest (http://img236.imageshack.us/img236/6931/dfftestdr5.png)
dfttest(sigma=.42, tbsize=3)
fft3dfilter (http://img247.imageshack.us/img247/183/fft3dfj7.png)
fft3dfilter(sigma=1, plane=4)
edit: about block size and sigma: too big or too small = miss some noise, sigma=strenght of the filter. One is how the analysis is done and the other is how the filter acts based on that analysis. (well... if I'm not mistaken :p)
I wonder wondering because fft3dfilter(sigma=1, plane=4) and fft3dfilter(sigma=.73, bw=32, bh=32, ow=16, oh=16, plane=4) produce strikingly similar results with the former being faster.
thetoof
17th April 2008, 22:23
True... small difference, but negligible imo.
32/16 is more accurate than the defaults, so I think that's why less strenght is needed to achieve similar results.
Dragon4333
24th April 2008, 03:32
can anyone help me get this filter to work with windows 64 bit os.
Dragon4333
24th April 2008, 11:27
never mind i got it to work by using the loaddll filter.
Terranigma
23rd May 2008, 02:01
Fizick, any chance we can get fft3dfilter with bt up to 9, so that we can use the bt parameter with 4 forward/backward frames properly?
Fizick
23rd May 2008, 18:09
IMO It is not useful.
Terranigma
23rd May 2008, 18:55
IMO It is not useful.
Well I thought i'd ask. Just in case someone would want to use fft3d with 3 frames in a similar fashion to mvdegrain3, or go one step beyond and use 4 frames.
thetoof
24th May 2008, 01:12
From what I tried, using a LOT of frames with a frequency based denoiser doesn't help much. Having a tbsize superior to 5 in dfttest didn't help (and results were even worse than 5), so I don't think it should be implemented in fft3dfilter.
Terranigma
24th May 2008, 04:18
From what I tried, using a LOT of frames with a frequency based denoiser doesn't help much. Having a tbsize superior to 5 in dfttest didn't help (and results were even worse than 5), so I don't think it should be implemented in fft3dfilter.
OK, then since you guys feel strongly about this, then ignore my request here. But what do you think about my request in the mvtools thread, to implement MVDegrain4 instead of us having to resort to a much slower scripted version? :)
thetoof
24th May 2008, 06:51
That may be nice... it all depends on the visual/compression improvement it leads to. ;)
Didée
24th May 2008, 09:19
... to implement MVDegrain4 instead of us having to resort to a much slower scripted version? :)
Slower? Why slower, and why much?
Simulating MVDegrain3 with Merge(MVDegrain2,MVDegrain1), it shows that both are running at about the same speed.
(Actually, the Merge-version even seems to run a tad faster!)
Thus, you can't really argue about speed.:) If at all, you've to argue about precision, which is lower in the Merge-version, due to rounding. (Mostly +/-1 in the end, the world breaks apart...)
Edit: Example framework posted here (http://forum.doom9.org/showthread.php?p=1141506#post1141506).
Terranigma
24th May 2008, 14:23
Slower? Why slower, and why much?
Simulating MVDegrain3 with Merge(MVDegrain2,MVDegrain1), it shows that both are running at about the same speed.
(Actually, the Merge-version even seems to run a tad faster!)
Thus, you can't really argue about speed.:) If at all, you've to argue about precision, which is lower in the Merge-version, due to rounding. (Mostly +/-1 in the end, the world breaks apart...)
Well for me, a scripted mvdegrain3 with the correct weightings was around, 1.5fps slower than the actual filter by Fizick.
I don't know why, but it was, and yes I agree, precision is important. :)
egrimisu
25th June 2008, 19:26
When i use fft3dfilter with the default settings the cleaning i great but i get so mind of trails especiali if i have a vertical line that moves from left to right.
Adub
25th June 2008, 19:45
Eh, what?
What is a "mind of trails"? Please try and restate your intention.
egrimisu
26th June 2008, 07:45
In the anime scene a girls hair is moving, when the hair is moving in the next frame remains a few trails from the previews frame. Like blending but not that intense. If it's necesary i'l post some screens
fjhdavid
2nd July 2008, 09:46
Dear all,
I read a "denoising comparaison" from soulhunter (http://soulhunter.chronocrossdev.com/dcpart1.htm) , and it is written that between bt=1 end bt=3, the S/N is not so different (you have just to change a litle bit the sigma value).
Do you think the S/N is the only parameter to take into account, as the processing speed difference between bt=1 and bt=3 is very important!
does anybody look carefully at the difference between bt=1 and bt=3?
thanks
Francois
egrimisu
2nd July 2008, 09:51
What is the BT ? i tried BT=1 and BT=5 and with bt=5 i got a a frame a line that normaly would appear in the next frame or the second frame.
What is the BT ? i tried BT=1 and BT=5 and with bt=5 i got a a frame a line that normaly would appear in the next frame or the second frame.
BT=1 --> spacial
BT=2 --> spacial + temporal (prev frm)
BT=3 --> spacial + temporal (prev + next frm)
BT=4 --> spacial + temporal (2 prev + next frm)
BT=5 --> spacial + temporal (2 prev + 2 next frm)
egrimisu
2nd July 2008, 11:27
And why are details from next frame apear in the curent frame using BT=5? is that normal?
And why are details from next frame apear in the curent frame using BT=5? is that normal?
it's call "ghosting", it's appear with high sigma....
egrimisu
2nd July 2008, 14:26
It's quite visible with sigma=0.7 , am i doing something wrong?
It's quite visible with sigma=0.7
So use only spatial mode.
Fizick
2nd July 2008, 17:18
egrimisu,
what is "quite visible"? provide a script and short source and output clips (or images)
fjhdavid
3rd July 2008, 14:57
sorry to ask my question a second time.
assuming we are talking about progressive source film (PAL or others progressive source),do you think that 80% or 90% of the "denoising work" is already done with the spatial denoiser setting alone (bt=1)?
thanks for your comments and visual experience
Francois
Soulhunter
3rd July 2008, 18:48
I read a "denoising comparaison" from soulhunter (http://soulhunter.chronocrossdev.com/dcpart1.htm) , and it is written that between bt=1 end bt=3, the S/N is not so different (you have just to change a litle bit the sigma value).
Actually a difference of ~0.8dB isn't that small! I know, this numbers can be irritating when you are not used to interpret them... But to give you an idea: "The MPEG committee used an informal threshold of 0.5 dB PSNR to decide whether to incorporate a coding optimization because they believed that an improvement of that magnitude would be visible... (from some paper about PSNR)" So, a increase of ~0.8dB can mean a visible improvement! :]
Bye
fjhdavid
4th July 2008, 08:30
Soulhunter thanks for the info!
do you know what is the typical lost in term of S/N (in dB) when you are doing a re-encoding with a good mpeg2 encoder like CCE (two pass and best settings)?
Fizick and Soulhunter, with fft3dfilter filter (sharpen only (bt=-1))
is it better to sharpen AFTER or BEFORE a lanczos up-scale resizing (or is there no difference)?
for best sharpening, is it better to process ALL the color planes, or is it better to process ONLY the luma chanel?
Thanks
Francois
Soulhunter
4th July 2008, 14:41
do you know what is the typical lost in term of S/N (in dB) when you are doing a re-encoding with a good mpeg2 encoder like CCE (two pass and best settings)?
At what bitrate!? Full SD movie -> DVD5? Dunno... Im not that much in MPEG2 encoding, but I can tell you that a good MPEG4 ASP encoder (XviD) can reach 50dB (thats ~ the threshold I consider as visual identical compared to the source) or more in this scenario!
...is it better to sharpen AFTER or BEFORE a lanczos up-scale resizing (or is there no difference)?
Dunno... Try it n share your results with us! :]
for best sharpening, is it better to process ALL the color planes, or is it better to process ONLY the luma chanel?
Normal shapening wont do much on the chroma planes, at least if you work with YV12 content! YV12 = Strong subsampling -> So, depending on the renderer the output will be either strongly aliased (upsampling without interpolation) or blurry (with interpolation) no matter if you sharpen it beforehand... Only thing that can be advantageous in some cases (chroma bleeding) is to use some warpsharp on the chroma planes. For non subsampled YUV on the other hand, sharpening the U/V planes can help... Tho not as much as on the luma plane, because changes on the chroma are much less visible for the human eye than changes on the luma!
Bye
fjhdavid
4th July 2008, 14:54
thanks Soulhunter!
for the mpeg2 re-encoding I leave with the same bitrate (dvd5 -> dvd5), so the S/N ratio would be greater than even 50dB in this case (and with no visual difference)?
I will test sharpening before and after resizing...and I will tell you (but since I read in several places that after is better...)
last question, I read threads about denoising and it appears that most of the "bad noise (most visible)" is in the chroma planes, and that the "grain noise" is in the luma plane.
do you agree?
so can I conclude that I have to use an even stronger sigma on colors planes than on the luma plane?
Soulhunter
4th July 2008, 15:36
for the mpeg2 re-encoding I leave with the same bitrate (dvd5 -> dvd5), so the S/N ratio would be greater than even 50dB in this case (and with no visual difference)?
Probably not, as MPEG2 should do worse than MPEG4...
You could do a quick PSNR compare (5000 frames or so) to find out!
last question, I read threads about denoising and it appears that most of the "bad noise (most visible)" is in the chroma planes, and that the "grain noise" is in the luma plane.
do you agree?
so can I conclude that I have to use an even stronger sigma on colors planes than on the luma plane?
For me, chroma noise isnt really much more visible than luma noise, but I find it much more disturbing than luma noise! So, yes... Supposed the amount of noise is equal in Y and U/V, Id denoise the chroma different/more than the luma. But fortunately this situation (more chroma than luma noise) is very very rare! :]
Bye
fjhdavid
4th July 2008, 16:03
in your last sentence, you wanted to say "supposed the amount of noise IS NOT equal in Y and U/V" instead of "supposed the amount of noise IS equal in Y and U/V", right?
so, most of the time, I should used the SAME sigma for all the planes (Y, U and V)? right?
Soulhunter
4th July 2008, 16:52
in your last sentence, you wanted to say "supposed the amount of noise IS NOT equal in Y and U/V" instead of "supposed the amount of noise IS equal in Y and U/V", right?
I wanted to say that usually the amount of noise (measured/objective amount, not visible/subjective amount) in the chroma is lower than in the luma (also caused by the fact that you work with YV12 content -> Subsampling/Upsampling = Detail loss -> Loss of noise). But if the amount of chroma noise would be at the same level as in the luma, id denoise the chroma stronger than the luma... Because I find chroma noise more disturbing than luma noise! So, I guess the my sentence was right!? >.>
so, most of the time, I should used the SAME sigma for all the planes (Y, U and V)? right?
Supposed you find chroma noise more disturbing than luma noise (like me), yes! Fortunately you wont really notice "oversmoothing" that much on the chroma planes like on the luma planes! So its unlikely you do harm to the chroma by picking a equal value for luma n chroma. Final advise: Better use your eyes, not my suggestions, for tweaking filter settings... After all its a pretty subjective thing (what looks better n what not) eh!? ;]
Bye
fjhdavid
6th July 2008, 11:23
Soulhunter thanks one more time for your knowledge! It helps me a lot
I am sorry for my post about bt=1 vs bt=3 speed comparaison. I did tests more carefully yesterday, and the speed difference between bt=1 and bt=3 (with the others settings equal) is not more than 10% ! so don't ask yourself and go directly for bt=3...!
Soulhunter,
I would like to know if your "denoise PSNR results" are DVD or noise dependant, I mean if the sigma ranking and value would be almost the same with an another DVD or noise amplitude value (even if the PSNR value are, of course, different)?
As I have more time, I would like to do PSNR measure myself with my DVD which are records from a digital satellite with an analogue cable (RVB scart). I know that I have to choose a sigma=3 or above (seen in FFT3Dfilter documentation), but I would like to test others parameters like bw, oh...
could you send me your comparaison program or tell me how to measure PSNR directly with a DVD?
thanks
Francois
Soulhunter
6th July 2008, 14:52
I would like to know if your "denoise PSNR results" are DVD or noise dependant, I mean if the sigma ranking and value would be almost the same with an another DVD or noise amplitude value (even if the PSNR value are, of course, different)
As you can derivate from my comparison, the ranking doesnt depend much on the footage type (ranking order was almost the same for the film and the anime source iirc). But the kind of noise you cope with could indeed alter the results to some degree (the worst wont get the best or the other way around, but 1st n 2nd could switch places or whatever...). And, as the kind of noise is different from DVD to DVD, results could change here as well!
As I have more time, I would like to do PSNR measure myself with my DVD which are records from a digital satellite with an analogue cable (RVB scart). I know that I have to choose a sigma=3 or above (seen in FFT3Dfilter documentation), but I would like to test others parameters like bw, oh...
could you send me your comparaison program or tell me how to measure PSNR directly with a DVD?
How you wanna compare the different parameters via PSNR in this scenario? I mean, you would need a noise free version of your source (which represents the optimum you try to reach via denoising). Otherwise you would just measure the difference to the source (which can also mean removal of detail etc.) and not the denoising efficiency! Thats why I used a clean source (ClipA) for my compare and added artificial noise resulting in ClipB. Then I applied the different denoisers on ClipB to get ClipC. Finally I compared ClipA vs ClipC... You see the difference? Anyway, if you want to do PSNR comparisons, you can use Avisynths Compare() (http://avisynth.org/oldwiki/index.php?page=Compare) or some tool like this (http://compression.ru/video/quality_measure/video_measurement_tool_en.html).
Bye
fjhdavid
9th July 2008, 09:19
thanks Soulhunter,
after three re-encoding I come to the conclusion that there is no difference between sharpening after or before upscale resizing (at least I am not able to see them)
BUT, I have another problem:
I use FFt3Dfilter (sigma=3,bh=32,bw=32,oh=8,ow=8,sharpen=1) (oh=ow=8 for speed reason).
I do then a split with a stackhorizontal and HONESTLY I am not able to see the difference between the original part (on the left) and the filtered part(on the right).
I have a projector (the image is really big) and I just look at the film even close.
Do I have to do still frame and look more carefully? (I remembered pictures on the web, showing big difference).
I don't understand because my film is not perfect and sigma=3 and sharpen=1 are big values).
any comments?
francois
Boulder
9th July 2008, 09:32
Please post the complete script that you used for comparison.
cogman
30th July 2008, 00:35
Hey all, I was reading through the FFT3dFilter source (specifically FFT3dFilter.cpp) and noticed several places that can be improved by a little math.
For example. I saw a couple of places that look something like something = (((j - i - bh) * 2.0f)/bw)*(((j - i - bh) * 2.0f)/bw);
that could easily be converted to
something = ((j - i - bh) * (j - i - bh) * 4.0f) / (bw * bw);
taking out one division and one multiplication (should be SOME gain when something like this is done in a for loop.)
This could possibly be further speed up by making another variable, j_minus_i_minus_bh = j - i - bh and using that in the calculation for the square.
There are SEVERAL places like this and a lot of them in loops. Do you think it would be worth my time (or yours :P) to go through and simplify math problems like this?
heck, in places where the purpose is the square the results (like the above given) you probably would see an increase if you did
something = ((j - i - bh) * 2.0f)/bw);
something = something*something;
because that would only do the complex math problem once and use the answer to get the rest of the problem.
Your thoughts?
Gavino
30th July 2008, 09:57
heck, in places where the purpose is the square the results (like the above given) you probably would see an increase if you did
something = ((j - i - bh) * 2.0f)/bw);
something = something*something;
because that would only do the complex math problem once and use the answer to get the rest of the problem.
A good optimising compiler ought to be able to do this automatically (repeated sub-expression removal).
OTOH it can also make the code easier to read/maintain if the programmer does it explicitly, although if taken to extremes it can actually make the code harder to follow.
Adub
30th July 2008, 17:00
I vote do it. It's all in the name of speed!! But of course, Fizick will have the final say.
Fizick
30th July 2008, 20:03
i do not consider myself as a programmer guru. But IMHO, other parts of code take the most time.
Monamona
15th August 2008, 13:47
The latest fftw3.dll changed its name to libfftw3x-3.dll.
I appreciate it if you modify FFT3DFilter compatible with it without rename.
Adub
15th August 2008, 16:44
Why? You don't need the new dll, and supposedly the old one is faster.
fjhdavid
9th September 2008, 21:19
a message for Soulhunter:
Soulhunter, I don't know if it requires a lot of work, but in your denoiser comparaison, could you give me, if you can, the value (in dB) of:
Serenity Trailer [2000 Frames]
fft3dfilter(sigma=1.75,bw=32,bh=32,oh=16,ow=16)
I would really appreciate
thanks anyway for all the answers you gave me already
Francois
fjhdavid
11th September 2008, 14:32
does anybody notice some visible ringing or haloing beyond a sharpen definite value?
what was this "maximum" sharpen value in your tests?
thanks
Francois
thetoof
11th September 2008, 14:37
Like always, it depends a lot on your source. I prefer using an external sharpener than the one of fft3d... Limitedsharpenfaster() helps a LOT reducing the artifacts you're talking about.
fjhdavid
13th September 2008, 10:15
honestly, LSF (Smode=3) and fft3Dfilter sharpen look really the same for static images (I use stackhorizontal with DVD-RB and took pictures).
It seems that fft3Dfilter sharpen=0.75 is equivalent to strenth=110 for LSF, but both seems to use "limitedsharpen" feature.
Fizick (if you have time) could you explain me how frequency filter can introduce limitedsharpen?
the only difference which could occur is that fft3d sharpen is only 2D and LSF + Soothe is 3D as Soothe reduce the sharpen strength for motion part of the film.
Fizick
13th September 2008, 10:54
sharpening is increasing of high frequencies.
limited sharpening is limited increasing of high frequencies.
limited sharpening is coarcely simulated in limitedsharpen script in spatial domain with operations with neighbors of points ;)
fjhdavid
13th September 2008, 11:19
thank you!
does it mean, finally, that fft3dfilter is doing exactly the same job as LSF, except that fft3dfilter works in frequencies domain when LSF work in spatial domain?
and Soothe can be used with fft3dfilter in fact, in order to add a temporal dimension to sharpening?
and you say that:
"Since v.1.7, Gaussian High Pass Filter with variable cutoff frequency is used for sharpening"
does it replace the v1.1 sharpening method you mention in your documentation, or is it an additional filter?
Fizick
13th September 2008, 11:57
1. not exactly the same. I do not study LS, but results are differ.
And it is possible to create a lot various implementations of LS.
2. I amm not sure what is "Soothe" method, but probably it si possible to use temporal information for sharpening, but IMO it is sort of terminology (sharpening versus denoising versus superresolution, etc).
3. as i remember, it replaces old method (implementation), but old (since v.1.1) description is correct.
fjhdavid
13th September 2008, 12:16
Fizick, just for info about this Soothe "postprocessor" plugin from Didee:
"Soothe() does a very simple job: get the difference between [source] and [sharpened source], apply a TemporalSoften on this difference BUT allow only changes towards 128 ("neutral"), and then apply this temporally calmed difference back to the original clip. Effectively, this will reduce the overall effect of sharpening - less in static areas, and more in moving areas."
do you think It could be helpful as a fft3dfilter postprocessor?
ps: I think your frequency domain approach is really the most stable approach as results are constant and almost predictive and linear regarding each parameters (and in fact almost only 2 (end user) parameters sigma and sharpen)!
egrimisu
14th September 2008, 10:13
DUMB QUESTION: what will happen if i set the ow=16, oh=16 to ow=8, oh=8 will it increase the overall quality?
LaTo
14th September 2008, 13:05
DUMB QUESTION: what will happen if i set the ow=16, oh=16 to ow=8, oh=8 will it increase the overall quality?
It will decrease overall quality (if you don't touch at bh/bw)
MADAJ
14th September 2008, 16:32
hi, a very basic error.
I am missing something in my plugin folder.
here is the error
http://img67.imageshack.us/img67/1870/99507685ma9.jpg
i have loaded fftw3.dll, FFT3DFilter.dll, and libfftw3-3.dll in my AVS plugin dictionary.
but still I get this error.
=====
and what I am aiming for is to get rid of the blue area over the brown guy in this picture.
http://img67.imageshack.us/img67/9370/59062104wf4.png
any suggestions?
XhmikosR
14th September 2008, 16:36
You don't have to load these dll in your avs script (only FFT3DFilter.dll but if it's in avisynth plugins folder you don't have to, it's loaded automatically). You have to place fftw3.dll in your system32 folder.
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!
egrimisu
14th September 2008, 16:43
what if i set them to 8 aswell?
It will decrease overall quality (if you don't touch at bh/bw)
LaTo
14th September 2008, 17:12
what if i set them to 8 aswell?
Max quality is overlap = blocksize/2. (32-16 & 16-8 are good value)
Monamona
14th October 2008, 13:38
Under YUY2, it seems that FFT3DFilter 2.11 with plane=4
makes Red color deeper.
Please See below.
Correct Image:
http://blog-imgs-41.fc2.com/f/e/l/felmina/ss000000117.jpg
Deeper Red:
http://blog-imgs-41.fc2.com/f/e/l/felmina/ss000000116.jpg
Fizick
14th October 2008, 15:56
:script:
(simplest to show effect)
EDIT: I see the script :)
FFT3DFilter(plane=4, bt=3, bw=3, bh=2, ow=1, oh=1, svr=0)
Well, it is really small block size. Never checked this.
Fizick
14th October 2008, 18:51
I can not confim chroma dif in my tests.
Try to add coloryuv(analyze=true) in some places to search the reason.
and use as simple test script as possible!
Monamona
15th October 2008, 07:53
Thank you for your fast reply.
I simply got this info from some website.
I will re-check and collect more samples.
saemonz
3rd November 2008, 01:53
I can't find download address?Where is it
cwk
3rd November 2008, 04:28
I can't find download address?Where is it
http://avisynth.org.ru/fft3dfilter/fft3dfilter.html
LigH
19th November 2008, 20:44
Is it just my darn satellite connection here, or is the FFTW FTP server down? Can anyone else get a Win32 version of the FFTW3.dll for me?
http://avisynth.org.ru/fft3dfilter/fft3dfilter.html => ftp://ftp.fftw.org/pub/fftw/fftw3win32mingw.zip => Timeout
http://www.fftw.org/install/windows.html => ftp://ftp.fftw.org/pub/fftw/fftw-3.2-dll.zip => Timeout
Boulder
19th November 2008, 21:10
The FTP server seems a bit slow, but here's the file you asked for:
http://www.megaupload.com/?d=LCVJ593H
LigH
20th November 2008, 06:52
Thank you. Hooray for mirrors!
__
Meh. I found the reason... My preferred browser uses a proxy (website development environment, proxy usage circumvents the "hosts" file which declares localhost to be the domain I develop the website for, so I can compare test and public server easily). This proxy could not load from this FTP server.
Fizick
20th November 2008, 17:21
fftw library mirror is also at ... Warpenterprises ;)
LigH
21st November 2008, 08:25
Oh, great... Should have expected that somehow... :o
telmoMRC
9th January 2009, 13:27
i try to instal the fft3dfilter filter and doesn´t work i do like this
i send fftw3.dll to \WINDOWS\system32\ folder
LoadPlugin("C:\Program Files (x86)\GordianKnot\AviSynthPlugins\fft3dfilter211\FFT3DFilter.dll")
FFT3DFilter(sigma=2.5,bt=4,plane=3)
http://e.imagehost.org/0722/33333333.jpg
it give this error also i am using the windows xp x 64 i don´t know if have something to do whit this
kemuri-_9
9th January 2009, 16:56
for x64 systems you put fftw3.dll in the SysWOW64 folder instead of system32
telmoMRC
9th January 2009, 17:12
many thx it works
fjhdavid
21st February 2009, 11:26
I use FFT3Dfilter for a long time and it is a wonderful filter.
I know that, as said in the documentation: "The good value of overlapping size is about quarter to half of block size. The half (ow=bw/2, oh=bh/2) is the best, but slower.
Good values of block size are about 32 to 64"
I understand completely the "best overlaping ratio of ow=bw/2, oh=bh/2",
- but what is the impact of the block size?
- Is there, according to the theory, a "best block size"? (even if computing time would be very long), (for example the whole frame? or the bigger block size you can afford....)
thanks
Francois
Boulder
21st February 2009, 13:01
I think that a smaller block makes edge detection more accurate. At least I recall that there was this idea in which the areas with edges would be detected and a smaller blocksize would be used for that area in the frame.
archaeo
21st February 2009, 16:52
I was curious about this, so I ran a comparison:
MT("fft3dfilter(sigma=2.0,sharpen=.9,bw=8,bh=8,bt=5,ow=4,oh=4,ncpu=2)")
MT("fft3dfilter(sigma=2.0,sharpen=.9,bw=64,bh=64,bt=5,ow=32,oh=32,ncpu=2)")
From what I observed, the computing time between a smaller block size (bw=8, bh=8; ow=4,oh=4) didn't differ much from that of the larger size (bw=64, bh=64; ow=32,oh=32). It was just a few fps faster.
But visually, when I ran the two using Jeremy Duncan's ntsc test disc, I could see that the edges looked better, cleaner on the 8x8 block size. There was some ghosting/haloing on the 64x64 size. I think going with a smaller block does help in that regard.
LordIntruder
22nd February 2009, 02:58
Very interesting archaeo, will make some encodes to see.
By the way, I was wondering about "plane" function.
**
plane - processed color plane: 0 - luma(Y), 1 - chroma U, 2 - chroma V, 3 - chroma planes U and V, 4 - both luma and chroma (default = 0)
**
What is best from your experiences? Plane=4 allow a better compressibility (around 5% no more or less) so I should be tempted to always put this plane function on "4" instead that the default "0" but maybe there are some inconvenients I'm not aware of.
Fizick
22nd February 2009, 09:36
Theoretically, for very small block sizes, this filter is reduced from frequency to ordinary simple point local filter.
Some small features (lines) will not consdered as a lines, but as set of independent pixels.
Practically, you always can make your own tests.
fjhdavid
22nd February 2009, 21:52
Thanks for the answers!
First of all, I didn't use sharpen for my test an I took a sigma of 3 for U and V plane and 1.5 for Y
In fact I did some re-encoding with dvd-RB, and edit frames with photoshop. I can see differences between block size going from 16x16 to 64x64. You have to take uniform grey 60% pattern from DVE for example and you will notice, when magnify under photoshop, that blocksize 64x64 leaves artefact block, as blocksize 16x16 clean completely the frame, (blocksize 32x32 is halfway and going under blocksize 16x16 seems not necessary). You can check same results with 20%, 40%, 80% gray patterns and color patterns.
But I made another discovery (that maybe you know already), if you do a bicubic vertical resizing (4/3 ratio to 16/9 for example), it is FAR better to denoise AFTER the resizing than BEFORE (this is not the case with other denoiser than fft3dfilter where it is commonly said that you better denoise before resizing?)
The result after denoising with fft3dfilter is more crisp (sharp) and the deblocking is also better.
Do you have any idea about the reasons?
Thanks
Francois
fjhdavid
1st March 2009, 23:50
Dear All,
With some film (recorded with my dvd recorder) during fast horizontal motion (horizontal panoramic), I can see a green halo at the back of the object which is moving, especially when the object is black and move in front of a white background.
Why the halo is green and not black? and which parameters of fft3dfilter does I have to tweak?
increase sigma? play with bt?
(I use sigma=3 for U,V and sigma=1.5 for Y and bt=3)
thanks
Fizick
2nd March 2009, 07:17
fjhdavid,
What colorspace? YV12?
Provide short sample video (may be artifical computer graphics) and resulted bad frame.
(and script, versions, config)
komisar
2nd March 2009, 09:27
Fizick, how about port you filter for x64-avisynth?
Fizick
2nd March 2009, 20:52
komisar,
Porting fft3dfilter is possible (but not by me): there is 64bit fftw library at http://fftw.org/install/windows.html
There is no official 64bit Avisynth.
fjhdavid
2nd March 2009, 21:26
Fizick,
I use YV12 colorspace.
I was searching on internet and I found my problem:
http://www.geocities.com/mrtibsvideo/fixvhsoversharp.html
But this filter is quite old and working only with YUV (I tested this plugin but it adds many noise , like dancing pixels)
My question is: does fft3dfilter can "fight against" this problem and how?
do you know another way to solve the problem?
Thanks
Fizick
2nd March 2009, 22:12
fjhdavid,
1. So, there is no any problem with fft3dfilter itself?
2. dehalo?
fjhdavid
2nd March 2009, 23:12
no problem with fft3dfilter by itself (as usual)
Fizick, with the "ghost example I show you",
1- which value of dehalo would you recommand to start with?
2-does dehalo must be use with luma, chroma or both?
thanks
komisar
3rd March 2009, 09:41
komisar,
Porting fft3dfilter is possible (but not by me): there is 64bit fftw library at http://fftw.org/install/windows.html
There is no official 64bit Avisynth.
Yes, no official x64 AVISynth but squid (http://members.optusnet.com.au/squid_80/) port some staff... If you could give him the source of the plugin....
Fizick
3rd March 2009, 19:44
fjhdavid,
sorry, i do not remember any "ghost example I show you" (?), and I have no recommendations about parameters.
There was some dehalo scripts in this forum.
komisar,
I know about squid and his port of some of my (and not my) filters.
But seems, you do not know, that fft3dfilter is under GNU GPL, and what is "GNU GPL" :)
(and BTW, probably you forgot to upload source code of your x264vfw binary releases to sourceforge SVN tree... ;)
komisar
3rd March 2009, 21:42
Fizick, ;)
(and BTW, probably you forgot to upload source code of your x264vfw binary releases to sourceforge SVN tree...
my builds always available via my used patches... (found on my site... and I use some sources from svn tree plus public patches) ;-)
P.S. What do you need to port fft3dfilter for x64 avisynth?
Fizick
3rd March 2009, 23:05
komisar,
1. I do not see GNU GPL license copy distributed with your x264vfw package, and no any notice about GPL and copyright in installer or some "about" dialog (or readme file).
Please, how I can get FULL source code of the package? In particular, for latest Release: 16_1115bm_17572.exe.
What exactly modules and patches are used? Is version at: http://x264vfw.svn.sourceforge.net/viewvc/x264vfw/trunk/ latest (used in recent release)?
Sorry for off-topic.
2. As I write above, currenly i have no plan to port any filters to x64.
I will need in 64bit hardware, software, desire, skill and time :(
So, this job vacancy is open :)
komisar
4th March 2009, 00:05
Fizick, sorry for off-topic, but can you install my builds of vfw x264? can you see about-box?Please, how I can get FULL source code of the package? In particular, for latest Release: 16_1115bm_17572.exe.
What exactly modules and patches are used? Is version at: http://x264vfw.svn.sourceforge.net/v...x264vfw/trunk/ latest (used in recent release)?full source codesvn co http://x264vfw.svn.sourceforge.net/viewvc/x264vfw/trunk/and patches in my site (http://komisar.gin.by/x.patch/)...
main build in sourceforge built by BugMaster (he also make builds with addition patches). 16_1115bm_17572.exe -- build not by my hand... for lattest reorganisation of my build environment I temporary not link for patches on main page (but x.patch available always)...
Very sorry for big off-topic (for question -- PM)
where sources of fft3dfilter? (here (http://avisynth.org.ru/fft3dfilter/fft3dfilter.html) or here (http://avisynth.org.ru/fft3dfilter/fft3dfilter-rus.html)?) i see License, and....?
Fizick
4th March 2009, 05:49
komisar,
1. Thanks, I found the about box (prevously I look to config) :) Sorry!
Next question will be in PM. :)
2. The source of fft3dfilter should be in the same archive with binary dll: fft3dfilter211.zip,
the link is at the bottom of doc html page you post.
It is the FULL source code to produce DLL.
:)
fjhdavid
8th March 2009, 19:24
Dear Fizick and all,
I recorded DVDs from my satellite tuner and the pictures is really good. I did a re-encoding with fft3Dfilter and fft3Dgpu, with sigma=1.5 for Y and sigma=3 for U,V; bt=3,oh=ow=16,bw=bh=32.
I have a problem:
During fast motion (and not so fast in fact), for example someone going from the left to the right of the screen, I have a green halo in front of the object which is moving, and the halo "follow" the shape of the object and the motion.
It is difficult to have a picture with the green halo because it is only during motion and the halo doesn't appear during "image by image" speed reading.
The halo is about 5 to 10 pixel width maybe
Did you have already this problem?
thanks
Francois
edit: I tested the recorded DVD on different standalone player and plasma screen, and the halo is here everytime (so the problem comes from the recorded DVD, as commercial DVD doesen't exhibit this halo).
edit2:could it be a problem with de-interlacing? (The movie recorded are PAL 2:2 film, progressive but interlaced encoded by the DVD recorder)
Boulder
8th March 2009, 19:56
How about a short sample?
fjhdavid
9th March 2009, 00:36
ok I understand!
here is the link for my file:
http://www.megafileupload.com/en/fil...-01-1-VOB.html
the problem is, if you read it with powerdvd or DGindex, you won't see the green halo (at least I don't see it)
You have to write it on a DVD-R or RW and read it on a standalone DVD player.
Thanks
Boulder
9th March 2009, 04:27
The link doesn't seem to work..
Fizick
9th March 2009, 07:36
fjhdavid,
1. link is realy broken.
2. are you sure that it is related to fft3dfilter topic?
I see your special thread here: http://forum.doom9.org/showthread.php?t=145513
Remember forum rule 8):
http://forum.doom9.org/forum-rules.htm
fjhdavid
9th March 2009, 17:10
Yep, the link is broken, it was working yesterday.
Apolozise for the rule 8.
In fact I use fft3dfilter and was wondering if the halo green could be fft3d related, but it is not the case.
I will reload my clip and close my question on this forum.
jarthel
28th April 2009, 12:54
any suggestion for anime sources? maybe a starting point that I can play around with?
thank you :)
jarthel
29th April 2009, 01:35
I'm trying to open a test .avs file using fft3dfilter.dll as one of the filters in VDub. FFT3Dfilter plugin cannot find the fft3w.dll.
I am running a "limited user account" (for security purposes) for daily use. I have installed avisynth 2.5.6 as admin. I coped fft3w.dll to c:\windows\system32 as admin. So I thought everything should be working fine.
Any thoughts? Is there a version of fft3dfilter.dll that as fft3w.dll statically linked into it?
Thank you for the help :)
Fizick
29th April 2009, 12:18
jarthel
what is user rights access to fft3w.dll?
there is no statically linked version.
jarthel
29th April 2009, 12:59
jarthel
what is user rights access to fft3w.dll?
there is no statically linked version.
according to file properties (security tab), users have read&execute and read.
Do I need more?
thank you! :)
Fizick
1st May 2009, 10:52
jarthel,
I checked with limited user account at WinXP Home edtion 32 bit.
FFT3DFilter works fine with read&execute and read right to fftw3.dll and avisynth.dll.
Check your system (path, etc)
fjhdavid
8th May 2009, 14:40
Dear Fizick,
I made many test with different sharpen value and films. My film are DVD 4:3 to 16:9 converted, so I have to do a crop and resize before.
And Finally the best compromise seems to be sharpen=0.4; then I read carefully your fft3dfilter guide and "some of your best settings" example use sharpen=0.4
My question is: Does the 0.4 value handle specific things in the math you use? (like exact rounding or do the frequencies change before or after sharpen=0.4 in a specific important amount, or anything else?)
In fact, above 0.4 (even at sharpen=0.6) halos start to appear and the images look a little bit "plastic and 3D".
Thanks for your answer
Francois
Sagekilla
8th May 2009, 15:44
It's probably just how FFT3DFilter was tuned. If he set up the scaling differently, he could have 1.0 as the ideal sharpening. Mathematically speaking, it could be something like 5000 for no haloing and realistic images still.
fjhdavid
8th May 2009, 17:37
yes, I understand that the 0.4 value is not, by itself, important, but I just wanted to know if Fizick has done a sharpen filter with a "peak efficency" around 0.4 which could be understood as "a very very good" compromise?
Fizick
10th May 2009, 20:36
I do not know :)
adrianmak
12th June 2009, 00:44
is x64 version available ?
aerDNA
26th June 2009, 11:54
Hi, I use FFT3Dfilter and find it to be the best denoiser there is. Not very suitable for someone running a mini xvid factory, but I only encode occasionaly, so quality comes first and speed is not essential. Hats off to Fizick!
My question: since the last release was quite a while ago, is it fully compatible with the latest FFTW (3.2.1)? I tried the combination and it seems fine, as far as I can tell, I even get a slightly higher fps (on P4; the difference will probably be even bigger on multicore). [Edit: compared to FFTW version available at the time FFT3D 2.1.1 was released]
Adub
26th June 2009, 17:35
Well if it works fine then obviously it is compatible. Don't question good things!
aerDNA
26th June 2009, 23:22
To be precise, I asked if it was fully compatible. I did no extensive testing, only tried it on a single clip. All I know is that the filter doesn't crash and that the output seems ok, but you know how it is, with certain sources in combination with certain filter settings there could possibly be trouble. Fizick knows his code and he probably keeps track of fftw code as well so he'll know if undesired effects are to be expected. I was asking simply because from what I saw in the changelog, fftw libraries were upgraded quite a bit since the last FFT3D version.
kemuri-_9
27th June 2009, 00:30
it should be ok as long as there has been no API changes in the fftw library from the provided version with fft3d, to the current.
which according to the site for fftw holds true as the major version denotes the API compatibility...
so as long as it's a 3.x version, it'll be compatible
mavinashbabu
24th September 2009, 17:42
I am just using default values for FFT3DFilter, but i am getting the error as in the below screenshot.. any help please
http://www.grinshare.com/img/0GJ43F_tn.jpg (http://www.grinshare.com/view-0GJ43F.jpg)
DGDecode_mpeg2source("J:\New2000-1\Mughal-E-Azam Color DVD9 to DVD5\VTS_02_1.d2v", cpu=2, info=3)
ColorMatrix(hints=true, interlaced=true, threads=0)
tfm(order=1).tdecimate()
crop( 0, 22, 0, -30)
Lanczos4Resize(656,432) # Lanczos4 (Sharp)
FluxSmoothST(7,7) # Medium Noise
FFT3DFilter(sigma=2.0, beta=1.0, plane=0, bw=48, bh=48, bt=3, ow=bw/3, oh=bh/3, kratio=2.0, sharpen=0.0, scutoff=0.3, svr=1.0, smin=4.0, smax=20.0, measure=true, interlaced=false, wintype=0, pframe=0, px=0, py=0, pshow=false, pcutoff=0.1, pfactor=0, sigma2=sigma, sigma3=sigma, sigma4=sigma, degrid=1.00, dehalo=0, hr=2.00, ht=50.00, ncpu=1)
nurbs
24th September 2009, 17:54
No idea why it happens, but the default value is 48 anyway so you can just omit it.
mavinashbabu
24th September 2009, 18:27
^^ but the same happens for "bh", "sigma" as well, but it works just fine when i use FFT3DFILTER()
talen9
24th September 2009, 18:30
FFT3DFilter(sigma=2.0, beta=1.0, plane=0, bw=48, bh=48, bt=3, ow=bw/3, oh=bh/3, kratio=2.0, sharpen=0.0, scutoff=0.3, svr=1.0, smin=4.0, smax=20.0, measure=true, interlaced=false, wintype=0, pframe=0, px=0, py=0, pshow=false, pcutoff=0.1, pfactor=0, sigma2=sigma, sigma3=sigma, sigma4=sigma, degrid=1.00, dehalo=0, hr=2.00, ht=50.00, ncpu=1)
You obviously have to define "bw" and "bh" ;)
You'll see it'll give you errors in the definitions of sigma[2,3,4] for exactly the same reason :)
mavinashbabu
24th September 2009, 19:17
^^.. it's a bouncer to me for understand as i can see values for "bw" and "bh" are 48 and "sigma" value is at 2.0... can you give me an example if you time please
Edit: Now this seems to work though
FFT3DFilter(sigma=2.0,bw=32,bh=32)
It should also work when i say FFT3DFilter() with all the parameters "defined" within the function :confused:
Gavino
24th September 2009, 19:54
When you write FFT3DFilter(bw=48, ow=bw/3), the second 'bw' has nothing to do with the first one, and can only be interpreted as a variable which must be already defined in the script. If you want to link them together in this way, you would have to do something like:
bw = 48 # assign to a variable
FFT3DFilter(..., bw=bw, ow=bw/3, ...)
anubhavrocker
26th January 2010, 08:31
This is my first encode using fft3dfilter :) So kindly throw in some suggestions and which one seems good to you (source is a .mpg tv capture).
Script1:
LoadPlugin("F:\Encoding\megui\tools\avisynth_plugin\FFT3DFilter.dll")
Import("H:\Recorded TV\Rips\viru.avs")
crop( 16, 74, -14, -90)
LanczosResize(704,416) # Lanczos (Sharp)
fft3dfilter(sigma=1.5, bt=5, bw=32, bh=32, ow=16, oh=16, sharpen=0.4)
http://i46.tinypic.com/2ebadte.png
Script2:
LoadPlugin("F:\Encoding\megui\tools\avisynth_plugin\FFT3DFilter.dll")
Import("H:\Recorded TV\Rips\viru.avs")
crop( 16, 74, -14, -90)
LanczosResize(704,416) # Lanczos (Sharp)
fft3dfilter(sigma=1.5, bt=5, bw=32, bh=32, ow=16, oh=16, ncpu=2)
http://i47.tinypic.com/sobe5v.png
Is there anything else that must be taken care of in the video ?
manono
26th January 2010, 10:23
Is there anything else that must be taken care of in the video ?
The logo. Also, with a 1.69:1 ratio the resolution is a bit strange, but maybe that's how they really broadcast it.
anubhavrocker
26th January 2010, 15:20
The logo. Also, with a 1.69:1 ratio the resolution is a bit strange, but maybe that's how they really broadcast it.
All the channels here are actually broadcasted in 4:3 resolution so i cropped all the black borders and maximum logo to keep the main video intact.
I will test more with it and then will update here.
I am new to this encoding and i am very much open to suggestions for making my encodes better :)
Thanks
StainlessS
30th January 2010, 01:27
Issued July 14 2009 FFTW library v3.2.2 stable
http://www.fftw.org/download.html
Earlier post mentioned 3.2.1 as latest.
drob
24th February 2010, 19:02
With those FFTW new build v3.2.2 files, there are many files inside the archive, which ones do i ned? and what exactly to do with them? none of them are named as the older fftw3.dll.
Using one of the dll files and renaming them to fftw3.dll, i get an access violation (using via StaxRip, using the original file gives no problems.
komisar
24th February 2010, 20:29
drob, from "32-bit version: fftw-3.2.2.pl1-dll32.zip" you need libfftw3f-3.dll... rename it to fftw3.dll and place to %PATH%...
drob
25th February 2010, 02:09
@komisar thank you, works perfectly now.
netrex
9th July 2010, 15:36
I've used this before with great success, but now I can't get it working.
I have the fftw3.dll in my system32 folder and I got FFT3DFilter.dll in the Avisynth plugins folder. But when I load my .avs file in VD, it get the message that the fftw3dll could not be loaded.
Avisynth open failure:
FFT3DFilter: Can not load FFTW3.DLL !
(A:\Video\IMGP8058.avs, line 3)
This is the script I'm using, it's the first I've tried now just to see if it worked:DirectShowSource("A:\Video\IMGP8058.avi")
ConvertToYV12
fft3dfilter(sigma=1.5, bt=5, bw=32, bh=32, ow=16, oh=16, sharpen=0.4)
I'm running Windows 7 64 bit. Not sure if it matters that I run 64 bit.
Edit: Just to add some more info.
I used the fftw3.dll from this file fftw3win32mingw.zip, that didn't work, then I tried the three .dll files from the file fftw-3.2.2-dll64.zip one at a time renaming them to fftw3.dll, and that didn't work either.
komisar
9th July 2010, 15:52
netrex, you need to place 32-bit fftw3.dll in %SystemRoot%\SysWOW64 path on 64-bit windows...
64-bit fftw3.dll place in %SystemRoot%\System32 (for 64-bit avisynth and 64-bit FFT3DFilter.dll)
netrex
9th July 2010, 16:05
netrex, you need to place 32-bit fftw3.dll in %SystemRoot%\SysWOW64 path on 64-bit windows...
64-bit fftw3.dll place in %SystemRoot%\System32 (for 64-bit avisynth and 64-bit FFT3DFilter.dll)
Thank you for the quick reply.
I put the fftw3.dll from fftw3win32mingw in the folder SysWOW64 and now it works.
Is there a big benefit to go with the 64 bit software instead, since I'm already running a 64 bit OS?
komisar
9th July 2010, 16:08
netrex, benefit with big memory use and some speedup, but 64-bit avisynth still not so stable :(
netrex
9th July 2010, 16:25
komisar, ok, I see. I'll just stick to the version I'm using now then. Thanks for the help!
redfordxx
9th September 2011, 02:37
Hi, after long time I came back to video processing. I did successfully use fft3dfilter some before but now I seem to have problem.
I changed computer and now I have Win7 64bit.
I am using MeGui64, x264_64 and Avisynth64.
So I downloaded
FFT3DFilter 3 12 2010.rar from http://www.mediafire.com/?2ymcyfuzzzw
ftp://ftp.fftw.org/pub/fftw/fftw-3.3-dll64.zip
When I loaded my script to MeGui preview, I received this "Can not load FFTW3.DLL" message.
I have renamed libfftw3d-3.dll to fftw3.dll, put it into System32 and SysWOW64 and it still doesnot work. Any ideas? Thanks.
redfordxx
10th September 2011, 21:16
Ayayay....shoudn't rename it...
now it works
DarkT
28th September 2011, 23:34
What is the benefit of using the newer libfftw3f-3.dll over the older one?
LigH
29th September 2011, 08:25
Just a guess: That it works in 64-bit mode at all?
DarkT
29th September 2011, 09:07
I have windows 7 64 bits. I am using avisynth 2.6 in MT mode. not 64 bits 2.5.8 ver. in MT mode I gained 300% speed. so, I'll keep using the MT rather than 64bits...
mastrboy
25th January 2012, 22:48
Good read related to FFT: http://web.mit.edu/newsoffice/2012/faster-fourier-transforms-0118.html
dadix
23rd June 2012, 16:39
I like this script but:
1) i want only temporal filter not spatial . bt=0 canceled spatial fileter or not ?
2) please tell one example of this script to use with option "noise pattern". How to do that ?
AzraelNewtype
24th June 2012, 00:58
I like this script but:
1) i want only temporal filter not spatial . bt=0 canceled spatial fileter or not ?
bt=0 makes the filter purely spatial, the exact opposite of what you're asking for. I'm fairly certain you can't make it purely temporal, but I could be wrong. There are certainly any number of temporal smoothers if you absolutely do not want spatial smoothing.
librarian
24th June 2012, 02:26
This sample script should give a (approximately) Wiener only temporal filter:
avisource("")
clp=last
fq=fft3dfilter(sigma=6,bt=1,plane=0)#Use current frame data only
ft= fft3dfilter(sigma=6,bt=5,plane=0)#bt= 2...5
difffq=mt_makediff(clp,fq,y=3,u=2,v=2)#only luma is filtered then u=v=2
tmp=mt_adddiff(ft,difffq,y=3,u=2,v=2)#but this remove the filtering on current frame too
return tmp
bt=0 is the "Temporal Kalman filter for spectrum data" (see the doc).
dadix
24th June 2012, 11:27
thank you
@Fizick
for noise pattern can be implemented to have a option to add a frequency range and multiple areas of frequency range?
Jenyok
20th March 2013, 07:19
There are some questions to you.
.
There is a function RemoveGrain(mode=17) .
.
Could I use function FFT3dFilter(...) instead of function RemoveGrain(mode=17) to achive equal result of function RemoveGrain(mode=17) (result FF3dFilter(...) = result RemoveGrain(mode=17)) ?
Which parameters and values of those parameters could I use in function FFT3dFilter(...) to achive this result ?
.
.
There are another similar questions.
.
There is a function RemoveGrain(mode=1) .
There is a function RemoveGrain(mode=2) .
There is a function RemoveGrain(mode=3) .
There is a function RemoveGrain(mode=5) .
.
result FF3dFilter( ??? ) = result RemoveGrain(mode=1) ?
Parameters and values of those parameters to function FFT3dFiler() in this case ?
.
result FF3dFilter( ??? ) = result RemoveGrain(mode=2) ?
Parameters and values of those parameters to function FFT3dFiler() in this case ?
.
result FF3dFilter( ??? ) = result RemoveGrain(mode=3) ?
Parameters and values of those parameters to function FFT3dFiler() in this case ?
.
result FF3dFilter( ??? ) = result RemoveGrain(mode=5) ?
Parameters and values of those parameters to function FFT3dFiler() in this case ?
.
FFT3dFilter( ??? ) similar to and another "mode=" of RemoveGrain() function ?
mode=7
mode=9
mode=11
mode=19
.
Thanks.
.
Jenyok
28th March 2013, 13:14
And there is a silence. ??? !!! :readguid:
.
Didee, Gavino, Fizick
.
Where are you, mates ?
.
aerDNA
21st January 2017, 20:58
Sorry for necrobumping like this but plugin documentation points to this thread and I wanted to share some insight that might be helpful to new users (if there are any) in setting it up.
This is an excellent denoiser and my no. 1 choice for a long time now. It used to be painfully slow if you wanted to squeeze the most out of it but on today's powerful CPUs it performs ok. I mainly wanted to comment on default/recommended values vs what I use.
- Documentation suggests sigma=1.5-2.5 for digital sources and 3 or more for analog. If detail retention is a priority, my recommendation is not to go above 2, unless you're encoding at low bitrate in which case fine detail is gone anyhow and stronger denoising will help compressibility. I normally use 1.5; it removes a substantial amount of noise without compromising on quality.
- Chroma planes tolerate much stronger denoising than luma so it's a good idea to process them separately. sigma=1.5, plane=0 (luma) + sigma=3, plane=3 (chroma) will be visually indistinguishable from sigma=1.5, plane=4 (all) but it will compress better. If you're afraid it doubles the time required because you need to apply FFT3DFilter twice, don't worry, it takes the same.
- Suggested optimal block size/overlap is bw,bh=32, ow,oh=16. This was written years ago with tolerable speed in mind, I presume. With a modern CPU, use bw,bh=16, ow,oh=8. It produces superior results.
- For 3D Wiener, bt=5 is suggested as best. This is actually the main thing that made me write this post, because I've always been using bt=5 and only today did I do some proper experimenting with this value. After quite a bit of testing, one thing I can objectively say is that bt=5, compared to default bt=3, consistently produces frames that are slightly less compressible. This means it washes out less data, but what is the nature of it in terms of noise/detail? Visual inspection of frames revealed no difference in most cases, and where there was a visible difference, quality seemed to be on the side of bt=3, surprisingly. So my conlusion is that bt=5 actually has slightly worse noise/detail removal ratio. Even if I'm wrong on this, perceptible difference really is insignificant, and considering that bt=5 comes with a pretty massive speed penalty, I say stick with the default.
- On multicore, be sure to set the ncpu= param, you'll get a decent speed boost.
tl;dr - my "best" settings:
FFT3DFilter(sigma=1.5, plane=0, bw=16, bh=16, ow=8, oh=8, ncpu=x)
FFT3DFilter(sigma=3, plane=3, bw=16, bh=16, ow=8, oh=8, ncpu=x)
Finally, use the ICL build (https://www.dropbox.com/sh/6kb3723po5oqd4b/AADbP8gIJ3YrHVoLU3joqJDma?dl=0) by Groucho2004 - it's faster and there's also a 64-bit build for AviSynth+. To use both versions on Win64 (I use 32-bit for scripting/preview in VirtualDub and 64-bit for final encoding) you also need both libfftw3f-3.dll versions from fftw.org. Renamed to fftw3.dll, 64-bit dll goes to Windows\System32 and 32-bit dll goes to Windows\SysWOW64.
manono
21st January 2017, 22:36
Thank you very much for the tips. I use the filter a lot and always at the 'best settings', usually with Sigma set for 1.5 or 2.0. I'll try out your suggestions the next time I use it.
Groucho2004
21st January 2017, 23:33
To use both versions on Win64 (I use 32-bit for scripting/preview in VirtualDub and 64-bit for final encoding) you also need both libfftw3f-3.dll versions from fftw.org. Renamed to fftw3.dll, 64-bit dll goes to Windows\System32 and 32-bit dll goes to Windows\SysWOW64.
Just a little remark - With the ICL builds I made renaming the fftw DLLs is not necessary, they accept either libfftw3f-3.dll or fftw3.dll.
feisty2
22nd January 2017, 09:59
Sorry for necrobumping like this but plugin documentation points to this thread and I wanted to share some insight that might be helpful to new users (if there are any) in setting it up.
This is an excellent denoiser and my no. 1 choice for a long time now. It used to be painfully slow if you wanted to squeeze the most out of it but on today's powerful CPUs it performs ok. I mainly wanted to comment on default/recommended values vs what I use.
- Documentation suggests sigma=1.5-2.5 for digital sources and 3 or more for analog. If detail retention is a priority, my recommendation is not to go above 2, unless you're encoding at low bitrate in which case fine detail is gone anyhow and stronger denoising will help compressibility. I normally use 1.5; it removes a substantial amount of noise without compromising on quality.
- Chroma planes tolerate much stronger denoising than luma so it's a good idea to process them separately. sigma=1.5, plane=0 (luma) + sigma=3, plane=3 (chroma) will be visually indistinguishable from sigma=1.5, plane=4 (all) but it will compress better. If you're afraid it doubles the time required because you need to apply FFT3DFilter twice, don't worry, it takes the same.
- Suggested optimal block size/overlap is bw,bh=32, ow,oh=16. This was written years ago with tolerable speed in mind, I presume. With a modern CPU, use bw,bh=16, ow,oh=8. It produces superior results.
- For 3D Wiener, bt=5 is suggested as best. This is actually the main thing that made me write this post, because I've always been using bt=5 and only today did I do some proper experimenting with this value. After quite a bit of testing, one thing I can objectively say is that bt=5, compared to default bt=3, consistently produces frames that are slightly less compressible. This means it washes out less data, but what is the nature of it in terms of noise/detail? Visual inspection of frames revealed no difference in most cases, and where there was a visible difference, quality seemed to be on the side of bt=3, surprisingly. So my conlusion is that bt=5 actually has slightly worse noise/detail removal ratio. Even if I'm wrong on this, perceptible difference really is insignificant, and considering that bt=5 comes with a pretty massive speed penalty, I say stick with the default.
- On multicore, be sure to set the ncpu= param, you'll get a decent speed boost.
tl;dr - my "best" settings:
FFT3DFilter(sigma=1.5, plane=0, bw=16, bh=16, ow=8, oh=8, ncpu=x)
FFT3DFilter(sigma=3, plane=3, bw=16, bh=16, ow=8, oh=8, ncpu=x)
Finally, use the ICL build (https://www.dropbox.com/sh/6kb3723po5oqd4b/AADbP8gIJ3YrHVoLU3joqJDma?dl=0) by Groucho2004 - it's faster and there's also a 64-bit build for AviSynth+. To use both versions on Win64 (I use 32-bit for scripting/preview in VirtualDub and 64-bit for final encoding) you also need both libfftw3f-3.dll versions from fftw.org. Renamed to fftw3.dll, 64-bit dll goes to Windows\System32 and 32-bit dll goes to Windows\SysWOW64.
If you do care about quality, fft3d is really just a pretty bad choice, it's 2017 now and there are denoising algorithms out there MUCH more advanced than simple dumb frequency domain filtering (and also DFTTest is better quality wise in this category).
Some better options:
Motion Compensation (MDeGrain)
NLMeans (KNLMeansCL, TNLMeans)
BM3D (available in vaporsynth)
aerDNA
22nd January 2017, 18:48
DFTTest is marginally better but much slower. TNLMeans is better but much, much, much slower. When you enable temporal (it's not nearly as good without it) it goes from unacceptably slow to 48hrs./encode slow. KNLMeansCL should be faster but I'm without a discrete GPU at the moment and apparently it lacks temporal mode. I wanted to give MDeGrain a go but it seems I'd have to do some digging through forum just to piece together the right plugin and dependencies that have different versions and mods of their own. I also don't feel like getting into VaporSynth because there's nothing I really need but don't get from AviSynth(+), which I'm accustomed to, so no BM3D for me. I will test KNLMeansCL and if turns out to be a spectacular performance improvement over TNLMeans while offering same quality, I'll gladly go with that. Right now I don't see anything offering me the kind of quality vs speed balance that FFT3D does.
feisty2
22nd January 2017, 19:08
and apparently it lacks temporal mode.
Apparently the wrong fact.
KNLMeansCL is a 3D NLMeans filter, the "d" parameter is the temporal radius for NLMeans.
manono
22nd January 2017, 19:24
This is the FFT3DFilter thread, feisty2. You can promote your favorite filters somewhere else. Please.
johnmeyer
23rd January 2017, 00:23
Yeah, the FFT3DFilter bashing seems to be totally out of place, not only because this is the main support thread for the plugin, but also because there are still situations where it is quite useful (e.g., as a pre-filter to create an estimation clip).
As for this quote:
I wanted to give MDeGrain a go but it seems I'd have to do some digging through forum just to piece together the right plugin and dependencies that have different versions and mods of their own.
pretty much anything you do in AVISynth is going to require that you have a few plugins in addition to the main one. In this case you need MVTools2, along with whatever else it requires. I'll agree that there are a LOT of mods and branches to the MVTools2 development, but I have a package that works well for me, and if you want I would be happy to zip the various things together, along with a couple of denoising sample scripts. My samples are not too much different than the cookbook examples in the MVTools2 documentation, but I have done a few tweaks for speed and also for better performance for the SD (VHS/Beta/8mm) video that I often am asked to restore.
GMJCZP
23rd January 2017, 00:50
FFT3dfilter is good too for in some cases for repair edges in conjuction with Camembert or TCannyMod.
aerDNA
23rd January 2017, 03:23
@johnmeyer Thanks, if you have a convenient MDeGrain setup package I'll try it out, but to be honest you probably shouldn't bother because somehow I think I'll be sticking with FFT3DFilter for the time being.
I feel I should explain my rationale and why I'm satisfied with FFT3DFilter. If I denoise, I do so to help compressibility and my usual goal is not to remove all noise but only up to the point where perceptible quality trade-off begins (and by quality I specifically mean detail retention). With FFT3DFilter that point is around sigma=1.5 for my eyes. At near-zero impact on quality, good amount of noise is removed and relatively fast. A more advanced filter will remove more noise but at the cost of speed. On the clip I tested on, FFT3DFilter with params stated above is ~4x faster than DFTTest default and ~15x faster than TNLMeans default. Whatever noise I'm left with I'll just pay for in bitrate, so FFT3DFilter will save me some less bitrate than a more efficient filter would, but it still saved a lot and for a much smaller speed penalty. As feisty2 pointed out, it's 2017. I don't have to target 700MB. Storage/bandwidth is not a problem and I'll gladly have a little bigger output if it means reasonable encoding times.
StainlessS
23rd January 2017, 03:57
I have been a big fan of (Spatial) VagueDenoiser, and (S/T) FFT3DFilter for some long time.
FFT3D, usually Sigma between about 1.5 and 1.75 (occasionally a little higher), for what it does, is really pretty fast compared to others.
I also like MCDegrainSharp(frames=1), and sometimes use it before a weak FFT3dFilter (sigma= ~ 1.5), usually if some other processing between
the degraining and output.
MCDegrainSharp requires only mvtools2 so not too difficult to set up:- http://forum.doom9.org/showthread.php?p=1508638#post1508638
EDIT: Also see plain MCDegrain() a few posts before above linked.
feisty2
23rd January 2017, 06:04
@johnmeyer Thanks, if you have a convenient MDeGrain setup package I'll try it out, but to be honest you probably shouldn't bother because somehow I think I'll be sticking with FFT3DFilter for the time being.
I feel I should explain my rationale and why I'm satisfied with FFT3DFilter. If I denoise, I do so to help compressibility and my usual goal is not to remove all noise but only up to the point where perceptible quality trade-off begins (and by quality I specifically mean detail retention). With FFT3DFilter that point is around sigma=1.5 for my eyes. At near-zero impact on quality, good amount of noise is removed and relatively fast. A more advanced filter will remove more noise but at the cost of speed. On the clip I tested on, FFT3DFilter with params stated above is ~4x faster than DFTTest default and ~15x faster than TNLMeans default. Whatever noise I'm left with I'll just pay for in bitrate, so FFT3DFilter will save me some less bitrate than a more efficient filter would, but it still saved a lot and for a much smaller speed penalty. As feisty2 pointed out, it's 2017. I don't have to target 700MB. Storage/bandwidth is not a problem and I'll gladly have a little bigger output if it means reasonable encoding times.
the quality of a denoising algorithm is typically defined as "how good the result looks still after complete removal of the noise" and fft3d is real lame by that definition, I thought you were talking about that definition of quality earlier, anyways, not the point.
I never used fft3d cuz this kind of filters are generally extremely toxic to high frequency components which leads to edge distortion and ringing and crap like that.
with DFTTest you can simply avoid filtering on high frequency components with the "sstring" parameter, not sure if such policy exists in fft3d, if it does not, you can always do it manually.
src = last
fft = fft3dfilter(xxx)
hif = mt_makediff(src, src.removegrain(11).removegrain(11))
fft.removegrain(11).removegrain(11).mt_adddiff(hif)
but also because there are still situations where it is quite useful (e.g., as a pre-filter to create an estimation clip).
apparently he was using it as a main denoiser.
aerDNA
23rd January 2017, 13:38
MCDegrainSharp requires only mvtools2 so not too difficult to set up:- http://forum.doom9.org/showthread.php?p=1508638#post1508638
EDIT: Also see plain MCDegrain() a few posts before above linked.
I'll try it, thanks.
the quality of a denoising algorithm is typically defined as "how good the result looks still after complete removal of the noise." and fft3d is real lame by that definition, I thought you were talking about that definition of quality earlier, anyways, not the point.
That's filter quality, I was talking about resulting image quality with regard to detail. I figured there was a misunderstanding - my fault.
I never used fft3d cuz this kind of filters are generally extremely toxic to high frequency components which leads to edge distortion and ringing and crap like that.
with DFTTest you can simply avoid filtering on high frequency components with the "sstring" parameter, not sure if such policy exists in fft3d
It does, there's sigma, sigma2, sigma3, sigma4.
I may not understand the math behind filters but I'm the world's leading expert in determining what looks good to me. I spent a lot of time switching betwen different filter outputs and staring at frames like a twonk. If your opinion is based on math and/or calendar instead of actual experience with the filter, you really should refrain from telling people it's a bad choice. It's a good denoiser that sits in quality vs performance sweet spot. NLMeans takes a lot more processing for moderate gains and whatever comes next will be even worse, because we're deep in the zone of diminishing returns here.
feisty2
23rd January 2017, 14:29
If your opinion is based on math and/or calendar instead of actual experience with the filter, you really should refrain from telling people it's a bad choice.
don't wanna hijack this thread so please continue here (http://forum.doom9.org/showthread.php?p=1794305#post1794305)
but I'm the world's leading expert in determining what looks good to me. I spent a lot of time switching betwen different filter outputs and staring at frames like a twonk.
and I couldn't agree with you on this, I'm also a quality freak, and 10 times slower is okay to me longs as there's 1% of quality improvement.
aerDNA
23rd January 2017, 14:59
Nah, I'm done here, said what I wanted and plenty more. And frankly I don't like your cocky fanboyish style. Engaging in further discussion wouldn't bring me any kind of satisfaction.
martin53
16th February 2017, 21:21
Just made a new thread for an update of the plugin (http://forum.doom9.org/showthread.php?p=1797567#post1797567), so it doesn't get buried in this long thread :)
orion44
28th November 2023, 18:02
Sorry for necrobumping like this but plugin documentation points to this thread and I wanted to share some insight that might be helpful to new users (if there are any) in setting it up.
This is an excellent denoiser and my no. 1 choice for a long time now. It used to be painfully slow if you wanted to squeeze the most out of it but on today's powerful CPUs it performs ok. I mainly wanted to comment on default/recommended values vs what I use.
- Documentation suggests sigma=1.5-2.5 for digital sources and 3 or more for analog. If detail retention is a priority, my recommendation is not to go above 2, unless you're encoding at low bitrate in which case fine detail is gone anyhow and stronger denoising will help compressibility. I normally use 1.5; it removes a substantial amount of noise without compromising on quality.
- Chroma planes tolerate much stronger denoising than luma so it's a good idea to process them separately. sigma=1.5, plane=0 (luma) + sigma=3, plane=3 (chroma) will be visually indistinguishable from sigma=1.5, plane=4 (all) but it will compress better. If you're afraid it doubles the time required because you need to apply FFT3DFilter twice, don't worry, it takes the same.
- Suggested optimal block size/overlap is bw,bh=32, ow,oh=16. This was written years ago with tolerable speed in mind, I presume. With a modern CPU, use bw,bh=16, ow,oh=8. It produces superior results.
- For 3D Wiener, bt=5 is suggested as best. This is actually the main thing that made me write this post, because I've always been using bt=5 and only today did I do some proper experimenting with this value. After quite a bit of testing, one thing I can objectively say is that bt=5, compared to default bt=3, consistently produces frames that are slightly less compressible. This means it washes out less data, but what is the nature of it in terms of noise/detail? Visual inspection of frames revealed no difference in most cases, and where there was a visible difference, quality seemed to be on the side of bt=3, surprisingly. So my conlusion is that bt=5 actually has slightly worse noise/detail removal ratio. Even if I'm wrong on this, perceptible difference really is insignificant, and considering that bt=5 comes with a pretty massive speed penalty, I say stick with the default.
- On multicore, be sure to set the ncpu= param, you'll get a decent speed boost.
tl;dr - my "best" settings:
FFT3DFilter(sigma=1.5, plane=0, bw=16, bh=16, ow=8, oh=8, ncpu=x)
FFT3DFilter(sigma=3, plane=3, bw=16, bh=16, ow=8, oh=8, ncpu=x)
Finally, use the ICL build (https://www.dropbox.com/sh/6kb3723po5oqd4b/AADbP8gIJ3YrHVoLU3joqJDma?dl=0) by Groucho2004 - it's faster and there's also a 64-bit build for AviSynth+. To use both versions on Win64 (I use 32-bit for scripting/preview in VirtualDub and 64-bit for final encoding) you also need both libfftw3f-3.dll versions from fftw.org. Renamed to fftw3.dll, 64-bit dll goes to Windows\System32 and 32-bit dll goes to Windows\SysWOW64.
Wow.
This has been really helpful. Thanks for writing this.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.