Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 12th September 2004, 20:48   #1  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
TDeint and TIVTC

Well I made a new motion adaptive deinterlacer/smart bobber called TDeint. The main three reasons for its existence are it is bi-directionally motion adaptive... meaning if you have the following field and pixel sequence, where '-' is the pixel position to be filled:
Code:
a   d   g   j   m
  c   f - i   l
b   e   h   k   n
Then TDeint will try either weaving the average of f and i, or simply f or i based on the motion in the surrounding pixels. Afaik, the only deinterlacer that currently does this is scharfis_brain's intellibob. All other motion adaptive deinterlacers currently only weave whatever pixel gets weaved into the current frame by default. That means that all pixels will be detected as moving in the first frame after a scene change. (If I am wrong about this and another deinterlacer already does this please tell me!).

Second, this filter is using a new form of modified ELA interpolation that I have been working on recently. It takes into account the direction of the normal line to the gradient vector when deciding in which direction to average, and attempts to tune the interpolation so that it can adapt to any edge direction within its range. In terms of quality, it is better then plain 5+5 tap ela as in tomsmocomp, but not quite as good as some other techniques such as NEDI or edge post processing as in antialiasing that sangnom uses. The nice thing about this method, though, is that it is still pretty fast (running about 30fps in dumbbob mode on 720x480 images on my comp). For comparison, here are a few images of a simple dumbbob (no motion adaptation), the first was made using this modified form of ELA, the second was made using tomsmocomp(-1,-1,0) (5+5 tap ela w/ clipping), the third was made using AviSynth's built in bob which uses cubic interpolation, the fourth was made using sangnom(aa=0), and the last was made using sangnom().

modified ELA
tomsmocomp(-1,-1,0)
AviSynth's Bob (cubic)
sangnom(aa=0)
sangnom()

Third and finally, it has support for user overrides. Not only allowing the user to set which frames should be deinterlaced as fielddeinterlace() does, but also allowing the meaningful parameters to be adjusted for single frames or ranges of frames. Also, when working as a same frame rate deinterlacer it allows the user to control which field is kept and which field is interpolated.

Anyways, the reason I posted this in the development forum was that I don't really have much if any true interlaced material to test with, aside from what I can capture here in my dorm room. Thing is, we have about the worst cable reception known to man so its hard to tell if a deinterlacer is any good. I was hoping someone with some true interlaced material would be inclined to test it a little or someone could send me a few interlaced clips to test with to make sure everything works alright. It does seem to work great as a per pixel field matcher, as I have only been testing it with telecined material from dvds. With default settings the filter runs around 45-55fps on my 2.2Ghz p4.

TDeint v1.1

TIVTC v1.0.5

EEDI2 v0.9.2

TMM v1.0

avi_tc_package v1.5

If you're looking for older versions try: old_stuff

Last edited by tritical; 17th January 2008 at 08:26.
tritical is offline   Reply With Quote
Old 12th September 2004, 21:22   #2  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,607
in mode=1 it only returns the half number of frames of the video. the framecount is the one of the bobbed video, but it stops moving after the half of the length.

could you make it optional, whether, both fields are weaved or only one of both, even if low motion allows it?

btw. great work!

I will test it more intensive tomorrow.
I was hoping for such plugin for along time
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.

Last edited by scharfis_brain; 12th September 2004 at 21:28.
scharfis_brain is offline   Reply With Quote
Old 12th September 2004, 22:02   #3  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
Sorry about that, stupid bounds checking, really not sure how I missed that one when I was testing it . There was also a problem with one of the motion checks being incorrect (not getting set to false) on the very first and very last frame of a video. Hopefully, there isn't anything else wrong... I actually tested it and looked over the code quite a bit before I released it, so much for that .

Yeah, I can add the option to have it only weave from previous or only weave from next... I had tried to keep the # of options as low as possible for this filter as compared to some of my other filters.
tritical is offline   Reply With Quote
Old 14th September 2004, 04:28   #4  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,547
wow, this is a really f***ing good bobber.

i've gotta go rip one of my field blended animes... i might finally have something to give it that (a) doesn't make odd block artefacts (intellibob is great, but i get strange bits unpredictably so i can't use it for serious stuff), and (b) is fast enough.

hmm... i've got some PAL interlaced DVD crap if you want to see it. interlaced fade-ins and outs cause hell with anything, but it might be worth seeing how this performs anyway.

will post a clip in a few mins (what's the max length of a sample i can post to avoid being flayed alive by the MPAA? i doubt the publishers of this DVD really care, but i'd like to keep things legit)

[edit]

here's 20 sec or so from the start of John Safran's Music Jamboree. i left the sound in cause it's pretty funny...

rightclicksavetargetas, or you'll end up with plain text garbage (at least i did when i tested it).

if it's dead, tell me because i'm new to apache...

http://210.49.108.136:8080/safran.vob

14.4MB

[edit edit]

the default thresholds are a little too high for field-blended anime - it gets chunky very fast. here's a sample of the Chobits intro, r4 pal (field blends up the whaazoo)

http://210.49.108.136:8080/chobits_intro_chunk.m2v

hope these are enough to start tweakage...

by the way, i'm hosting these on my machine, so the links will go dead when i go to bed...

[edit 3]

changed URLs in the hope that they will work properly...
__________________
sucking the life out of your videos since 2004

Last edited by Mug Funky; 15th September 2004 at 08:47.
Mug Funky is offline   Reply With Quote
Old 14th September 2004, 18:38   #5  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
@Mug Funky
Just tried the links and they didn't work... but maybe your comp is still off? I would very much like to run a few tests on those samples.

@scharfis_brain
When you said make it optional if both fields are weaved, do you mean make it so that it can be set to only be motion adaptive in one direction? or that it should not use the avg() of the two center pixels but just one or the other?

As for the filter, I'm implementing another mode for motion detection that requires a 5th field worth of no motion in order to declare a pixel position stable. It will be slightly slower, but should help eliminate any of the stray artifacts from the usual 4 field motion check. Have to see how it performs...
tritical is offline   Reply With Quote
Old 14th September 2004, 20:03   #6  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,607
forget about that anti-averaging request.

but it would be good IMO, if the filter decides for the whole plane, whether the next or prev field is used, instead of doing this pixelwise.
I ask for this, cause fieldblended video always swaps its phase, so the pixel of the wrong-phased (non-fitting) field would not be relevant (the sum up to less than 1% of the whole weaved pixels).

the next thing I would think, that it would be good, is kernel-interpolation.

it is not as jaggy-free as edge-directed interpolation, but it produces a much more stable (lesser flickering) image in bobbed areas, cause my intellibob uses a one-way kernel, that is turned to fwd or bwd direction to fit the in-phase-field. (but I think, this would be hard to implement)

EDIT:

my very raw intellibob() replacement with hardmatching, when fields are near to equal:

Code:
function matchbob(clip c, int "combth", bool "show")
{
	show = default(show, false)
global 	cth = default(combth,6)

	ord = c.getparity() ? 1 : 0
	odd = c.doubleweave().selectodd().telecide(order=1-ord,post=0)
	even = c.telecide(order=ord,post=0)
	tel = interleave(even,odd).duplicateframe(0)

	analyse = tel.greyscale()

	tel = show ? tel.subtitle("fieldmatched") : tel

	bobbed = c.TDeint(mode=1, order=ord, mthreshL=8, mthreshC=6,type=2)
	bobbed = show ? bobbed.subtitle("bobbed") : bobbed

	conditionalfilter(analyse,tel,bobbed,"iscombed(cth)","==","false")
}
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.

Last edited by scharfis_brain; 15th September 2004 at 20:43.
scharfis_brain is offline   Reply With Quote
Old 14th September 2004, 21:29   #7  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
k, I wont do the non-avg option. On the kernel interpolation I will definitely try it... probably the one-way and one-way sharp kernels from kerneldeint. An easy way to switch between using the prev or next field in the kernel would be to simply subtract each field from the curr field and use whichever one is most similar. Its not super complex, but should be a little better then always using the previous field. The per field weaving instead of pixelwise weaving I think I'll leave alone for now because it would effectively make it a field matcher and probably a rather poor one . Atm, this filter is more intended for true interlaced material or material where you can't do pure field matching as opposed to a combination of each like your matchbob function.
tritical is offline   Reply With Quote
Old 14th September 2004, 21:58   #8  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
So, this filter followed by a decimation results in IVTC? In any case, I could provide you with some samples of the "Spawn 1 Season" DVD if you're interested.
Chainmax is offline   Reply With Quote
Old 15th September 2004, 05:28   #9  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,547
@ tritical:

sorry... looking at the time you posted, it was 4:38 AM my time.

i'll leave my machine on tonight. i just hope apache is behaving itself... it works when i click the links myself, but if there's firewalls and stuff happening i might have to set up one of those port redirect things.

post again if you can't get them and i'll see what i can do.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 15th September 2004, 05:52   #10  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
@Mug Funky
Just tried them an they wouldn't work . Internet explorer just says it can't establish a connection to the server.

I posted v0.9.2, I added kernel interpolation... the one way sharp and normal kernels from kerneldeint. It switches between using the forward or backward field based on which one is most similar to the current field. In terms of flickering it was definitely a large improvement. I also added the 5 field motion check, well... half way added it. I got the extra 2 field checks in there to make it 5 field, but didn't implement any of the 4 field checks I was planning and which would be the most effective with fades. The other thing about the 5 field check, is that it can deal with having duplicated interlaced frames in the video where the 4 field can't. Anyways, still have things to test.
tritical is offline   Reply With Quote
Old 15th September 2004, 08:50   #11  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,547
try again

just changed the links.

i wish i had 2 computers working on different lines so i could test these things myself... the only current test i have is to give people links over instant messenger progs and ask if they worked...

[edit]
just got a friend to test it on his machine and the link seems to work fine. i suppose any other problems will be from firewalls blocking port 80 and 8080.

[edit edit]

oh, and Chainmax:

in theory it's a simplified IVTC on the pixel level, but in reality it'll deinterlace parts that can be IVTC'd. it works spectacularly in conjunction with BlendBob though - it handles the black orphan field in the Eva renewal NTSC intro sequence perfectly! no blurring or anything.

so i'd say that Tdeint bobbing + blendbob + decimate will get you a pretty good IVTC. i'd prefer to use it as a fallback for that though.

my main interest is in pure interlaced and field-blended stuff.

Tritical: assuming the links work now, would you like some other samples? i've got a lot of crap DVDs lying around, and a small amount of home-shot DV footage.

__________________
sucking the life out of your videos since 2004

Last edited by Mug Funky; 15th September 2004 at 09:41.
Mug Funky is offline   Reply With Quote
Old 15th September 2004, 14:22   #12  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
I repeat my offer to post some samples from my Spawn DVD then.
Chainmax is offline   Reply With Quote
Old 15th September 2004, 18:46   #13  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
@Mug Funky
Yeah it worked this morning, I had to leave before they finished dling but they should be done. I have enough samples to mess with for now... was searching through some of the assorted clips I have and found a small vob piece of ranma ep 1 which is quite horrible and has blended fields .

@Chainmax
Thanks for the offer, but I have plenty of plain dvd type material... I was mainly interested in pure interlaced samples which I have none of other then a few very bad tv caps. About the other stuff... like Mug Funky said you could do an ivtc by following TDeint with decimate()... which would work with any deinterlacer. It would not be nearly as good as using a pure field matcher + decimate though if your video can be cleanly ivtced. This filter is just a pure and simple per-pixel, motion adaptive, deinterlacer as in kerneldeint, smoothdeinterlace, alignfields, etc... the main difference being that TDeint detects motion both backwards and forwards instead of just backwards.
tritical is offline   Reply With Quote
Old 15th September 2004, 20:45   #14  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,607
hey trictical!

great work!

now I have the ultimative bobber for my fieldblended crap.

many thanks.

edit:

and again: a request.

could you knock out the order-parameter?
tdeint should be able to detect the correct fieldorder itself by reading the avisynth fieldorder flags, which are set using AssumeTFF() and AssumeBFF().
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.

Last edited by scharfis_brain; 15th September 2004 at 21:22.
scharfis_brain is offline   Reply With Quote
Old 15th September 2004, 23:31   #15  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
tritical, the Spawn DVDs can be called everything but plain. Quoting Gizmotech:

Quote:
I have seen a vob sample of this cartoon from a friend.

The series contains real interlacing, as well as full frame blending (in spots).
You can read more about it in this thread (the clips posted in there are no longer online, BTW).


Anyway, I'm going to try TDeint's bobber along with BlendBob as soon as I can and report back.
Chainmax is offline   Reply With Quote
Old 16th September 2004, 03:01   #16  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
I downloaded your TDeinterlacer. Gives me an error message and I can't open VirtualDubMod anymore! How do I fix that?


AVISource("G:\0829 TV.avi")
Trim(94104,-389)

converttoyv12()
TDeint(order=FOrder())
converttoyuy2()
__________________
Tired of waiting for video encodes? Get a totally new P4 Desktop Computer for FREE.
joshbm is offline   Reply With Quote
Old 16th September 2004, 04:25   #17  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,547
you need to define Forder...

try it with just "order=1"

[edit]

oh, if you're using DV as a source, you should go "order=0" i think.

or use this to determine it:
Code:
#assumetff()
assumebff()

order = (last.getparity==true)? 1 : 0

tdeint(order=order)
unless you're making a customized function, there's probably not much need for all that, and a simple 1 or 0 would suffice.
__________________
sucking the life out of your videos since 2004

Last edited by Mug Funky; 16th September 2004 at 04:27.
Mug Funky is offline   Reply With Quote
Old 16th September 2004, 04:43   #18  |  Link
joshbm
Registered User
 
joshbm's Avatar
 
Join Date: Jun 2003
Location: Land of the Noobs & the Home of the Brave
Posts: 349
It works now lol. It was because I was working on a function and I didn't debug it yet and it contained errors. It was in the plugin folder and was trying to be loaded into VDubMod and AviSynth. Didn't work too well .

Thanks Though!
Josh
__________________
Tired of waiting for video encodes? Get a totally new P4 Desktop Computer for FREE.
joshbm is offline   Reply With Quote
Old 17th September 2004, 18:55   #19  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
I will make the filter use the internal parity if the user does not set the order parameter, and also add the option to read telecide's hints and set the field to 0 if the user does not specify it since telecide matches off the bottom field.

Been busy the last few days, but I should get a new version up this weekend with the above options, and a completed 5 field motion check which includes the 4 field distance checks to help with fades and motion adaptive related artifacts in general. That will of course make it even slower then it already is .

@Chainmax
Didn't realize it was so screwed up . If you do test out TDeint on it I would be interested in the results, but I'm not sure it would be much better then anything else if its a really bad source.
tritical is offline   Reply With Quote
Old 18th September 2004, 17:30   #20  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
I am uploading a 17MB Xvid clip. Here's the script I used on it:

TDeint(mode=1,order=1,mtnmode=1)
BlendBob()
Decimate(cycle=5,mode=2,quality=3)
Crop(8,0,706,480,align=true)
LanczosResize(640,480)


Once it's finished uploading, you can get it from here. If you want, I can also make some vob samples available as well.

Last edited by Chainmax; 27th November 2004 at 00:00.
Chainmax is offline   Reply With Quote
Reply

Tags
tdeint, tivtc

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:36.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.