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 26th April 2005, 23:45   #201  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
[link removed], changes from v1.0 beta 1:
Code:
   + Added modes -2 and -1... will upsize vertically by a factor of 2 using ELA or ELA2
   + Call SetCacheHints()
   + Some small optimizations, should give a very small speed up
Ok, no new features after this release... only changes will be bug fixes if any are necessary before v1.0 final here in a few days.

This doesn't mean the end of TDeint development for anyone who might be concerned (I am probably the only who qualifies)... v1.1 plans currently include adding motion compensation, though not in the usual way. TDeint is very modular, meaning each step is separated (motion map, linking, denoising, interpolating), which is part of the reason it is so slow, but which also makes it easy to add new interpolation types and intermediate steps. My plan is to add optional motion compensation as an intermediate step between motion map creation and interpolating. That is, use the current motion mapping to identify static areas, and then use motion compensation to try and get values for the pixels that are marked to be interpolated (moving). Any pixels that can't be recovered via motion compensation will then be interpolated as usual. Just imagine how slow that will be . However, that is a ways away... gonna spend some time on TIVTC now.

Last edited by tritical; 15th May 2005 at 00:33.
tritical is offline   Reply With Quote
Old 27th April 2005, 16:19   #202  |  Link
Marius-the-Mad
Registered User
 
Marius-the-Mad's Avatar
 
Join Date: Nov 2003
Location: Poland
Posts: 40
Quote:
Originally posted by tritical

This doesn't mean the end of TDeint development for anyone who might be concerned (I am probably the only who qualifies)...
No way. Tritical, your deinterlacer is just great. Thank you very much for it! I have some NIN videos here (from the new 'The Downward Spiral' remaster) and I don't know what I would do with them without TDeint.

In other words: thanks a lot!

Last edited by Marius-the-Mad; 27th April 2005 at 16:22.
Marius-the-Mad is offline   Reply With Quote
Old 27th April 2005, 17:23   #203  |  Link
warath
Registered User
 
Join Date: Mar 2005
Posts: 24
Aye, I love your TIVTC, works wonders on my Star Trek backups!
warath is offline   Reply With Quote
Old 9th May 2005, 00:08   #204  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 5,955
Due to the recommendation of scharfis_brain, I just tested TDeint 1.0b2 on the VQEG (PAL) test samples, where many deinterlacers clearly show flaws (e.g. KernelDeint leaves "stripes" of not deinterlaced, or even apparently totally unrelated, content). We discovered that even TDeint hat to fight hard here, I had to lower the "AP" parameter even below 10 to suppress such artifacts; even at AP=5, there are still some hints of stripes visible, especially in the part 08 with the scrolling text, when the background liquidly waves forth and back.
LigH is offline   Reply With Quote
Old 9th May 2005, 03:07   #205  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
Is there a link where I could get those test sequences? Or what is the name of the part 08 sequence? Anyways, from your description it sounds like standard motion adaptive artifacting. Setting AP at 5 you almost might as well do a dumb bob.... though there isn't really anything you can do to prevent motion adaptive artifacts besides turning to a spatial combing metric. Out of curiosity, were you testing by viewing deinterlaced clips during playback or single frames in vdub?
tritical is offline   Reply With Quote
Old 9th May 2005, 03:18   #206  |  Link
MacAddict
XviD User
 
Join Date: Oct 2004
Location: Ky
Posts: 190
Impressive results here with Tdeint doing a typical deinterlace film. I'm thinking of using it full-time in place of KernelDeInt now. Many thanks for your effort tritical!
__________________
DFI NF4 SLI Expert | Opteron 165 CCBBE 0616 XPMW (9x325HTT=2.9Ghz) | 2x1GB G.Skill HZ (3-4-4-8-12-16-2T) | LG 62L DVD/CD | Geforce 7300GT | All SATA | Antec 650 Trio PSU | XP SP2
MacAddict is offline   Reply With Quote
Old 9th May 2005, 06:00   #207  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
@Marius-the-Mad, warath, and MacAddict
thanks for the comments .

@LigH
I found a place to get those sequences and downloaded sequence 8. It is definitely a killer for a motion adaptive deinterlacer.
tritical is offline   Reply With Quote
Old 9th May 2005, 11:37   #208  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 5,955
I once downloaded all the PAL sequences (1 .. 10). A few are progressive (#1 is even a "long still" - but e.g. QuEnc gets crazy about that content), but most are interlaced.

scharfis_brain told me, especially "short shutter" material is hard to compensate, because such algorithms seem to rely on the last bit of motion blur during one field. And computer generated frames often have a duration of 0, not (near) 1/fps seconds - no motion blur at all.

Another "killer" is the "rugby game" (#9), which might also have short shutter, and in #6 - Formula 1 - scharfi told me about possible flaws in the { hoarding | perimeter advertising } ("FOSTERS").

Here a short overview over the VQEG sequences:

ftp://ftp.crc.ca/pub/crc/vqeg/TestSequences/Reference/

1: Tree (25p, long still)
2: Stadium (50i)
3: Harping (50i)
4: EBU Ant (50i, CG)
5: Kayak (50i)
6: Formula 1 (50i) -- btw: M. Schumacher does fail sometimes...
7: Fastfood (25p)
8: Scroller (50i, CG)
9: Rugby (50i; short shutter?)
10: Toy train (50i)

If someone prefers, you may add NTSC clip descriptions here, too. But unfortunately, the download there is sloooowwww (and the files are huge, because they are plain UYVY).
__

Okay - just downloaded the NTSC files, too:

13: Fun fair (TC)
14: Skyscrapers (60i)
15: Toy train (60i - similar to 10)
16: Jungle (30p, CG)
17: Letters (2x15p)
18: Waterfall (60i?)
19: Football (60i)
20: Sailing ship (? - too less motion)
21: Blonde@phone (60i)
22: Flowers+leaves (60i)

Last edited by LigH; 9th May 2005 at 13:34.
LigH is offline   Reply With Quote
Old 9th May 2005, 20:51   #209  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
Yep, that was the site I eventually found. Sequence 6 I got and tested and it suffers from the same thing, the motion of the FOSTERS sign occurs at just the right rate/frequency that each field appears stationary on a single pixel level. Increasing the length of the static area detection from 5 to 6 fields could help, but wouldn't eliminate all artifacts, would be slower, and would sacriface some true static areas. I am still playing with the idea that in a majority of these cases, especially with the FOSTERS sign, most of the artifacts occur in areas where a majority of the pixels are correctly detected as moving and thus interpolated. Perhaps a dilation type operation on the motion map, or an AP mode where it identifies pixels with an ap value over the threshold and a majority of the pixels inside a window around it are set to be interpolated could help. Or perhaps overlapping block based static area detection. Will have to think about it some more, those samples are definitely nice for testing... thanks for mentioning them.
tritical is offline   Reply With Quote
Old 10th May 2005, 22:55   #210  |  Link
rkk44
Registered User
 
Join Date: Feb 2005
Posts: 5
TIVTC 0.9.8.5 Mode 5 Error

Dear Tritical,

I cannot get TIVTC 0.9.8.5 to work in mode 5. Here is the pertinent portion of my script (based on your examples) that deals with TIVTC:

V=mpeg2source("c:\sg1614.d2v",cpu=4,idct=7,ipp=true).assumetff()
A=MPASource("c:\sg1614 MPA T01 DELAY 0ms.mpa",normalize=false).BufferAudio()
AudioDub(V,A)
ConverttoYV12(true)
clp=last.rgbob().selecteven() #Bob Deinterlace then 60 => 29.97 fps
tfm(pp=4,clip2=clp,output="matches.txt")
tdecimate(mode=4,output="metrics.txt")
tfm(pp=4,clip2=clp,input="matches.txt")
tdecimate(mode=5,hybrid=2,vfrDec=0,input="metrics.txt",tfmIn="matches.txt",mkvOut="mkv-timecodesfile.txt")


When I try to run this in VDubMod it gives me the following error:

"Tdecimate: Input Error: Mode 5 -- All Frames Must Have Entry"


However, if I replace the above "TFM/Tdecimate" script with clp.tdecimate(mode=2,vfrDec=0) it works. I also tried directly replacing the clip2 with the d2v but I get the same error.

Thanks for any help which you can provide.
rkk44 is offline   Reply With Quote
Old 11th May 2005, 00:45   #211  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
I guess it is not that clear in the documentation, but for mode 5 it needs all the stats so it can calculate everything at the beginning, which means two passes need to be made. In the first pass use/run this script:

mpeg2source("c:\sg1614.d2v",cpu=4,idct=7,ipp=true)
assumetff()
converttoyv12(true) <= is your source 4:2:2?
clp = last.rgbob().selecteven()
tfm(pp=4,clip2=clp,output="matches.txt")
tdecimate(mode=4,output="metrics.txt")
crop() <= change this to crop the image down to 32x32 or 16x16 to speed things up

That pass is only to allow tfm/tdecimate to gather the needed info (i.e. create the output files), so the actual video output of that pass doesn't matter.

Then on the second pass use:

V=mpeg2source("c:\sg1614.d2v",cpu=4,idct=7,ipp=true).assumetff()
A=MPASource("c:\sg1614 MPA T01 DELAY 0ms.mpa",normalize=false).BufferAudio()
AudioDub(V,A)
ConverttoYV12(true)
clp=last.rgbob().selecteven() #Bob Deinterlace then 60 => 29.97 fps
tfm(pp=4,clip2=clp,input="matches.txt")
tdecimate(mode=5,hybrid=2,vfrDec=0,input="metrics.txt",tfmIn="matches.txt",mkvOut="mkv-timecodesfile.txt")

If you are encoding to a loseless file first there is a one pass vfr mode (mode 3), but it will not have the correct # of frames.

Even though the above process requires two passes it can all be set up in vdub's job control to execute at once. That is, load the first script and save it to job control then load the second script and save it. You will need to add the parameter batch=true into the tdecimate() line of the second script for tdecimate to allow it.

However, I think vdub's avi handling has been changed somewhere along the line so that if you load a script once and save it to job control, and then run the process later, while having altered the script to return a different number of frames then when you originally loaded it, vdub still sets the frame count to that of when the script was first loaded. That means loading both scripts at once into job control wont work, because the first time you load the second script tdecimate uses junk info and the framecount is not the same (it will be less) as when it gets loaded later with the real info. I'm not sure exactly which versions of vdub do that (v1.6 does, and probably v1.5.10, not sure about v1.5.4/v1.5.1), but I still use a rather old version of vdubmod (v1.4.13.2) and it works fine.

Not sure if all of that made sense, it is rather difficult to explain easily.

Last edited by tritical; 11th May 2005 at 00:49.
tritical is offline   Reply With Quote
Old 11th May 2005, 21:17   #212  |  Link
rkk44
Registered User
 
Join Date: Feb 2005
Posts: 5
Tritical,

Thanks for the help. That did the job.

[Just for your information, I am using VDubMod (VDub) Build 1.5.10.]
rkk44 is offline   Reply With Quote
Old 15th May 2005, 00:32   #213  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
Alright, I lied about no new features in TDeint. After testing on those VQEG sequences I decided to add two new AP post-processing modes that take motion of surrounding pixels into account and allow for low AP values w/o completely sacrificing static areas or reverting to a plain spatial deinterlacer.

Specifically, sequence 6 (racing w/ fosters sign) is handled much, much better with TDeint(type=3,AP=7). Sequence 8 is tougher but most of the major (visible) artifacts are removed while leaving the logo intact using something like TDeint(type=3,link=3,AP=7,APType=2).

Complete changes:
Code:
05/14/2004  v1.0 beta 3
  + Added APType parameter, adds 2 new AP post-processing modes that take surrounding 
        motion into account
  + Small changes (hopefully improvements) to type 3 (ELA-2) interpolation
TDeint v1.0 beta 3

EDIT: there was a little off by one loop bug in the AP pp routine.. updated the zip archive with a fixed version.

Last edited by tritical; 15th May 2005 at 04:36.
tritical is offline   Reply With Quote
Old 15th May 2005, 15:21   #214  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
there seems to be some horizontal (!!) artefacts showing up with "TDeint(1,1,type=3,link=3,AP=7,APType=2)".

i'll try narrow it down a little... right now it's happening on an NTSC anime sample (the ADV trailer for "cromartie high school").

[edit]

my apologies... it's in the source. now THAT's weird.

i can anticipate this series giving deinterlacers hell though - all the characters have thin horizontal lines as shading - it flickers like hell on an NTSC TV.
__________________
sucking the life out of your videos since 2004

Last edited by Mug Funky; 15th May 2005 at 15:24.
Mug Funky is offline   Reply With Quote
Old 15th May 2005, 15:28   #215  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,607
Mug Funky, would you like to show me a short sample?
(cannot imagine how that should look like)
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 15th May 2005, 15:55   #216  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
sure. i'll send you the trailer if you PM me your Gmail (if you got it...)

[edit] oh. it's over 60 megs... maybe i'll just cut the start bit out
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 15th May 2005, 16:37   #217  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,607
this kind of flickering seems to be caused by bad interlaced scaling and rotating of this letter.
so the characters became more flickery.
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 18th May 2005, 11:01   #218  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
And another new version... [link removed]. Finally got the new mode 2 added to tdecimate. It is definitely a different approach to arbitrary decimation. It works by applying a series of M-in-N decimations that recursively minimize the error to the required ratio, ensuring decimation is evenly spread throughout the video. Its behavior is controlled with 3 settings. "rate", which sets the decimated output rate as before, "maxndl", which controls how much non-uniformity is allowed in the decimation (for dealing with clips with uneven duplicate distribution), and "m2PA", which removes the default 100 frame look ahead restriction and allows tdecimate to look as far ahead as needed (that enables it to produce the same results as if the metrics were available from an input file).

Anyways, I have not gotten to extensively test it so if anyone finds clips/settings that make it crash, blow up your comp, or do other weird things please report . It should deal well with clips that regular M-in-N decimation usually doesn't, especially clips that do not have uniform duplicate distribution (as long as maxndl is tweaked to fit the requirements).

Complete Changes:
Code:
TDecimate:
   + First cut at new mode 2 operation.
   + Added maxndl/m2PA parameters, go with mode 2.

Last edited by tritical; 24th May 2005 at 11:52.
tritical is offline   Reply With Quote
Old 20th May 2005, 20:08   #219  |  Link
MOmonster
Registered User
 
Join Date: May 2005
Location: Germany
Posts: 495
first of all, sorry for my bad english. Iīm new to these things and donīt speak it so often.
Iīlive in germany and all my interlaced material seems to be bad telecined. I tried some filter combinations, like matchbob with unblend and fdecimate or for matchbob the doubletelecide function with tfm(mode=2, pp=7) and also one time restore24, but all these functions and combinations have big disadvantages. First of all, the speed, but also the accurate deblending and the right decimating isnīt a small problem. Of course tfm and telecide are fantastic filters, but for such weird material we have to live with such functions till now.

Tritical, if you could implement such features in your TIVTC, it should work also great for bad telecined material.
Please read this text and also tell me my mistakes.

Last edited by MOmonster; 22nd May 2005 at 12:37.
MOmonster is offline   Reply With Quote
Old 20th May 2005, 20:33   #220  |  Link
MOmonster
Registered User
 
Join Date: May 2005
Location: Germany
Posts: 495
Oh, sorry, here is the text:

Code:
Before I will explain how these features should work, I give you four 
points, that say us how the material has to be, that the feuture could
work:

1.	If 1, 2, 3... are the frames, a1, a2, a3... are the 
	top-fields and b1, b2, b3... are the botton-fields, there 
	shouln`t be a match from b2 and a1 (for top-field first), 
	because b2 would step back in movement. (no float pictures)

2.	a blending-field should be between to clear fields 
	(between the both source-fields for the blending), becouse
	otherwise it wouldn`t be possible to detect the blending.

3.	If a 0-step means the step between two matching fields, 
	a 1-step is the step of a whole frame and a 0.5-step is 
	the step between a clear and a blended field, there 
	shouldnīt be a 1.5-step in the source (because of point two)

4.	Between two matchings (0-steps) there should be only one 
	(max.) full step (1-step) between two fields, otherwise 
	audio and video	would be asynchron.

Ok, somebody could say, that for his source this four points 
arenīt all right, but for this source also restore24 shouldnīt 
work correctly.

Now I try to explain how this noblend-feature could work 
(for top-field first).

	All posible matchings in a source should be found, just by 
	trying to match the top-field (or botton-field, depends on 
	the parity) with the previous and the next field. All other
	searchings for matching should be useless (so, TFM(mode=0) 
	should be enough, I donīt know for what the 4. and 5. way 
	are, maybe as debugger for a wrong parity of some frames, 
	but should be normally useless). But mode=0 is not enough 
	for bad telecined material. Let me explain:
	If there is a c-match in frame 1, a2 could be a 
	blending-field.	In this case it would be good to look for 
	a match for b2 with the	next field.

		a1	a2(b)	a3	a4...
		l	     /
		l	    /
		b1	b2	b3	b4...

	match:	c	     u


	But this is only useful after a c-match (not after a p-match).

	And now to the bigger problem. A frame has no matching-fields. 
	Itīs time for the postprocessor! But what field should be 
	choosen for postprocessing. We have to find out what fields 
	are clear and what are blends. There are many methods for 
	detecting blends. We could compare the number of edges, the 
	complexity, the number of colours or for example the 
	sharpness. Also we can do like unblend, but all these methods 
	arenīt accurate enough or just need to much time.
	I thought about a method, that use the possibility of a 
	matcher and that should solve this problem. So easy it sounds, 
	so good should it work.

	To detect a field as blended (or not), we just blend the both 
	fields around together and try to match this new field with 
	the tested field. If both fields really match, the tested 
	field is blended.
	This is the theory.
	To make it more practicable, we just have to test both fields 
	after the last possible match. The clear field is the field 
	where the match results in more combing than the other.

	I try to make it more clear with some examples:

	A.	a1	a2	a3(c)	a4	a5...
		     /			l
		    /			l
		b1	b2(b)	b3(b)	b4	b5...

	match:	        p		c

	
		1.	frame 3 gives no c- or p-match 
			(u is unneccessary, because of the p-match)

		2.	less combing for matching b2 with blend of a2 
			and a3

		3.	more combing for matching a3 with blend of b2 
			and b3,	so a3 should be	reproduced.

	B.	a1	a2	a3(b)	a4	a5...
		     /		     /
		    /		    /
		b1	b2(c)	b3	b4	b5...

	match:		p		p

		1.	frame 3 gives no c- or p-match 
			(u is unneccessary, because of the p-match)

		2.	more combing for matching b2 with blend of a2 
			and a3

		3.	less combing for matching a3 with blend of b2 
			and b3,	so b2 should be	reproduced, through 
			it is a field of frame 2.

	C.	a1	a2	a3(c)	a4(b)	a5...
		     /		     	     /
		    /		    	    /
		b1	b2(b)	b3(c)	b4	b5...

	match:		p			p

		1.	frame 3 gives no c- or p-match 
			(u is unneccessary, because of the p-match)

		2.	less combing for matching b2 with blend of a2 
			and a3

		3.	more combing for matching a3 with blend of b2 
			and b3, so a3 should be	reproduced.

		4.	also frame 4 gives no c- or p-match

		5.	more combing for matching b3 with blend of a3 
			and a4

		6.	less combing for matching a4 with blend of b3 
			and b4, so b3 should be	reproduced.

	D.	a1	a2(b)	a3(b)	a4(c)	a5...
		l     		     	l    
		l    		    	l   
		b1	b2(c)	b3(c)	b4	b5...

	match:	c			c

		1.	frame 2 gives no match (also no u-match)

		2.	less combing for matching a2 with blend of b1 
			and b2

		3.	more combing for matching b2 with blend of a2 
			and a3,	so b2 should be	reproduced.

		4.	also frame 3 gives no match (also no u-match)

		5.	less combing for matching a3 with blend of b2 
			and b3

		6.	more combing for matching b3 with blend of a3 
			and a4, so b3 should be	reproduced.

There could be much strange pattern in bad telecined material, but 
with such a feature TFM should be able to reproduces also such weird 
material. Iīm no coder and knowledge about the functions and filters 
of avisynth is to bad, to be able to create a function, that would 
enable this feature. It would be great, if you could implement such 
a thing in your filter, tritical.
The advantages over restore24, matchbob, doubletelecide and so on 
are clear. It would be really faster and should be a bit more 
accurate against blends.


And there is also an other feature for your tdecimate.
If the tfm would have the possibility to tell tdecimate, what matched 
frames use a same field, for example if after a c-match follows a 
p-match. This could be possible for example with the hints 
(an use_hints option for tdecimate).
With such an option tdecimate could work a lot faster, if there 
are given enough frames for decimating. And tdecimate should also work 
better, because it would prefer these frames more then other, what 
maybe are doubled just because of no motion.

It would be great, if this text could help you to tweak your 
fantastic filters.

Last edited by MOmonster; 21st May 2005 at 13:09.
MOmonster 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 16:53.


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