View Full Version : Filter Request
Zarxrax
26th October 2002, 05:45
Does anyone know of any avisynth plugins that are similar to Jim Casabury's Temporal Cleaner filter for vdub? I always use this filter on all of my encodes, and it works very nicely for me, however its the only thing holding me back from doing all of the processing in avisynth. If there are no similar avisynth filters, perhaps someone could port it over to avisynth?
LigH
26th October 2002, 11:26
In MPEG2DEC.DLL you have a TemporalSmoother, and you can use Convolution3D to construct such kind of filter.
+: msoften by MarcFD could be interesting as well (look fo his URL in his signature in many posts around here).
Marc FD
26th October 2002, 13:20
msoften is a spatial cleaner. more like 2dcleaner
the temporal part is not very good. i'll drop in next release.
but i'm trying some new temporal thingies... wait'n'see ^^
Zarxrax
26th October 2002, 17:36
Hmmm. Convolution3d doesnt seem to work very well. Using Convolution3D(1,0,0,20,20,3,0) I was able to get the file down to about the same size as if I used temporal cleaner with blend 5 and pixel lock 3. However the Conv3d is SLOW. My encode goes 50% faster if I just do full procesing mode and apply temporal cleaner in vdub.
Also does anyone know if this setting for Conv3d can cause and sort of ghosting effect?
I wasnt aware of mpeg2dec.dll having any temporal smoother function. Are you talking about a modified version perhaps?
Manao
26th October 2002, 18:08
Convolution3d does work very well : of course, it is slow, but at low setting ( preset="movieHQ" for example, aka 0,3,4,3,4,2.8,0 ), it doesn't harm the movie ( at least not visibly for me ), and however allows a sensible size reduction.
It does a temporal and a spatial cleaning, a temporal one when the picture is still, a spatial one when there is a lot of motion, so it prevents ghosting artefacts from appearing, at least at low settings
I never got ghosting artefacts, but I only used values given by vlad in his readme, ie I never went beyond (1, 12, 22, 8, 8, 2.8, 0). But with the great values you gave to luma and chroma temporal threshold, it could happen.
vlad59
26th October 2002, 18:14
Originally posted by Zarxrax
Hmmm. Convolution3d doesnt seem to work very well. Using Convolution3D(1,0,0,20,20,3,0) I was able to get the file down to about the same size as if I used temporal cleaner with blend 5 and pixel lock 3. However the Conv3d is SLOW. My encode goes 50% faster if I just do full procesing mode and apply temporal cleaner in vdub.
Also does anyone know if this setting for Conv3d can cause and sort of ghosting effect?
I wasnt aware of mpeg2dec.dll having any temporal smoother function. Are you talking about a modified version perhaps?
Convolution3D's aim is to use spacial AND temporal information to smooth the movie and make it more compressible. So having 0 spacial threshold is not a normal use. If you want to only use temporal filtering use temporalSmoother or TemporalSoften.
Settings of 20, 20 can cause some little ghosting but not a lot.
Zarxrax
26th October 2002, 18:45
I tried temporal soften, but it doesnt work nearly as well as temporal cleaner does. Apparently all these temporal filters work on the video differently than temporal cleaner does. For example when I used the values 6,25,25 with temporal softer, I get bad ghosting, and it only makes my test clip 1.5mb. With temporal cleaner, settings of 5,3 (always use these same settings), the same clip will be only 1.32mb large. Also temporal cleaner at this setting has NEVER caused any ghosting in anything that I've encoded.
I guess its just kinda weird, temporal cleaner is like a miracle filter for me, but its so old you would think something better would be along :\
LigH
26th October 2002, 19:50
In case of a really bad need, you will always have the option to load it as VirtualDub filter, but then it will have to work in RGB color space. Not very fast though, I guess...
vlad59
26th October 2002, 20:16
Are you sure there is not any version of temporal cleaner for avisynth ??
Because by looking at the code, there is an YUV processing mode so it shouldn't be too hard to translate it to avisynth.
if there isn't any I could try to translate it.
Zarxrax
26th October 2002, 20:31
Well, I've never came across an avisynth version. There's not one listed on Chris' page, nor on avisynth.org.
If you could convert it, it would be greatly appreciated :D
vlad59
26th October 2002, 21:01
I still don't understand totally all the pixellock parameters maybe you can help me ?
But for the rest I start now.
EDIT : I just understood !!!!! I was stupid enought to start reading the code (well written) before reading the docs (much clearer)
Stupid me :scared:
vlad59
26th October 2002, 23:26
I coded a very simple filter heavily based on TemporalCleaner but with no pixel lock (at least for the moment).
The result :
- Visual quality is not a lot better (you can still see a lot of noise in my sample) but not worse (;)).
- Compressibility is better (First pass size dropped by 13%)
- speed penalty is not so important (I made some iSSE optimizations) and it's way faster than convolution3d ;).
I'll try to have Jim Casaburi (or neuron2 as Jim's readme talks about Donald) agreement before attaching my filter to this thread.
@Zarxrax
Can you explain me what are your prefered parameters (I need your experience to make test).
EDIT : rewrite the compressibility part to explain better.
Zarxrax
26th October 2002, 23:49
I've always left scene change at 30. I uncheck the box "Process in YUV colorspace" as well, since it slowed the filter down (i imagine this mode will always be enabled for the avisynth version, correct?).
I always use a value of 5 for the blending threshold and 3 for the pixel lock. I used to use 6,4 but I would occasionally notice some slight ghosting, so I dropped it down a notch to be on the safe side. The value of 5,3 seems to be the perfect value IMO. Note that I only encode anime, so different values might work better for live action.
vlad59
27th October 2002, 07:37
Can you make some test with and without the pixel locker (set it to 0) and give me impression about visual quality and compressibility.
Thanks in advance.
Zarxrax
27th October 2002, 08:12
Alright, ill set up a bunch of tests to encode overnight.
jorel
27th October 2002, 11:08
can anyone write a "script" (command line?),
learning how to use convolution3d?
thanks in advance!:)
vlad59
27th October 2002, 18:08
@Jorel
You'll find a .txt with convolution3d, you should find your answer here. If you have other question please post in the convolution3d v1.00 thread.
Thanks in advance.
@Zarxrax (difficult name ;))
I manage to build an avisynth dll for you to do some beta test. The use of the filter is fairly easy as I haven't kept all Jim Casaburi parameters : I only kept the blur thresholds :
TemporalCleaner (ythresh=5, cthresh=10)
ythresh (default value = 5) = luma threshold -> blur if the absolute difference between current luma value and previous luma value is below that threshold.
cthresh (default value = 10) = chroma threshold -> blur if the absolute difference between current chroma value and previous chroma value is below that threshold.
Like Jim Casaburi, I use the already processed previous frame (not the unprocessed one). So if you want to make test on a specific frame (in Vdub) :
go 4 or 5 frame before your test frame and then use the right arrow to reach your frame.
WARNING :
- this filter is written in iSSE ASM so it won't work with PII, K6II
and old Celeron.
- You must have a mod 4 width source to use this filter otherwise it could crash your computer.
You can download it
here (http://membres.lycos.fr/tempask/TemporalCleaner.zip)
Zarxrax
27th October 2002, 19:58
Ok, heres the results of the tests I ran last night. It was quite shocking, the pixel lock had very little effect on reducing the filesize, and in most cases, it actually made the file larger! So it seems the blending feature is the "important" one :)
Looking at the clips now, I'm not quite sure what happened. Even with large thresholds, I see no motion trails being left behind. This was a serious problem at higher thresholds when I did my original tests about a year ago, and the filter has not changed any... Due to this I'll refrain from posting my results I got until after I get this sorted out. I'll give your filter a run through too.
vlad59
27th October 2002, 20:13
Originally posted by Zarxrax
Ok, heres the results of the tests I ran last night. It was quite shocking, the pixel lock had very little effect on reducing the filesize, and in most cases, it actually made the file larger! So it seems the blending feature is the "important" one :)
I'm happy we have the same result here :)
That's why I haven't kept the pixel locker in the test version I compiled.
I'm waiting for your comments about my reading of Jim's code.
LigH
27th October 2002, 22:15
Thank you very much, vlad59 - your filter works very well on my AMD Duron-800. Using my "Array4x4" snippet -- http://www.ligh.de/software/Array4x4.rar -- I am now checking for the perfect values for y and c thresholds, like that:
LoadPlugin("?:\*\mpeg2dec.dll")
LoadPlugin("?:\*\TemporalCleaner.dll")
Import("?:\*\Array4x4.avs")
mpeg2source("?:\*\*.d2v")
Test4x4("TemporalCleaner", "", {init-y}, {step-y}, ",", {init-c}, {step-c}, "")
Try to alter e.g. the CompCheck AVS file from GordianKnot in a similar way, and use it to preview the result; I hope this may help others as well.
vlad59
27th October 2002, 22:33
@LigH
From my tests a luma values above 6 will produce ghosting (at least on my favorite vobs). For chroma it really depends on the source.
I gonna try to Array4*4
Can you also report about speed of this filter ?
thanks in advance ;)
Zarxrax
27th October 2002, 22:41
Ok, I've performed tests on 1 clip here comparing your filter to the vdub filter. However there seem to be slight differences between the two. Even in just the vdub filter itself, there seem to be differences depending whether it processes in yuv mode or not. Here are my test results:
On all tests using the vdub filter, pixel lock was disabled.
Tests with vdub filter:
1. Process in YUV turned OFF. Luma Blend set to 5. Filesize = 5,382,144
2. Process in YUV turned ON. Luma Blend set to 5, chroma blend set to 5. Filesize = 5,249,024 (this SHOULD have been the same as the above result, shouldnt it?)
3. Process in YUV turned ON. Luma Blend set to 5, chroma blend set to 10. Filesize = 5,249,024 (hmmm, same as last, weird)
Tests with AVS.
1. Luma blend set to 5, chroma blend set to 5. Filesize = 5,427,200 (largest result thus far)
3. Luma blend set to 5, chroma blend set to 10. Filesize = 5,386,240 (this is similar to the results of vdub test #1.
Finally, another vdub test, YUV turned off, Luma blend set to 5, pixel lock set to 3. Filesize = 5,335,040 (a bit better than the same settings without pixel lock).
On the upside, using your filter through avisynth was quite faster than using the vdub filter.
Zarxrax
27th October 2002, 22:46
Oh yea, and I finally got the filter to leave some motion trails. I just used it on a poor quality divx clip, which it seemed to really mess up. However on dvd source, I can use insanely high values (like blend=50, lock=20) and still get little or no artifacts. This is pretty weird, cause I explicitly remember it causing problems on one particular dvd when i used blend=6, lock=4. Hmmm...
LigH
27th October 2002, 23:04
About the speed:
a) 720x576 => Levels => Tweak => BiQ(512,288,1/3,1/3): around 14 fps;
b) same as above, plus TemporalCleaner(5,5) at the end: around 13 fps.
Result: It doesn't hurt very much in speed.
_
P.S.: Could you please add a small description text file to your package? It wouldn't hurt to tell the people out there which parameters are supported and which values are suggested. I (for example) had to look into the DLL file and search for any text to ensure I would use it correctly...
High Speed Dubb
28th October 2002, 06:11
The best thresholds are going to depend on a) the amount of noise, and b) the amount of contrast/detail in the picture. Unshaded animation can be improved with high blend values — but if you try that same blend value on a sitcom, it’ll look pretty bad.
Pixel locking is always going to be somewhat problematic, particularly with fades to black. If the pixel settles on Y = black+1, then it will take a very long time to get to Y = black. Also, even a very low lock value is visible in slowly moving faces, where it can cause speckling and posterization. A bald head is probably the worst case for it. (Because the filter uses feedback, rounding inaccuracies can cause similar problems.)
So if pixel locking doesn’t reduce the compressed size, then there doesn’t seem like any good reason to include it.
sh0dan
28th October 2002, 08:25
I've done an experimental PixelLock filter for AviSynth, and my experiences are the same - it increases the fileszie. Probably because of the motion-detection having a harding time, since it has to re-compensate for locked pixels.
You can search the forums for it, if you want to test. I attached it some time ago.
vlad59
28th October 2002, 08:55
@LigH
Don't worry I'll add sources and a txt file in next release. This one was just a test to be sure my implementation was not faulty.
@Zarxrax
It's normal that you don't have exactly the same results between the Vdub and Avisynth filter.
In the Vdub filter even if the thresholds checks are done in the YUV colorspace all the blending is done in RGB.
In my avisynth filter everything is done in YUV.
What about visual quality ?
I also liked the speed of this filter.
@High Speed Dubb & Sh0dan
So as we agree I won't add the pixel locker to TemporalCleaner until somebody proove me I'm wrong here ;)
Zarxrax
28th October 2002, 21:16
Ok I did some tests on a 40 minute long anime today, got some surprising results too.
Size without temporal cleaner: 660MB
Vdub temporal cleaner, no YUV mode, blend 5, no pixel lock: 619MB. No visual problems.
Vdub temporal cleaner, no YUV mode, blend 5, pixel lock 3: 592MB. Not a terribly large difference, but it did help a bit.
AVS tmporal cleaner, settings of 5,5: 555MB (WOW!). Visual quality suffered though. At the start of the anime, there was an arm moving at a brick wall, and trails of the chrominance could be seen. When the credits started fading in/out, they wouldnt fade completely out, but left a trace.
vlad59
28th October 2002, 22:01
Ooops that's annoying.
Actually the only remaining difference (except for the pixel locker) between both version is that in avisynth I process individually luma and chroma information. In VDub Jim process pixels.
So if luma is above the blur threshold and chroma is below
I blur the chroma and leave luma untouched
Jim leave pixel untouched (luma and chroma)
I gonna modify my current source to add those checks and maybe a pixel locker.
can you PM me your email adress so that I can send you a test filter as soon as it's done. Thanks in advance.
ajp
5th November 2002, 22:03
vlad59,
did you stop development of TemporalCleaner? It looked really promising and did wonders to my digital cable captures although the version I have seems to give me a slight discolouration sometimes...
I'd hate to see it cancelled, although Convolution3D is great this filter is much faster on those slightly noisy sources when Conv3D is not needed...
I'd be happy to betatest it... :)
vlad59
5th November 2002, 22:20
@ajp
No, I didn't stop any development on this. Zarxrax and Ligh made some beta test on a new version and it solved Zarxrax problem.
Now I just need one hour or two to finish the latest test and to clean up the sources before the public release. the problem is that as usual I don't have this time now (as always bl***dy work) so you'll have to wait till friday I think. Sorry ;)
ajp
5th November 2002, 22:34
vlad59,
wow that was a quick answer! :) Glad to hear it's being worked on, I can totally understand the lack of time. I don't have that much time myself so friday is perfect, makes me look forward to friday even more... :) (makes my life sound really sad doesn't it... ;) )
vlad59
6th November 2002, 20:07
Originally posted by ajp
makes me look forward to friday even more... :) (makes my life sound really sad doesn't it... ;) )
I face the same problem ;) ;)
ajp
8th November 2002, 19:32
Are we there yet, are we there yet, are we there yet??? :D
vlad59
8th November 2002, 20:03
You remind me my youngest sister at each christmas ;) ;) ;)
Just wait an hour or two :rolleyes:
ajp
8th November 2002, 21:19
Oh boy, oh boy, oh boy! *jumping up and down*
Seriously though, no rush... just wanted to keep the thread alive! ;)
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.