View Full Version : Memory leaks in Fluxsmooth: no destructor...
fabrice
11th November 2003, 05:50
Hi,
I was trying to use Flusmooth in a scriptclip 'environnement', and I saw that there is a big memory leak in this filter.
I get the sources from sansgrip homepage, and I saw that the YV12 version don't have destructor...
Could someone modify the sources, to add this destructor (in the YV12.h file), with only this lines (like in the YUY version):
FluxSmooth_YV12::~FluxSmooth_YV12()
{
if(scaletab_MMX)
delete [] scaletab_MMX;
}
I think this is the only reason for the memory leak.
Thanks in advance,
Fabrice
Wilbert
11th November 2003, 10:26
I will look at it tonight!
Wilbert
11th November 2003, 20:21
It gives the following error when compiling (I didn't add anything yet):
--------------------Configuration: Fluxsmooth - Win32 Release--------------------
Compiling...
FluxSmooth.cpp
F:\CompilingPlugins\Fluxsmooth\YUY2.h(471) : fatal error C1601: unsupported inline assembly opcode
Error executing cl.exe.
Fluxsmooth.dll - 1 error(s), 0 warning(s)
Lines 468-471:
// Store
packuswb mm1, mm7
movntq [edi + ecx], mm1
I hope someone has an idea what is going wrong here, since this is black magic to me :(
Complete source can be found here: http://www.jungleweb.net/~sansgrip/avisynth/
sh0dan
11th November 2003, 21:18
movntq is an Integer SSE instruction, and it should compile nicely. Which compiler/processor pack (version) are you using?
Wilbert
11th November 2003, 21:32
Oops I forgot to install the processor pack :)
But now I have a different problem. I got the VC++ 6.0 standard edition, and the processor pack needs the Enterprise or Professional edition :devil: :devil: :devil: What kind of nonsense is that :angry:
Sh0dan can you have a look at it?
sh0dan
11th November 2003, 22:28
Had a bit of fun too! ;)
Anyway:
- Removed leak in AviSynth 2.5 YV12 mode (code by fabrice)
- Aligned tables and variables.
- Use AviSynth BitBlt for copying chroma.
- Don't use streaming store. (movntq)
All in all an approximate 15% speedup compared to previous version. All changes are marked with "sh0:".
Fluxsmooth 1.01 (http://cultact-server.novi.dk/kpo/avisynth/fluxsmooth_101.zip)
DDogg
12th November 2003, 00:15
damn this is good news, thanks to all of you!
PowerMacG4
12th November 2003, 03:43
Originally posted by Wilbert
Oops I forgot to install the processor pack :)
But now I have a different problem. I got the VC++ 6.0 standard edition, and the processor pack needs the Enterprise or Professional edition :devil: :devil: :devil: What kind of nonsense is that :angry:
Sh0dan can you have a look at it?
You can manually install it by right clicking on the INF and letting it 'install', and then dragging all the files into the right directories. I think that may only apply to the beta version, though. Worked for me..
fabrice
12th November 2003, 05:44
Thanks to all, and especially sh0dan for compiling and optimizing it!
It's test time gain! :)
CU
Fabrice
Druizk
12th November 2003, 20:09
Thanks for all, particulary @shodan & @Wilbert.
Ago very months I have problem, these bit leak memory, VirtualDubMod no rebooting after of terminate list jobs.
the problem was eliminate with fluxsmooth 1.01.
Boulder
13th November 2003, 16:30
Originally posted by sh0dan
Had a bit of fun too! ;)
Anyway:
- Removed leak in AviSynth 2.5 YV12 mode (code by fabrice)
- Aligned tables and variables.
- Use AviSynth BitBlt for copying chroma.
- Don't use streaming store. (movntq)
All in all an approximate 15% speedup compared to previous version. All changes are marked with "sh0:".
Fluxsmooth 1.01 (http://cultact-server.novi.dk/kpo/avisynth/fluxsmooth_101.zip)
sh0dan,
as you seem to be fixing things a lot these days, would you mind taking a look at CNR2? It behaves really weird, CCE blows up immediately with CNR2 in the script. TMPGEnc crashes occasionally when closing the program, stating that cnr2.dll had something to do with it.
I believe that Don fiddled with the filter last time, there's a thread about that buried somewhere in the forum.
Thanks for the FluxFix:D
sh0dan
13th November 2003, 18:48
cnr2.5 (http://cultact-server.novi.dk/kpo/avisynth/cnr2_5.zip).
Bugs should be fixed now.
Boulder
13th November 2003, 18:58
What can I say - lightning fast action!
At least one analog capture freak owes you big time.
:thanks:
Boulder
13th November 2003, 19:14
Hm, after a bit testing I noticed that it doesn't actually do anything. I tried with this script:
video=AVISource("c:\temp\captures\capture.avi",false)
video=video.FieldDeinterlace()
a=video.CNR2("ooo",255,255,255,255,255,255,255,false)
b=video
Subtract(a,b).Levels(127,1,129,0,255)
The version at the filter collection shows a lot of smoothing whereas the fixed one doesn't do anything:confused:
sh0dan
13th November 2003, 20:37
Yeah - YUY2 mode seems a bit unimpressed by the settings.
Boulder
13th November 2003, 21:20
Originally posted by sh0dan
Yeah - YUY2 mode seems a bit unimpressed by the settings.
It seems that both YV12 and YUY2 don't do anything to the clip - I ran a quick compressibility test and the filesize is the same with and without CNR2. Damn:(
vhelp
14th November 2003, 00:47
@ Boulder,
what source are you using VHS; Cable; Satellite ??
Or does it not matter. I thought that cnr2 was mainly for VHS source.
I'll give your source snip a try on my VHS captures I have laying around.
I'm curious to see if I get same results :rolleyes:
-vhelp
Boulder
14th November 2003, 07:30
I tried it on a analog TV cap, cable source. The difference between the bugfixed and the earlier version should be obvious as the settings are at maximum;)
Prettz
16th November 2003, 05:41
wow thanks for the FluxSmooth fix Shodan, that's my favorite denoiser too
sh0dan
16th November 2003, 10:50
I seem to recall something about the source not corresponding to the binary - so that's probably the issue. YV12 mode works on my setup though.
Boulder
17th November 2003, 13:25
Using YV12 makes no difference on my setup:( I used PicVideo MJPEG to capture the test clip if that makes any difference.
sh0dan
18th November 2003, 00:16
Have a go at CNR 2.51 (http://cultact-server.novi.dk/kpo/avisynth/cnr2_51.zip).
I hope this one does it for you!
Stupid compiler. It may also be everso slightly faster in YUY2.
Boulder
18th November 2003, 07:40
Thank you sh0dan, this version does work - in YV12 only on my clip but I'm converting to YV12 anyway so it doesn't matter:)
Boulder
18th November 2003, 08:52
After playing with the filter I think I've discovered the main problem with it. The scene change detection is somehow flawed and that's why the filter doesn't appear to smooth the video.
I captured a Star Trek episode last weekend and noticed that it would require a scene change threshold value of 172 to do any smoothing at all, regardless of the position in the video! If I put scdthr=171, there is no smoothing whatsoever:confused: As the default value is 8, there's definitely something wrong here.
Here are two screenshots to visualize the thing. The frame is at a scene change point but the same behaviour occurs even when there are no scene changes.
http://www.cc.jyu.fi/~camneely/171.jpg
http://www.cc.jyu.fi/~camneely/172.jpg
Here's the script I used:
video=avisource("c:\temp\captures\startrek.avi").fielddeinterlace().converttoyv12()
video2=video.cnr2(scdthr=171)
subtract(video,video2).Levels(127,1,129,0,255)
I'm really sorry to bother you with this - if you don't have the time to mess around with the filter, I'll understand:)
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.