PDA

View Full Version : New Filter: SmartDecimate


kevina
23rd August 2003, 17:42
A new AviSynth filter is now available, SmartDecimate. You can find it at http://kevin.atkinson.dhs.org/tel/ .

This filter implements the Telecine Removal method at http://kevin.atkinson.dhs.org/tel/method.html. Although some parts of the document are now out of date as I have modified my filter a bit since I wrote the document.

This filter should be more stable than my Median filter.

It requires my C API Plugin which you can find at http://kevin.atkinson.dhs.org/avisynth_c/.

It should be very good at handling irrigular telecine. It will be very diffacult to get it to duplicate frames. It will also handle hybrid clips fairly well without any excessive jerkiness or blurring.

Things it should be good at:

(Possibly irregular) 3:2 pulldown -> 24 fps

Mix of trully interlaced material and 3:2 pulldown -> 24 fps

Better smart bob for telecine material (full resultion on telecine frames) when used together with a normal smart bob filter such as DgBob (http://neuron2.net/dgbob/dgbob.html) or Smooth Deinterlacer (http://biphome.spray.se/gunnart/video/AVSPorts/SmoothDeinterlacer/)

Please test it out and let me know what you think.

bilu
24th August 2003, 07:04
Guys, do have a look at this filter :o

I got better results with it over a Neo Genesis Evangelion clip than both with Telecide/Decimate and Uncomb/Decimate. No stuttering, no blended fields match.

It sometimes leaves some interlaced artifacts behind that you can easily correct with KernelDeint and others, but that's not the real problem when IVTCing complicated streams.

I do recommend it :)


Bilu

Aktan
26th August 2003, 04:41
Thanks for the heads up bilu. I'll try it out :) . Also thx a lot for another pulldown filter kevina20723! :)

Bogalvator
26th August 2003, 20:01
I echo the thoughts of Bilu here. I used this on an episode of the Simpsons from series 3 (DVD2AVI returned a value 67% film), and this filter did a great job, way better than Telecide and Decimate.

No blended fields at all, just a few combed frames, which, like Bilu said, can be easily cleaned up afterwards.

Good job Kev, your work is appreciated.

JediNight
28th August 2003, 06:56
How do you get Dgbob() working with this filter? I always get an error that its not the correct framerate...

bilu
28th August 2003, 09:54
Start reading from here:

http://neuron2.net/ipw-web/bulletin/bb/viewtopic.php?p=1173&highlight=#1173

That happened with the SSE version, not with Bob() but with DGBob().
Kevin released a fixed binary in the thread I mentioned.


Bilu

neuron2
28th August 2003, 19:44
Originally posted by Bogalvator
I echo the thoughts of Bilu here. I used this on an episode of the Simpsons from series 3 (DVD2AVI returned a value 67% film), and this filter did a great job, way better than Telecide and Decimate.
Did you use Decomb 4 or Decomb 5?

JediNight
28th August 2003, 20:17
bili: I noticed in that other thread they mentioned using Weave=true helps alot ... where is that command used?

bilu
28th August 2003, 23:49
Not in this version.

JediNight
29th August 2003, 02:18
Nothing I do gets rid of the combing in the mouths because of the 3 fields in a row problem =\

bilu
29th August 2003, 03:33
Have you tried:

b=DGBob(FOrder(),mode=1)
SeparateFields()
SmartDecimate(24,60,b,0.50)
KernelDeint(FOrder())

This is my favorite method.


FOrder works for MPEG-2 sources.

function FOrder(clip c) {
fo= GetParity(c)? 1:0
return fo
}



Bilu

JediNight
29th August 2003, 05:04
For some reason DGbob likes to add little white dots inside alot of the lines and the Kerneldeint always seems to make all the lines jagged even when it does fix some of the overall interlacing.

Edit: Just tried your preferred method, and every time there is a motion frame that one the lines are all jagged then it smooths itself out on the next frame (assuming it doesn't have more motion)

neuron2
29th August 2003, 05:12
Try this:

loadplugin("d:\avisynthplugins\mpeg2dec3.dll")
loadplugin("d:\don\programming\c++\avisynth\decomb\release\decomb.dll")
mpeg2source("twins6.d2v")
telecide(order=0,guide=1,post=4,vthresh=45,show=false)
decimate(mode=0)

If you cut the commercials out you'd have pure 3:2 material and it would be a breeze. As is though, this script does well on it.

Note: DGBob() is not intended for progressive material. The usage described is not sanctioned. They are trying to use a smart bob to avoid the problems that arise from trying to do field decimation. So far, I am not overly impressed with the results, but I'm keeping an open mind as it is early days for this approach.

kevina
29th August 2003, 10:04
A new version (0.20) is now available. Get it at http://kevin.atkinson.dhs.org/tel/ .

This version should give even better results. There should not be a need to decomb afterwards. It uses an improved field matching algo. which I hope to discuss latter.

The readme also included a short guide to using it. So have another look at it. It suggests good values for the various paramaters.

Bogalvator
30th August 2003, 01:04
Originally posted by neuron2
Did you use Decomb 4 or Decomb 5?

I used Decomb 5 b16 and the following script:

Telecide(order=1,guide=1)
Decimate(mode=3,theshold=1.0)

It gave out a lot of blended frames as it went out of pattern often. I recently tried that script on a later Simpsons episode (which was 89% film), and it gave better results than SmartDecimate (a lot of deinterlacing artifacts, more than usual). Still some blending but the motion was a lot smoother overall. SmartDecimate wasn't perfect on the original test but there were less ghost effects. But it was only 67% film according to DVD2AVI so maybe the original frames aren't completely recoverable.

I haven't tried v0.20 of SmartDecimate yet though....

mf
30th August 2003, 14:14
Bob source video has incorrect dimensions.

What's that all about ? My source is 720x480, and it doesn't work with 640x480 either.

DGBob(order=0)
LanczosResize(640, 480)
SeparateFields()
SmartDecimate(24, 60, last)

kevina
30th August 2003, 15:45
Try
LanczosResize(640, 480)
b = DGBob(order=0)
SeparateFields()
SmartDecimate(24, 60, b)

mf
30th August 2003, 16:34
Ah, you need to have 2 clips. You know that you can Invoke filters from within a filter, right? (Don't know if that's also possible with AVISynth-C) Might be easier to take the separatefields clip as an optional parameter and use an invoke as default.

Kurosu
30th August 2003, 18:11
Yep, but that's bothersome. You have to build an array of parameters, if you have to pass some. kevina20723's (let's call him Kevin from now on, if he doesn't mind :) ) solution is simplier for him as an author, because he doesn't have to get an headache parsing a string argument. Yes, scriptclip can give a hint; but *why* bother when a clip is so much more convenient?

Spoiled user :p

mf
30th August 2003, 18:17
Originally posted by Kurosu
Spoiled user :p
Hey, I also make my functions more user-friendly if I can (mftoon 0.4 resolution as exception - I just got pissed at AVISynth being complicated about variable types and where and how to use them). So I can ask the same from other developers :p.

Aktan
31st August 2003, 21:52
Hi, I get a green tint on the whole picture when using this script:

LoadPlugin("D:\PROGRA~1\GORDIA~1\mpeg2dec2.dll")
#That's really mpeg2dec3
LoadPlugin("D:\PROGRA~1\GORDIA~1\avisynth_c.dll")
LoadCPlugin("D:\PROGRA~1\GORDIA~1\smartdecimate-sse.dll")
mpeg2source("G:\DVD\Trigun\D5\TRIGUN5\RIP\D5.d2v",IDCT=7,CPU=6,moderate_h=30,moderate_v=50,iPP=true)
assumetff()
b = bob()
separatefields()
SmartDecimate(24, 60, b, tel=0.60)
#ConvertToYUY2()
#ConvertToYV12()
LanczosResize(512,368)

Now if I take out SmartDecimate(24, 60, b, tel=0.60), the green tint is gone. If I take out LanczosResize(512,368) instead, again the green tint is gone. Lastly, if I uncomment the 2 Converts instead, the green tint is gone. Any ideas?

I forgot to mention I am using avisynth version 2.52, with both the latest versions of avisynth_c.dll and SmartDecimate-sse.dll.

kevina
7th September 2003, 18:34
Version 0.21 now available.

This version included a greatly expanded documentation to give everyone a better idea of how SmartDecimate works and how to use it to its maxium potential. Amoung many other things.

As always you can find it at http://kevin.atkinson.dhs.org/tel/ .

kevina
17th September 2003, 01:16
I am now up to version 0.23 of my filter. I strongly encorage any one who tried my filter out before version 0.21 to give it another go. They have been many improvments in the filter, including greatly expanded documentation, and simpler syntax. Version 0.20 also has a greatly improved field matching algorithm which should lead to better results than with 0.12.

You can find it at http://kevin.atkinson.dhs.org/tel/. You can also read the documentation online (http://kevin.atkinson.dhs.org/tel/SmartDecimate.html).

Aktan
17th September 2003, 09:12
If I forgot to put assumetff() or assumebff(), what will the filter choose by default?

kevina
17th September 2003, 09:19
Originally posted by Aktan
If I forgot to put assumetff() or assumebff(), what will the filter choose by default?
What ever AVISynth tells it. To See what that is, use Bob(). It may get it correct if the information is encoded in the video format.

PS: The Problem you where having before should be fixed now. If its not let me know.

Aktan
18th September 2003, 09:53
Yea is was fixed since version 0.21 :D

DDogg
18th September 2003, 17:45
Warning for users of CCE 2.67 series and I assume other CCE versions, if you do put SmartDecimate.dll in your avisynth plugins folder CCE will crash immediately and vanish when a project is loaded. It is the same type of crash we saw with loadpluginex and that same author's version of warpsharp.


OS:XP Pro SP1 Cpu:XP-1700

kevina
20th September 2003, 02:44
Unless you are using the CVS version of AVISynth there is no benifit to putting it in the Plugin Directory as it won't autoload.

I belive this bug might be related to AtExit (I think that is what it is called) member function. I emailed sh0dan a trival test case about this problem.

DDogg
20th September 2003, 03:35
Yes, I am using the csv version so I thought I would try. Hey, no problem at all, just wanted to get it up as a warning for folks as if you don't know to look for it it will drive you completely nuts trying to figure out what is causing CCE to crash.

Mango Madness
20th October 2003, 06:23
Something is amiss when i use smartdecimate with dgbob. What happens is the movie plays but at seemingly random points in the movie it jumps, for only about .5secs, to another point in the movie. It is as if the linear progression of frames is b0rked. Also there are points where it speeds up to about 2X then it corrects itself, again, in the period of about .5-1 second. I have narrowed this problem down to the use of dgbob inside of smartdecimate because when i use default parameters everything works; i'm not saying that this is for certain, just all probability points to this. Here is a list of all the software/filters involved and the version numbers:

-DVD Decrypter 3.7.1.0
-DVD2AVIdg 1.0.0.0 (or however many zeros there are)
-avisynth october 11th build
-virtualdubmod 1.5.4.1 with august 8th patch
-mpeg2dec3dg
-smartdecimate 0.23
-autocrop 1.1
-vaguedenoiser 0.28
-masktools 1.0.2
-dgbob 1.6.0
-undot 0.0.1.1
-hybridresize 0.2
-matroska playback pack 0.6
-media player classic 6.4.6.7
-reclock 1.2

Here's my script:

loadplugin("C:\avisynth plugins\smartdecimate\avisynth_c.dll")
loadCplugin("C:\avisynth plugins\smartdecimate\SmartDecimate.dll")
loadplugin("C:\avisynth plugins\autocrop\autocrop.dll")
loadplugin("C:\avisynth plugins\mpeg2dec3\mpeg2dec3dg.dll")
loadplugin("C:\avisynth plugins\vaguedenoiser\vaguedenoiser.dll")
loadplugin("C:\avisynth plugins\MaskTools\masktools.dll")
loadplugin("C:\avisynth plugins\dgbob\dgbob.dll")
loadplugin("C:\avisynth plugins\undot\undot.dll")
import("C:\avisynth plugins\hybridresize\HybridResize-0.2.avs")

mpeg2source("C:\Temporary dvd projects\Blow\test.d2v")

assumetff()
smartdecimate(bob=dgbob(order=1, mode=1))
crop(4, 54, 712, 366)
hybridresize(640, 272)
undot()
vaguedenoiser(method=2, nsteps=6)

kevina
20th October 2003, 09:22
try this:

b = dgbob(order=1, mode=1)
smartdecimate(bob = b)

For some reason it won't work the other way. I think it is a bug in Avisynth.

Mango Madness
20th October 2003, 10:56
fixed, thanks.