Log in

View Full Version : Gunnar Thalin Deinterlace Area Based v1.4 Equivalent


Pages : [1] 2

bobby8798
17th February 2003, 07:37
What is the Gunnar Thalin Deinterlace Area Based v1.4 Equivalent in Avisynth 2.50? or in Avisynth 2.07?

I need something to deinterlace a movie that is Purely Interlaced.


The Gunnar Thalin Deinterlace Area Based v1.4 Virtual Dub Plugin was the only filter I found that worked very well even during scene changes.

Is there some code that can be added to the AVS file to mimic the filter?

I want the framerate to stay at 30fps.

Guest
17th February 2003, 08:38
Decomb's FieldDeinterlace() or Tom Barry's TomsMoComp().

I have a port of Gunnar's filter to Avisynth 2.5 but only in RGB32.

bobby8798
17th February 2003, 08:47
Originally posted by neuron2
Decomb's FieldDeinterlace() or Tom Barry's TomsMoComp().

I have a port of Gunnar's filter to Avisynth 2.5 but only in RGB32.

PORT?
What is it?
How would it be used?

wotef
17th February 2003, 12:42
IIRC, Xesdeeni's smoothdeinterlace works the same as deinterlace area-based if you specify doublerate=false

http://home.bip.net/gunnart/video/AVSPorts/SmoothDeinterlacer/

Guest
17th February 2003, 14:29
>PORT?

Yes. (Port means moving a program from one platform to another by recoding and/or recompiling.)

>What is it?

A port of Gunnar's VirtualDub filter to Avisynth 2.5.

>How would it be used?

ConvertToRGB32()
Area(deint=15,edge=20,blend=true,show=false)

bobby8798
17th February 2003, 22:45
Originally posted by neuron2
ConvertToRGB32()
Area(threshold=15,edge=20,blend=true,show=false)

I'm using

LoadPlugin("c:\Program Files\GordianKnot\MPEG2DEC3.dll")
mpeg2source("c:\Test.d2v")
ConvertToRGB32()
Area(threshold=15,edge=20,blend=true,show=false)

BUT I get this error message when I open the AVS file in VirtualDub

Avisynth open failure:
SCript Error: there is no function named "Area"


-----
Thanks everyone, for the Filter Names.
I will try to find the other filters in the meantime

Guest
18th February 2003, 00:39
Umm, I said I have it. You didn't ask for it and I didn't give it to you. Then how can you try to run it? :)

bobby8798
18th February 2003, 01:47
wotef,
the SmoothDeinterlacer doesn't work for avisynth 2.50, but i will try it on v2.07. Thanks

decomb406b6.zip doesn't include a command file. is it listed somewhere?

neuron2

please post that thalin port
:D

Guest
18th February 2003, 01:59
>decomb406b6.zip doesn't include a command file. is it listed somewhere?

What is a command file? You'd think I'd know if it is required by Decomb. :)

>please post that thalin port

See below. See area.txt for usage.

bobby8798
18th February 2003, 02:34
thanks for the area file neuron2
ill try it out
do u have any plans to make one for YV12 or YUY2?

re:decomb command file
i meant a list of parameters with instructions
how would decomb be used to mimic the gunnar thalin filter?

Guest
18th February 2003, 03:41
Originally posted by bobby8798
re:decomb command file
i meant a list of parameters with instructionsWasn't there a help file in the distribution zip? If not, visit my site (see below) and get the official distribution. And please inform me if there is a zip going around that is missing the help file.

how would decomb be used to mimic the gunnar thalin filter? Like this:

loadplugin("decomb.dll")
FieldDeinterlace()Refer to the help file if you want to override the default parameters.

jcsston
18th February 2003, 03:54
Originally posted by neuron2
Wasn't there a help file in the distribution zip? If not, visit my site (see below) and get the official distribution. And please inform me if there is a zip going around that is missing the help file.
On this thread (http://forum.doom9.org/showthread.php?s=&threadid=41943) linked from the AviSynth website, the b4 has a html but the b6 doesn't.
The AviSynth 2.5 beta Plugin Package also included Decombb6 without an html file.

Guest
18th February 2003, 04:33
Thank you, jcsston.

@sh0dan

Can you please correct the plugin package? This is the kind of thing that happens that makes me want to just include links :)

Guest
18th February 2003, 04:36
do u have any plans to make one for YV12 or YUY2? No.

bobby8798
18th February 2003, 23:25
Tested
Smooth Deinterlace and Field Deinterlacer (decomb)

Smooth Deinterlacer works Perfectly on scene changes where field 1 and field 2 are from Different Frames.

Decomb Field Deinterlacer runs faster than Smooth Deinterlacer, but it corrupts the fields when there is a Scene change.

Is there a setting in Decomb that will fix that?


I will try TomsMoComp...

Guest
18th February 2003, 23:58
Originally posted by bobby8798
Decomb Field Deinterlacer runs faster than Smooth Deinterlacer, but it corrupts the fields when there is a Scene change.
Please try to be precise in your language to avoid wasting time and bandwidth. What do you mean by "corrupt"?

Post the exact script that you used. A screenshot of the "corruption" would be helpful as well.

bobby8798
19th February 2003, 00:50
Avisynth v2.50
--------------
LoadPlugin("c:\Program Files\GordianKnot\MPEG2DEC3.dll")
LoadPlugin("c:\Program Files\GordianKnot\Decomb.dll")

mpeg2source("c:\TestSC.d2v")

FieldDeinterlace(blend=false,dthreshold=50,show=false)

YV12toYUY2()

# Removing YV12toYUY2() has no impact.
# Changing blend=true makes no difference
# increasing dthreshold=100 is better, but problem remains
# increasing dthreshold=200 no deinterlacing is apparent;
# problem is no longer visible

Avisynth v2.07
--------------
LoadPlugin("c:\Program Files\GordianKnot\MPEG2DEC.dll")
LoadPlugin("c:\Program Files\GordianKnot\SmoothDeinterlacer.dll")

mpeg2source("c:\TestSC.d2v")

SmoothDeinterlace(blend=true, lacethresh=50, edgethresh=50, staticthresh=0, staticavg=0, showlace=false)

# changing lacethresh & edgethresh from 20 to 100 varies the degree
# of de-interlacing, but there are NO corruptions visible.


Note:
-----
In all Tests, nothing has been encoded, just viewed by VirtualDub.

Corruption:
-----------
Interlace Lines are greatly enhanced, so black lines are visible everywhere in little to medium size patches. Color from one field tends to bleed into the other field.


This happens with ANY Scene Change where field1 and field2 are from DIFFERENT scenes. This is NOT the same as a fade-in or fade-out. When an Overlap occurs during the scene change, the filter gets confused.

Guest
19th February 2003, 01:14
That is caused by blended fields in your source. The only solution is to set blend=true. Please try that and tell me what you get. If that doesn't correct it, I'll ask you for a VOB fragment to look at.

bobby8798
19th February 2003, 02:15
Changing the Blend from False to True changes the Color of the "Bleeding" patches.

If Blend=True, then one patch may take the color from field1, and changing Blend=False will now cause that patch to take the color from field2

The patch is just the filter's attempt to smooth things out, without considering that the 2 fields may be completely different and cannot be merged.

Guest
19th February 2003, 02:56
I guess you don't understand the significance of blended fields *in the source clip*, do you?

Post the source clip as requested and I will be happy to analyse the situation definitively for you.

bobby8798
19th February 2003, 04:05
Originally posted by neuron2
I guess you don't understand the significance of blended fields *in the source clip*, do you?


You are suggesting the field extraction is out of sync? Reversing the order may help this particular frame, but there could be a thousand of these in the entire movie, and they could be reversed again at any time. I think these blends are intentional, and the duration may be a few frames in some cases. I don't mind them either -- as long as they don't get corrupted during processing.

Or are you referring to Blend vs. Interpolate??

Decomb is the fastest de-interlacer that I've tested, and it would be nice to have this fixed by the time avisynth 3 is out so I can really use the speed advantage from YV12.

(Can't use YV12 now because of the DOT problem)

I will cut out that section of the VOB for your analysis.

Guest
19th February 2003, 04:11
I'll await your VOB, have a look, and then answer your questions.

Guest
19th February 2003, 07:23
OK, got your VOB and analyzed it.

Frame 18 has one field that is a strong blend of two pictures. The other field is also a blend but so slight you can pretend it isn't. You can prove this to yourself using SeparateFields().

Now, to deinterlace frame 18, one field will be used and the other interpolated from the used field. If the used field is the blended one, your deinterlaced frame will be a blend. If your used field is the non-blended one, the frame will be clean. So it is a matter of which field the deinterlacer uses. SmoothDeinterlacer got lucky, while FieldDeinterlace got unlucky. It all depends on which field the blend falls in, the top or bottom field.

The deinterlacers use a fixed choice of field for interpolating on. They don't have a way to identify a blended field and then avoid it.

You can make FieldDeinterlace do your VOB right by putting this first:

Crop(0,1,720,479)

This in effect makes it use the other field for interpolation. And now SmoothDeinterlacer gets it wrong, as expected!

Look at your whole movie. I'll bet you'll find the scene cut blends are sometimes in the top field and sometimes in the bottom field. If that is the case, then you'll find cuts that SmoothDeinterlacer will get wrong too.

If you find that the cut blends are always in the top or always in the bottom, please tell me. It will suggest that a new option for FieldDeinterlace may be in order: force interpolation on top/bottom.

Try to keep things in perspective, when the clip is played at normal speed, everything looks fine. You only object because you single step through the frames and see it.

Guest
19th February 2003, 07:32
Oh, and here is SmoothDeinterlacer compiled for Avisynth 2.5 (RGB32 and YUY2 only).

hakko504
19th February 2003, 12:19
Originally posted by neuron2
This in effect makes it use the other field for interpolation. And now SmoothDeinterlacer gets it wrong, as expected!
Even with tff=false ?

Crop(0,1,720,479) will fail in AviSynth2.5 due to crop restrictions.

sh0dan
19th February 2003, 13:05
Why is MPEG2DEC3 0.94 included in the decomb package?

Guest
19th February 2003, 14:15
Originally posted by hakko504
Even with tff=false?Yes. The filter uses the tff parameter only to determine the temporal order of the fields, not to select the field to interpolate on. Even if it did, it would still get half the cuts wrong if they are distributed in both fields.

Crop(0,1,720,479) will fail in AviSynth2.5 due to crop restrictions It doesn't fail, but you can use Crop(0,1,720,478). The point is to remove one line from the top.

Guest
19th February 2003, 14:22
Originally posted by sh0dan
Why is MPEG2DEC3 0.94 included in the decomb package? Just haven't updated it yet. But that DLL is equivalent to the 1.0 release. EDIT: Website release updated with mpeg2dec3 1.00.

Now my question for you: why does your plugin package not include the Decomb help file? That's a rather serious omission isn't it? Please add the help file ASAP. Thank you.

bobby8798
19th February 2003, 21:41
neuron2,

Crop(0,1,720,479) makes a difference when Blend = OFF.

But, when Blend = ON, Decomb has the corrupted patches regardless of the Crop(0,1,720,479) setting. Smooth Deinterlacer has NO corruptions whatsoever.

When Decomb is used with Blend=ON, check his eyes, mouth and ears. Those patches do not occur with Smooth Deinterlacer. You may have to change the settings (brightness, contrast?) on your monitor to see them. I am using 800x600, 32Bits.


Thank you for re-compiling Smooth Deinterlacer.
I will try it out.

Guest
19th February 2003, 21:55
I do to all this work for you and you don't bother to answer my questions. :)

Do your blends occur in only the top or bottom field or are they distributed between both?

I will check your other point when I get home this evening. Again, please do not talk about "corruption". It is meaningless. What are you seeing around those areas when blend is On and the crop is done?

I can tell you that SmoothDeinterlacer *is* making a blend for frame 18. It is just very faint.

bobby8798
20th February 2003, 00:48
Looked over 2000 Fields

The Blend fields are random

Sometimes odd, sometimes even.

The "corrupted" areas are patches of red, green, and blue? lines.
You have to see the sample for yourself.

Blend ON, no Crop, patches around his eyes, mouth, and ear. Patches all over her face.

Blend ON, with Crop (shifted), more patches on his face, but from another field. Patches all over her face that is more apparent than from before.

The patches are similar, but not identical.

Guest
20th February 2003, 01:11
I just noticed your dthreshold (=50!) is WAY WAY too high. Where the heck did you pull that from???? That is why you see some combing.

Try the default 9 or lower and then report back.

Anyway, if the blends are random, neither deinterlacer is going to fix them all. You can't even see them at normal speed so why are you obsessing about it?

One last question. Did you read and understand the help file? Is there something confusing in there that I can improve?

bobby8798
20th February 2003, 04:25
dthreshold=20 lots of lines are visible
dthreshold=9 some lines are still visible, but much better
dthreshold=1 99% clear !!

Thanks for answering the question about the dthreshold setting.

I'm just testing the filter to find a comfortable setting that won't de-interlace too harshly. It was during the testing phase that I found those lines. I won't be stepping through each frame once a setting is found.

Your help file is VERY l o n g and looks like it covers everything. Good Job! I will probably only use FieldDeinterlace, and later read the other parts when required.

Your help file: dthreshold (0-255, default 9)

Maybe you can add:
At what value of dthreshold does the de-interlacing esentially become ineffective ? Maybe 30?, eventhough the numerical value goes up to 255

Can you modify decomb to increase the de-interlacing whenever blend fields of that nature is encountered, and resume normal processing afterwards ?

Thanks a lot for looking into this neuron2 :D

Guest
20th February 2003, 04:43
>dthreshold=1 99% clear !!

That's way too aggressive. If you like strong, probably 5 is good. If you go too low, you might as well capture one field and then resize. You're not getting any benefit out of the algorithm.

>Maybe you can add: ...

That's a good idea. I'll do it in the next release.

>Can you modify decomb to...

That's very difficult and complicated for a small gain.

>Thanks a lot for looking into this neuron2.

Glad to be of assistance.

N_F
1st April 2003, 12:48
Originally posted by neuron2
>dthreshold=1 99% clear !!

That's way too aggressive. If you like strong, probably 5 is good. If you go too low, you might as well capture one field and then resize. You're not getting any benefit out of the algorithm.


@neuron2

I was searching around and stumbled upon this thread. I'm currently using fielddeinterlace(full=false, dthreshold=3) on a series. Would you say that is too high too?

I found the number 3 by comparing 1 and 5. 1 was clean while 5 still had some soft lines left. I tried 3 and the lines were gone so that's what I'm using (only on this particular series, normally I use default 9).

Any general comments? Is it normal that different materials require different dthreshold values?

Also, is it very hard to understand how dthreshold works? If it is, you needn't bother, but if it isn't I'd appreciate any information or links you could give me.

Guest
1st April 2003, 12:55
The dthreshold parameter is like the threshold parameter of my VirtualDub Smart Deinterlace filter. With the latter, you can see the effect of different values by enabling the "Show motion areas only" option. The next release of Decomb will add this option to allow you to properly set dthreshold. In general, I would consider that if you go below 5, you are getting very little benefit from the adaptive algorithm.

N_F
1st April 2003, 13:03
Thanks for your reply. I'll check your VirtualDub Smart Deinterlace filter and see what I'll find.

futurex
30th December 2005, 23:55
hi neuron2, i know this is an old thread, but could you please post a link to smooth deinterlace plugin for avisynth 2.5x? thanks!

Wilbert
31st December 2005, 00:52
SmoothDeinterlacer: http://www.geocities.com/wilbertdijkhof/SmoothDeinterlacer_25.zip
I don't have this Area plugin.

futurex
31st December 2005, 01:49
thankyou very much wilbert, much appreciated :)

should i be using this, do you think? is there a newer deinterlacer that can do the job better?

by the way, i'm looking to output to 50fps, from 25fps interlaced

foxyshadis
31st December 2005, 02:44
iirc, the general order these days is, from best to worst (and almost slowest to fastest), although the middling smart bobs are somewhat prone to artifacts, and all of the top 3 use eedi2 (slow):

mvbob
securedeint
tdeint+eedi2
tdeint
tomsmocomp
leakkerneldeint
smoothdeinterlace
fielddeinterlace
dgbob
bob

I might be incorrect about the ordering of the last bunch, and might've missed a few, it's mostly the top 5 that I've used routinely.

futurex
31st December 2005, 03:28
thanks foxyshadis :) which of those outputs to 50fps?

i read on http://www.100fps.com that "progressive scan (bob+weave)" gives best quality, and that smoothdeinterlacer does that. but its really slow and doesn't accept YV12 :sad:

Revgen
31st December 2005, 03:49
MVBob is IMHO slightly better than TDeinterlace+EEDI2 on pure interlaced sources. However, TDeinterlace+EEDI2 does a better job on cartoons and a great job on film material as a postprocessor.

foxyshadis
31st December 2005, 04:15
bob = doublerate output. Pretty much all the listed filters have a bob mode. It's certainly best for watching, temporal filtering, or standards conversion, but when encoding you'll probably want to throw the extra frames away.

(smoothdeinterlacer is pretty fast compared to mvbob & eedi2, iirc. :p @revgen: I've built a custom mvbob with motion/mvflow, which is faster and somewhat better imho, and I also tried adding eedi2 into it but that was just too slow. Looked great though! [edit: I just found out the latest mvbob has eedi2 and mvflow built in! haha, so much for my effort.])

futurex
31st December 2005, 05:29
thanks for the help guys,

but don't you lose half the resolution when bobbing? the site above says smoothdeinterlace only halves the resolution where interlacing artefacts are present, so most of the time, during still scenes, the full resolution is there?

foxyshadis
31st December 2005, 05:54
No, you're confusing smoothdeinterlace specifics with deinterlacers in general. You'll notice it's near the bottom of my list, the motion-compensated ones on top are so much better.

Bob/Deinterlace are also two sides of the same coin: Deinterlacing is most simply axing half the frames of a bob, which is why most can output either way. The better the bob the better the deinterlacing. Just give tdeint (http://forum.doom9.org/showthread.php?t=82264) (or leakkerneldeint if you want serious speed) a try, the difference compared to dumb bobs is quickly noticeable. The top two are even better but much slower, however.

I should really mention, that page is a few years old. AVIsynth tools have grown up a lot since then.

Guest
31st December 2005, 06:45
I like LeakKernelBob(), which is an Avisynth function based on LeakKernelDeint(). It's very fast. You'll find SmoothDeinterlacer to be quite slow, without any compensating advantages. Other people like mvbob() and others. I'm sure tritical must have a good bobber as well.

futurex
5th January 2006, 10:00
thanks foxyshadis, i like tdeint :)

i have read (and mostly understood) the readme files, but can somebody please explain to me the threshold options? what's the difference between mthreshC and mthreshL and cthresh? which one should be used, and when i use "map", what signs should i look for that i have guessed the ideal value? (is 25 a good number for both mthresL and mthreshC???)

Terrazini
22nd June 2006, 19:57
SmoothDeinterlacer (http://www.guthspot.se/video/AVSPorts/SmoothDeinterlacer/) was updated. Added YV12 colorspace native support and MMX&SSE optimization for YV12. The original algorithm of the filter was kept.

Chainmax
23rd June 2006, 19:17
foxyshadis, why didn't you include SecureDeint() in the list?