Log in

View Full Version : Recreating an interlaced diplay in software


bkman
19th August 2006, 05:20
Ok, this idea may be a bit out there, so don't be too harsh in shooting it down...

So, we all know that DVD's are interlaced in all sorts of funny ways, and yet the visual result is not usually distracting on the most basic of intended output devices: the 480i (or 576i) CRT TV. Now why is that? As far as I know this is due to the particular characteristic of CRT displays, and in particular to how scanlines fade gradually even while the next set is drawn, leading to a kind of interpolation effect for the viewer.

Now this obviously doesn't work on progressive displays, which leads to all the problems with deinterlacing, etc. The question I am posing however, is why not simulate this CRT fadeoff effect during realtime playback on progressive diplays by dimming odd and even field pixels in the time after they are first drawn? Like give each pixel a "life" expectation, and fade them off upto that point at a higher-than-original framerate. Would such a system not nullify the need for many and sundry deinterlacing methods?

Thoughts, please.

foxyshadis
19th August 2006, 08:37
Can't say it looks especially good on an LCD, but give it a try on some 60i and report back. (replace nextf by prevf for bff) Part of the reason for this is the way real scanlines work - the updating brightness bleeds into the fading line, partially covering it. A so-called 25% scanline (this is 50%) might simulate that.


function fakeinterlacing(clip c) {
c
SeparateFields()
o=SelectOdd()
o=interleave(o,mt_average(o,o.blankclip))
e=SelectEven()
e=interleave(e,mt_average(e,e.blankclip)).nextf
Interleave(e,o).Weave()
}


function nextf(clip c) {
return c.duplicateframe(c.framecount-1).deleteframe(0)
}

function prevf(clip c) {
return c.deleteframe(c.framecount-1).duplicateframe(0)
}


With a temporal fade instead of a scanline fade, looks better on LCDs:

function fakeinterlacing(clip c) {
c
SeparateFields()
o=SelectOdd()
o=interleave(o,mt_average(o,o.nextf))
e=SelectEven()
e=interleave(e,mt_average(e,e.nextf)).nextf
Interleave(e,o).Weave()
}

I leave the implementation of scanline bleed as an exercise to the reader. (Somehow merging a bob of the other field should help.) Of course at that point it'd just be faster to use one of the common deinterlacers - but not more interesting, see. ;)

kururu
19th August 2006, 09:02
Videolan hath a bob deinterlacer filter quite easily activated with some basic mouse navigation. although myselves never uses it.