The joys of interlaced video

So the world is moving from SD television to HD television.  There are now several different video formats available to broadcasters incuding 480p 720p and 1080i.  Many people wanted to move away from interlaced video completely and only support progressive scan video. But, our government, in its infinite wisdom, standardized everything at 1080i.  I don’t understand that at all.  Interlaced video creates all sorts of interesting challenges, espcially in the era of digital content.

I have a problem at work right now that is specific to interlaced video that I cannot figure out how to overcome.  My problem is that I need to draw basic primitives to the overlay channel.  These primitives aren’t supposed to obstruct or detract from the video but are generated based on user defined areas and the video’s content.   These overlays have to be drawn on coax (via NTSC/PAL), or a S/VGA display.

The VGA output is non-interlaced while the coax is interlaced.  What this means is that my primitives look absolutely beautiful on VGA but have a very annoying flicker over coax.  For those of you unfamiliar with interlaced versus non-interlaced video it is because a VGA monitor draws the entire screen every time it paints.  A video monitor (TV, etc) is interlaced and draws every other line and then goes back and draws the lines that it skipped the first time.  These two different draw periods are referred to as fields.

This means that if you had a horizontal line that was one pixel wide, it would be drawn in  one field and not drawn at all in the next field.  This causes the line to disappear, only to be drawn again.  That is where the flicker comes in.  Just doubling the thickness of the line would likely result in having two lines flickerin on and off right next to each other.

Well, I don’t have a problem with my horizontal lines, but I do with diagonal lines.   What I am doing is this.  If I am going to turn on pixel (x,y) then I would also turn on (x,y+1).  I’d then paint pixels (x,y+2), (x,y+3), (x,y-1) and (x,y-2) with the gradient color.  That way every field will have one pixel for the line and one pixel on each side of the line for the gradient color.  That combined with the persistence of the phosphors in the previous field should blur everything to the eye and make it look more consistent.  At least, that is what I would think.

I’m still getting flicker, however.  Not only am I getting flicker, but it also seems to be worse on lines where the slope is greater than 1.

I’m absolutely perplexed by this and I can’t figure out how to resolve my flickering issue.  I’ve tried to decrease the intensity of the colors that I am using by half and that makes the flicker less noticable but does not remove it completely.

I’m completely stumped.  I’m going to go talk to one of our senior hardware engineers to see if he has any idea.  He knows analog video very well.  If he has any thoughts, I’ll be sure to share them.  Otherwise, please give me any thoughts you have.

One Response to “The joys of interlaced video”

  1. ejohnson says:

    So this issue was a bit more complicated than just a matter of fields. The problem has to do with the way that the monitor filters the signal. It seems that because my line was so thin, it was misinterpreting the line as color information and that was bleeding into the picture causing what looks like flicker. Because of the way NTSC and PAL work, you can’t transition sharply between colors. I need to make my line wider and blend it in by providing gradual steps between the background color and my overlay.

    So, you need to double your line in the Y direction to prevent flicker from fields and you need to widen your line in the X direction to prevent color bleeding and the “flicker” that results from it.

Leave a Reply