Log in

View Full Version : IVTC based on scene changes - has it been tried?


ChiDragon
19th August 2009, 19:27
Quoted below is the description I wrote for a filter I was working on (never released) but abandoned mid-2007. Apologies if some of the explanations are unclear; I can answer any questions if need be.

I ran into some issues with more complex functionality and gave up on it, but lately I've been wanting to try to clean it up and make it releasable.

I haven't been around the forums much since that time, so I'm wondering if anyone has written a similar plugin in the meantime. No sense reinventing the wheel.

:thanks:

SCIVTC is a 2-pass inverse telecine filter that does scene-based pulldown removal using the five iterations of the standard 3:2 telecine pattern. It is intended to be used on material that has pattern changes at black frames (i.e. between commercial breaks) and/or at each scene change (from post-telecine editing). It can also be used to field match PAL videos that switch field shifting at each scene change, and as a quick manual IVTCer on material that adheres to one pattern throughout. It CANNOT be used on videos that do not follow the regular pattern, and should probably not be used on captures with dropped/inserted frames or fields that disrupt the pulldown.

This filter uses TIVTC's field matching (equivalent to mode=0,slow=2,micmatching=0) but tries to produce better output than TIVTC can without a lot of manual work, by (1) using the pattern matches when possible and (2) deinterlacing orphaned fields at scene changes rather than matching them and creating extra duplicates. When possible, frames at the end of scenes are deinterlaced rather than frames at the start of scenes. SCIVTC does not actually do any deinterlacing itself; instead it places TFM-compatible hints. TDeint or another deinterlacer that can read these hints should follow SCIVTC.

When used on material edited post-telecine, SCIVTC is only meant as a semi-automatic method; misdetections should be corrected by manual overrides. TIVTC/Decomb/etc. will most likely produce better results than SCIVTC when both are used in fully automatic mode. Also, animation that changes patterns at each scene probably does not have enough movement to work well.

Advantages versus traditional automatic field matching and decimation:

1. Even low motion and other confusing scenes are correctly field-matched and decimated, when the pattern is found.
2. "Orphaned" fields (i.e. film frames represented in only a single field) caused by cuts at scene changes are deinterlaced rather than field-matched to preserve fluid motion.
3. The transition between patterns 1 and 5 that causes two duplicates separated by 3 new frames is solved without keeping a duplicate or replacing one with a blend of adjacent frames.
4. Overlays such as credits and animated TV network bugs do not interfere with IVTC (this may also be a disadvantage if the overlay is something like a CGI effect that should be deinterlaced).
5. Special patterns, some including deinterlacing, can be used to retain full motion during dissolves between different patterns (at the cost of lower resolution due to the deinterlacing). Each pattern has 2 transitions that do not require deinterlacing and 2 that do.

Myrsloik
19th August 2009, 19:46
Not an avisynth plugin, but I implemented a similar mode in yatta (http://code.google.com/p/yatta-ivtc/) long before SCIVTC was created. The general idea is about the same except that is uses telecide metrics and either lavc or xvid logs to find scene changes. It is also tries more combinations (cccnn, ccnnn, ccccc) to deal with vfr/weird material more elegantly. I think I just called it pattern guidance. You've probably seen a file or two on the internet where it was used already.

I'm also a bit sceptical of claim 4 there. TFM has no metrics that could distinguish it, at least not that are known to me.

ChiDragon
19th August 2009, 20:43
Yeah, the idea was partly based on the great YATTA. ;)

You're right to be skeptical there. :)

It's based on the assumption that most frames of the overlay content won't create a false pattern match. So long as the pattern can be determined from the majority of the content in the scene, it's applied to the whole scene and the overlay is ignored entirely (I keep it interlaced to not degrade the quality of the actual TV show picture).

Here's the example images I created for that back in '07:
http://img168.imageshack.us/img168/8092/06a.jpg
http://img168.imageshack.us/img168/4886/06b.jpg

I'm guessing YATTA could do similar but I'm not sure exactly how its pattern matching is determined. Mine is a really simple check, as I recall. I haven't looked back at the source yet.