Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
21st December 2004, 18:46 | #23 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
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.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
21st December 2004, 22:47 | #25 | Link |
Registered User
Join Date: Oct 2003
Location: Germany
Posts: 377
|
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: Code:
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 } |
21st December 2004, 23:54 | #26 | Link |
Awakened to video Dec2003
Join Date: Dec 2003
Location: US West
Posts: 191
|
@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? |
22nd December 2004, 21:46 | #29 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
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!
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
24th December 2004, 00:40 | #30 | Link |
Awakened to video Dec2003
Join Date: Dec 2003
Location: US West
Posts: 191
|
@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.] |
24th December 2004, 23:08 | #31 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
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.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
25th December 2004, 11:42 | #33 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
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
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
26th December 2004, 12:50 | #35 | Link | |
ffdshow/AviSynth wrangler
Join Date: Feb 2003
Location: Austria
Posts: 2,441
|
Quote:
(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) |
|
26th December 2004, 20:32 | #36 | Link |
Registered User
Join Date: Sep 2004
Posts: 16
|
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
__________________
q3fuel |
26th December 2004, 23:31 | #37 | Link |
Awakened to video Dec2003
Join Date: Dec 2003
Location: US West
Posts: 191
|
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. :'(
__________________
Mac killed my inner-child My Quant Matrices: Caerulea For MPEG-2 DVD Destination Anime Simple Lo General Purpose MPEG-2 (tested with anime only) Last edited by DarkFoon; 27th December 2004 at 04:30. |
27th December 2004, 21:36 | #38 | Link | |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
Quote:
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
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
|
27th December 2004, 22:53 | #40 | Link |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
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. |
|
|