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 8th April 2007, 02:21   #981  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
You just have to try it and see which you prefer, as every interpolation method (edge-directed or not) has it own good points and bad points. If you want to look at individual frames than eedi2 will usually look better (especially if there are high contrast diagonal lines/edges), but it also has worse compression (usually) and worse temporal stability (not really the correct term, but not sure what to call it). Also, since interpolation will mainly be used in moving areas, which people are less sensitive to during normal speed playback, the benefits of edi may not be that great. kernel interpolation will also tend to look better in areas falsely detected as moving or in very slow moving areas.

The other thing you have to consider, if you are encoding the result and have size requirements, is the compressibility of the output. A deinterlacer that looks great but whose output is much harder to compress will have to suffer more distortion to reach the same file size as the output of a deinterlacer that is more compressible.

I did some tests using two sources, the first combined srcs 3/6/8/9/10 from http://media.xiph.org/vqeg/TestSeqences/Reference/, and the second was just src 20 (from the same place) by itself. I bobbed both clips with a number of deinterlacers, and then encoded the result with xvid at constant quant 2 using my usual settings (motion 6, vhq 4, chroma motion, bframes: 1/1.5/0.75, no qpel or gmc, h.263). The results were:
Code:
deinterlacer      - Size (KB)  Time (Min:Sec)

source 1:
bob               - 124,449   8:02
securebob(type=2) - 133,936   8:46
tdeint+tmm        - 136,485  11:39
tdeint            - 139,728   9:24
tdeint+tmm+eedi2  - 142,171  32:00
securebob(type=3) - 144,748  30:08
tdeint+eedi2      - 146,589  30:21
leakkernelbob     - 148,618   8:21
tomsmocomp(x,5,0) - 162,642   7:59
yadif(mode=1)     - 162,672   8:35
yadif(mode=3)     - 164,219   8:34
dgbob             - 185,154   9:13

source2:
tdeint+tmm        -   8,975   1:53
tdeint+tmm+eedi2  -   9,386   6:40
yadif(mode=3)     -  11,812   1:19
yadif(mode=1)     -  13,271   1:20
securebob(type=2) -  13,746   1:22
securebob(type=3) -  14,579   6:10
leakkernelbob     -  16,663   1:15
tdeint            -  17,253   1:24
dgbob             -  18,616   1:17
tomsmocomp(x,5,0) -  20,437   1:19
bob               -  21,637   1:23
tdeint+eedi2      -  21,875   6:11
The first source was pretty much all motion (except for the scrolling text sequence which is stationary apart from the text, which takes up probably 1/4 of the frame). The second source is almost completely stationary, but does have some noise (TDeint would require mthreshL of about 14 to handle it well). I did the tests on my laptop which has a 1.6 Ghz Pentium M and 1 GB of PC2700.

Last edited by tritical; 8th April 2007 at 03:05.
tritical is offline   Reply With Quote
Old 8th April 2007, 23:53   #982  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
Thanks for those figures, tritical. Makes things easier around here. Looking forward to improvements to tMM
canuckerfan is offline   Reply With Quote
Old 10th April 2007, 02:36   #983  |  Link
ChiDragon
Registered User
 
ChiDragon's Avatar
 
Join Date: Sep 2005
Location: Vancouver
Posts: 600
tritical, Fizick's Yadif plugin doesn't create artifacts on that clip I sent you when the "spatial interlacing check" is enabled. Do you know if this is just the equivalent of enabling "AP" in TDeint, or something else?
ChiDragon is offline   Reply With Quote
Old 10th April 2007, 06:42   #984  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
Roughly speaking, it is. The thing about yadif is it works sort of in the opposite direction than tdeint. It starts with a spatial prediction (interpolated value) and then limits that value to be within p2 + diff and p2 - diff, where p2 is the temporal prediction (weaved value) and diff is (again roughly speaking) a measure of local temporal change or complexity (for mode = 0/1). If there are no temporal changes then you end up with p2, the more temporal change there is the more likely it is you will just get the spatial prediction value back out. Using only the temporal differences to generate the 'diff' value makes yadif as susceptible to motion-adaptive artifacts on repeated patterns as any other motion-adaptive deinterlacer with a 5-field check. On the other hand, it is less susceptible to residual combing because in such cases, the diff value will exceed the difference between the spatial prediction and the weaved value (which in the case of soft residual combing, such as on a fadeout, is usually < 4) and you'll just get the spatial prediction value (or close to it).

When you switch to mode 2/3 diff is also based on local, vertical spatial complexity between the current field and the temporal predictions of the current line and the above/below lines in the opposite parity field. Basically, that means diff will also be based on how large of a vertical gradient weaving will create (that is maxed with the temporal diff calculation). Therefore, areas that would experience the types of artifacts you get from incorrect weaving will have a large diff value and you'll get the spatial prediction value. The downside is that true static areas with lots of detail (specifically those with large vertical gradients) will no longer be weaved. This is pretty much exactly what 'AP' in tdeint accomplishes.

EDIT:

I actually find the idea behind yadif quite interesting, but the major drawback IMO is the edi method it is uses is overly prone to artifacts. It uses the typical two sliding window method which is highly likely to choose the wrong direction around anything more than a single, thick, lone edge. Every other filter/program that I know of that uses this method caps the output value to be within +-2 or 3 of the min/max of the vertical neighbors to prevent major artifacts. Just to see what would happen, I created a c only version with such capping and to me it looked much better. I also made it possible to take spatial predictions from an external clip. I have some results here: deinterlace_comparison.txt from a comparison I am working on, which I think show the benefits.

I have also been thinking of testing out a filter that would take tdeint's output, along with it's motion-map, and then limit only the interpolated values using the same method as yadif, and I am still working on a new interpolation method that should give edi benefits without taking hits in psnr/ssim as most edi methods do now. Although, that project has been on going for almost 9 months now so it could still be a while.

Last edited by tritical; 10th April 2007 at 07:10.
tritical is offline   Reply With Quote
Old 11th April 2007, 06:13   #985  |  Link
AVIL
Registered User
 
Join Date: Nov 2004
Location: Spain
Posts: 408
Hi:

I've tested Tdeint and Yadif in a very noisy video. Yadif have less jagged edged but more orphan pixel type artefacts. I prefer Tdeint results.

To eliminate all the residual combing (my main problem with tdeint) i've setted mtqL, mthL, mtqC and mthC to zero.

IMHO the sole thing it rests is fight against the aliased edged. But, anyway , I am very pleased whith the last addition.

Thanks.
AVIL is offline   Reply With Quote
Old 15th April 2007, 20:42   #986  |  Link
swaaye
Registered User
 
Join Date: Jun 2004
Posts: 144
Does TIVTC use SSE2 on Core 2 CPUs? I ask because it says P4 only in the changelogs.
swaaye is offline   Reply With Quote
Old 15th April 2007, 21:05   #987  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
It uses SSE2 instructions if your CPU supports them. So the answer to your question is : yes.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 15th April 2007, 22:20   #988  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
I changed it a little while ago, must have not added it to the changelog. It requires either:

1.) family code = 0xF
2.) family code = 0x6 and model number = 0xF or 0xE

So pretty much the only models excluded are pentium M/celeron M. I have those use iSSE/MMX as testing with my laptop (pentium M) showed it was slightly faster. Of course, you can force tivtc to use sse2 via the 'opt' parameters of tfm/tdecimate.
tritical is offline   Reply With Quote
Old 15th April 2007, 23:29   #989  |  Link
ChiDragon
Registered User
 
ChiDragon's Avatar
 
Join Date: Sep 2005
Location: Vancouver
Posts: 600
tritical, could you please add TFM hints to TDeint with tryweave=true? I think it would make it a lot more clear what TDeint(mode=1,tryweave=true) is doing when followed by TDecimate(display=true) for videos with weird orphan field pulldown patterns.

EDIT: Actually, I guess what I'd really like is an output file that could be read with TDecimate's tfmIn option, since these patterns are part of large cycles.

Last edited by ChiDragon; 16th April 2007 at 00:37.
ChiDragon is offline   Reply With Quote
Old 19th April 2007, 18:24   #990  |  Link
Asrial
Registered User
 
Join Date: Aug 2003
Posts: 105
Tritical, did you get my e-mail about the problem I encountered with video sections being decimated in the later versions?
Asrial is offline   Reply With Quote
Old 19th April 2007, 20:03   #991  |  Link
swaaye
Registered User
 
Join Date: Jun 2004
Posts: 144
I have a source that is identified by DGIndex as 100% video, but it still reacts favorably to an IVTC. This is a USA TV show and I did a frame by frame analysis manually to check the frame order and it is definitely telecined.
swaaye is offline   Reply With Quote
Old 20th April 2007, 02:01   #992  |  Link
ChiDragon
Registered User
 
ChiDragon's Avatar
 
Join Date: Sep 2005
Location: Vancouver
Posts: 600
swaaye... no offense, but what is your point? DGIndex's report about 100% video is just based on the lack of pulldown flags (i.e. it's ENCODED as video rather than film, not that the source itself wasn't telecined from film).
ChiDragon is offline   Reply With Quote
Old 20th April 2007, 06:48   #993  |  Link
swaaye
Registered User
 
Join Date: Jun 2004
Posts: 144
Didn't know if you knew of that possibility.
swaaye is offline   Reply With Quote
Old 20th April 2007, 21:41   #994  |  Link
canuckerfan
Registered User
 
Join Date: Jul 2005
Posts: 317
tritical, how's tMM development coming along? I'm looking forward to the speed improvements
canuckerfan is offline   Reply With Quote
Old 20th April 2007, 23:37   #995  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
@ChiDragon
I can do that.

@Asrial
I did, but I haven't gotten to it yet. I will though.

@swaaye
That scenerio is pretty much the norm in R1 anime. Though pretty rare as far as most movies goes.

@canuckerfan
It hasn't gone anywhere so far. I'm busy with work and school again. However, there really isn't a whole lot of optimization that can be done aside from making it multi-threaded and better internal caching.
tritical is offline   Reply With Quote
Old 21st April 2007, 12:54   #996  |  Link
ChiDragon
Registered User
 
ChiDragon's Avatar
 
Join Date: Sep 2005
Location: Vancouver
Posts: 600
For now at least I've found that this seems to do the same job as TDeint(mode=1,tryweave=true) except that it gives hints:

Code:
Interleave(TFM(mode=0,slow=2,micmatching=0,PP=7),SeparateFields().Trim(1,0).Weave().TFM(mode=0,slow=2,micmatching=0,PP=7))
AVSTimer even shows it running at the same speed. Of course there's no way to get a useable output file for tfmIn from that so a real option would be preferable.

EDIT: Hmm... I'm attempting to use the above code with TDecimate(cycleR=2,cycle=4) before another TDecimate call so that I can use smaller cycles and sdlim with the second one. The first one detects and uses hints while the second doesn't (forcing hint=true doesn't help either). Shouldn't the first one be preserving the hints? I'm using v1.0.1.

EDIT 2: Darn, TDecimate(cycleR=2,cycle=4) doesn't quite work right for this anyway. It drops an extra frame for a cycle like this:

Z | A B | C
Z | A C | C

(frames on x, fields on y)

Last edited by ChiDragon; 22nd April 2007 at 06:27.
ChiDragon is offline   Reply With Quote
Old 23rd April 2007, 22:34   #997  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
Version 1.0.1 of TIVTC (no idea about earlier) seems to have a bug when TFM's d2v argument is used with mpeg2dec3 and dvd2avi 1.77.3.

Whenever I try to use it it says:

TFM: d2v frame count does not match filter frame count (1968 vs 1966)!

or similar where the difference in the number of frames always seems to be 2 in all tested files. If I use dgmpgdec 1.4.9b17 it works properly with all files.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now   Reply With Quote
Old 23rd April 2007, 23:08   #998  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Quote:
Originally Posted by Myrsloik View Post
mpeg2dec3 and dvd2avi 1.77.3.
Why would you do such a thing to yourself.
foxyshadis is offline   Reply With Quote
Old 24th April 2007, 01:13   #999  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
@ChiDragon
TDecimate currently destroys tfm hints on output (it preserves dgdecode hints, i.e. colorimetry). The hints from tfm don't really make sense after tdecimate has removed frames. What hint information would still be relevant?

@Myrsloik
The 2 frame difference is due to the following reasons (taken from neuron2's dgmpgdec page):
Quote:
2.) MPEG2DEC cuts two frames from the frame count as a workaround for 3 below. This is a kludgy hack that should not be necessary. Thus, thanks to this and 1 above, 3 frames will always be lost. They are lost at the end.

3.) If the opening GOP has B frames before the first P frame (IBBPBBP...), then DVD2AVI generates an incorrect D2V file, in which the first digits for the orphaned B frames and some remaining digits are written out of place. Also, MPEG2DEC cannot decode the B frames prior to the first P frame, and so discards them. A number of frames will be lost equal to the number of B frames prior to the first P frame. They are lost at the beginning.

So, for example, if you process a VOB that has an IBBPBBP... opening GOP, you will lose a total of 5 frames, with 2 lost at the start and 3 lost at the end.

In addition to the lost frames, MPEG2DEC does not implement random frame access correctly. In fact, it always throws away the first B frames in the GOP prior to the first P frame. If they are (say) frames 12 and 13 (in display order) and you try to seek to 12, MPEG2DEC will toss them and return frame 14 to you, without any warning or indication about it.

Finally, when 3 above applies the TFF/RFF flags in the D2V file are misaligned to the frames.
Specifically, the part about mpeg2dec3 subtracting 2 from the d2v frame count as a workaround for 3. You might be able to work around this using tfm's trimIn() option, but I wouldn't trust anything other than flags=3 (which doesn't require matching frame counts) with d2v files generated by 1.77.3. Especially due to the tff/rff flag to frame misalignment problem. I'm with foxyshadis, why use dvd2avi 1.77.3+mpeg2dec3?

Last edited by tritical; 24th April 2007 at 01:16.
tritical is offline   Reply With Quote
Old 24th April 2007, 01:38   #1000  |  Link
ChiDragon
Registered User
 
ChiDragon's Avatar
 
Join Date: Sep 2005
Location: Vancouver
Posts: 600
Well I use TDecimate's display mode with TFM's hints to see what both filters are doing, but I guess I understand if keeping them in would interfere with the second decimation.
ChiDragon 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 19:24.


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