View Full Version : Understanding IVTC
STaRGaZeR
26th November 2009, 01:23
As the title says, I'm trying to understand some (I think basic) things about IVTC, when the source clip is hard telecined, 23.976 with hard 3:2 pulldown to 29.97. As far as I know, telecine is regularly done, that means it always follows the same 3:2 cadence. Then why complex avisynth filters are needed? Why do they have so many options for IVTC, and why most of the time they screw up the image so bad, specially in fades or high motion scenes?
If I correctly understand the process, the only thing that should be done is discard repeated fields and combine fields that came from the same frame but are put into the extra frame to accomplish 23.976-->29.97 in a regular patter, this pattern is always the same if the clip has only hard telecined film content and not both film and video content (hybrid). If the sequence is always the same, why the need of prediction, matching, etc. with different fields, with the consequent disaster that happens most of the time when fields are incorrectly matched?
The goal is to have a perfect IVTC filter for real time usage with hard telecined film content, no hybrid, and if it doesn't require avisynth the better. I just don't know how to configure the existing filters to do what I want. ffdshow anyone?
http://upload.wikimedia.org/wikipedia/en/thumb/8/8c/32pulldown.svg/314px-32pulldown.svg.png
Take 5 frames of the hard telecined source (ABCDE), then do the following to get frames 1234 of the IVTC'ed result:
1- Frames A and B will be frames 1 and 2. Just display them as they come.
2- Take the top field of frame D, put it in the top field of frame 3.
3- Take the bottom field of frame C, put it in the bottom field of frame 3.
4- Frame E will be frame 4.
Since the source always follows this ABCDE sequence, if the filter follows these steps it should get the original 23.976 progressive content, right?
Guest
26th November 2009, 01:44
it always follows the same 3:2 cadence That's the fly in your ointment; it's false. Numerous legitimate as well as pathological operations change the phase of the pattern, the most obvious being edits that are not always made on exact cycle boundaries.
You must think the IVTC filter writers are stupid. Have you actually looked at a range of real samples out there?
The problem is detecting and locking onto the pattern phase, and then adjusting to changes in phase. If you think it is so easy, please write a filter or, at least, describe your algorithm so that it can be implemented. And don't try to slide past with something like "find the matching fields"! That is not a trivial matter when you have to deal with static scenes, noise, very small movements, etc.
For the rare cases where you have a fixed phase throughout, you don't need an adaptive filter. You can use basic Avisynth operations as described on the Wiki. E.g.,
separatefields()
selectevery(10,0,1,3,4,5,6,8,9)
weave()
But you'd better get the field order right and pick the right starting phase.
The complex filters are designed to deal as well as possible with the things that deviate from pure constant-phase pulldown: edits, noise, hybrid content, video alpha-blended with 3:2 film, orphaned fields, etc., as well as relieving the user of the burden of having to set the phase at every point in the stream where it changes.
STaRGaZeR
30th November 2009, 23:45
Sorry for the late reply, with the IP change I was unable to enter the forum, but today I found it ;)
Of course I don't think IVTC filter writers are stupid. That would be an insult, and it's obviously not true. That's why I put this thread in the newbs section.
I've been playing with SeparateFields and SelectEvery. I've found things I didn't know before. In fact the samples I considered to have fixed phase have resulted in constant phase changes. Almost always at scene changes. With this script:
AssumeTFF()
SeparateFields()
SelectEvery(10,0,1,2,3,6,5,8,9)
Weave()
Which I think does the same I described in my first post, by seeking to A in a group of ABCDE frames. AssumeTFF() was necessary. Perfect IVTC, until a scene change happens, and consequently a phase change too. If not stopped, IVTC will eventually work again when an A frame falls into the first frame of the 5 (10 fields) set with SelectEvery, until a new scene change. It seems I'm only dealing with phase changes here. Reading more into Decomb and TIVTC I've used these scripts:
tfm(mode=5,PP=0) (tried different modes)
tdecimate(mode=0)
and
Telecide(guide=1,post=0) (tried with guide=0 too)
Decimate(quality=3)
Both, sooner or later, will output combed frames at those scene changes. Postprocessing is turned off on purpose, to see the efectiveness of the field matching. I'm not sure if there are orphaned fields or something awful like that. I'm using very clean, 1080i anime to test, since it seems to be the most extreme case I have. I can't find errors with real life footage. Do you have any recommendations for this case?
Finally, some questions. Why the phase changes? Why at scene changes? Any logic behind this?
Guest
30th November 2009, 23:59
I'm not sure if there are orphaned fields or something awful like that. There are probably orphaned fields. You can inspect the video, you know. :)
Do you have any recommendations for this case? If you mean orphaned fields, then turn postprocessing back on.
Finally, some questions. Why the phase changes? Why at scene changes? Any logic behind this? Probably IVTC was applied and editing done afterwards.
STaRGaZeR
1st December 2009, 02:10
There are probably orphaned fields. You can inspect the video, you know. :)
It's difficult when you don't know how to do it, I'll investigate.
If you mean orphaned fields, then turn postprocessing back on.
No, for IVTC telecined film content with only one anomaly: phase changes. No orphaned fields.
Probably IVTC was applied and editing done afterwards.
I can't be sure, but I think all editing was done prior to the telecine process in these sources. Do you know any other reason?
I'm going to do some experiments. After searching with no luck, I have to ask you: how to compare two fields after separatefields()? I've tried Conditionalfilter with YDifferenceFromPrevious(), but the results don't match my expectations: it should tell me what fields are the same as the previous after doing separatefields() to a telecined source.
Guest
1st December 2009, 02:51
It's difficult when you don't know how to do it, I'll investigate. Look at the first two questions in the FAQ at my site.
No, for IVTC telecined film content with only one anomaly: phase changes. No orphaned fields. Reset the phase manually in your script as needed with Trim's, or use an adaptive IVTC filter. Isn't it obvious? You're not looking for a magic wand are you?
I can't be sure, but I think all editing was done prior to the telecine process in these sources. Do you know any other reason? No. You should find out instead of just guessing.
I have to ask you: how to compare two fields after separatefields()? I've tried Conditionalfilter with YDifferenceFromPrevious(), but the results don't match my expectations: it should tell me what fields are the same as the previous after doing separatefields() to a telecined source. It's not trivial because the fields are shifted relative to each other. The best tool is your eyes and mind. Step through the fields using the method in the FAQ I mentioned above.
Gavino
1st December 2009, 10:33
how to compare two fields after separatefields()? I've tried Conditionalfilter with YDifferenceFromPrevious(), but the results don't match my expectations: it should tell me what fields are the same as the previous after doing separatefields() to a telecined source.
To expand on neuron2's answer, no field should be the same as the previous, because one will be a top field and the other a bottom field. To find duplicates this way, you need to do SelectEven() or SelectOdd() after SeparateFields() (or compare with the next to previous field).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.