Log in

View Full Version : New very slow FFT denoiser


Pages : 1 2 3 [4] 5 6 7 8 9 10 11 12 13 14 15 16 17

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!