Shop OBEX P1 Docs P2 Docs Learn Events
NTSC Video driver question — Parallax Forums

NTSC Video driver question

potatoheadpotatohead Posts: 10,260
edited 2006-11-27 00:02 in Propeller 1
Happy Turkey all!

Hope you all get fat 'n happy today. I know I'm gonna.

I've been exploring the NTSC driver, building displays at various resolutions from about 320 x 384 to 96 x 96. All looks good. Thought about artifacting last night and realized the TV driver outputs a horizontally interlaced color signal. This is really good for higher resolutions and text on the TV, but not so good if you want to get creative with color. The current system will put 640x384 onto a television no problem. That's actually very cool, for the nicer sets with the usual comb filters, etc...

The way the driver is right now, one cannot take advantage of artifacting however.

I've tried tinkering with the TV driver code to get a non-interlaced signal that runs the color clock at the same phase every frame. Haven't had much success just yet. Before I continue, I thought I would ask if this was possible.

So is it? Might be, but nobody tried? Just wondering what you all know that I might not!

Comments

  • cgraceycgracey Posts: 14,133
    edited 2006-11-25 01:13
    Potatohead,

    There is a bit within the 'tv_mode' parameter that selects/deselects interlace. If you have interlace off, the colorburst phase will, indeed, switch 180 degrees on each line for every field. If it didn't, you would see a lot of jagged edges on the sides of things. That 30Hz color dithering really helps. With interlacing, the color dithering drops to 15Hz, which is quite noticeable. (for other readers: This is just TV signalling, and isn't related to the Propeller).

    I looked into the tv.spin driver and found where you could·make it have constant phase for every line. The trick is to add or subtract a line from the frame, so that the number of total lines becomes even. That will stop the phase from toggling. Here is the part you need to change:

    '
    '
    ' NTSC/PAL metrics tables
    '······························ ntsc··················· pal
    '······························

    wtab··················· word··· lntsc - sntsc,········· lpal - spal···· 'hvis
    ······················· word··· lntsc / 2 - sntsc,····· lpal / 2 - spal 'hrest
    ······················· word··· lntsc / 2,············· lpal / 2······· 'hhalf
    ······················· word··· 243,··················· 286············ 'vvis
    ······················· word··· 10+1,·················· 18············· 'vinv
    ······················· word··· 6,····················· 5·············· 'vrep
    ······················· word··· $02_8A,················ $02_AA········· 'burst

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.

    Post Edited (Chip Gracey (Parallax)) : 11/25/2006 2:07:45 AM GMT
  • potatoheadpotatohead Posts: 10,260
    edited 2006-11-25 03:03
    Thanks Chip!

    Just what I was looking for. Don't get me wrong. The NTSC video output from the prop is spot on! Went ahead and fired up my old SGI O2 workstation. It's got a pro quality video capture card fitted. Very few consumer level devices output a signal with enough quality to work reliably on it.

    Just for kicks, I snagged a few screenies. The std.bmp is the Parallax demo, running at it's standard horizontal resolution. Interlace is required for the SGI capture to run, so I doubled up the vertical pixels and turned interlace mode on.

    Perfect capture, right out of the gate. The video output is sweet and dead on, as I wrote above.

    The next two are at 640 and 720 pixels, with a scale setting of 4. The 640 looks great, the 720 suffers from the occasional glitch every second or so, and I'm not sure the pixels are 1:1 either. Snagged it anyway, just because I had the setup running. These are attachment prop_NTSC.zip. Raw video, with only the black level tweaked to bring everything in line. No filters at all, just the prop signal as seen by the capture device.

    The dithering, seen in these captures, is just how NTSC is. Most televisions apply a pre-filter or two. I did one at 640, just for comparison and more in line with what most televisions would output. This is attachment 640_filter.bmp

    IMHO, the 640 mode, would be just great for displaying nice easy to read text on a TV. I'll have to give that a shot at some point. Interlaced, it should look sweet.

    When you look at the captures, they are nearly pixel perfect, with only a bit of smudging. Nice! --and this is on a baseband video connection. Something like S-Video would be crisper still. It really does not get much better than this, from an overall quality standpoint.

    EDIT: Looked at the downloads. 20 for the lower quality image! If you want to see the razor sharp NTSC, be sure and grab the zip file.

    Post Edited (potatohead) : 11/26/2006 2:13:53 AM GMT
  • cgraceycgracey Posts: 14,133
    edited 2006-11-25 03:24
    Potatohead,

    That does look crisp. You can see, though, the horizontal shifting effects of colors that don't get the 30Hz color phase treatment that happens in continous video. Does your frame capturer have a mode where it grabs two·consecutive frames and then blends them (for static images, maybe)? This would make color transitions as smooth as pure luminance changes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • potatoheadpotatohead Posts: 10,260
    edited 2006-11-25 05:31
    I don't think it has one for still capture. Pretty sure it will field blend for a movie though. (30 FPS Quicktime Motion JPEG)

    Next time I fire it up, I'll have to check. Been a while since I last used the capture system.
  • potatoheadpotatohead Posts: 10,260
    edited 2006-11-26 00:18
    Got a chance to work with Chip's suggestion today. It did work nicely for stablizing the color phase, but it's still different on sequential scans, and comes with a new problem. Seems it's a 50/50 where it all ends up. Reset the prop, get one set of colors, reset it again, get the opposite set.

    Artifacting does work though, giving the whole thing a higher color capability. Doing some more digging. Suggestions welcome.

    X X X X X 
     X X X X X 
    
    These pixels would all be the same color.
    
    Should be able to get:
    
    X X X X X
    X X X X X
    



    I'm doing this more out of curiosity than anything. Man, I need a scope!

    Anyone know how older systems output their video?

    Did they start their color burst each line or something? I can't see a way to make this sync up to a known condition without some additional timing logic...

    Post Edited (potatohead) : 11/26/2006 8:04:54 AM GMT
  • Ym2413aYm2413a Posts: 630
    edited 2006-11-27 00:02
    potatohead said...
    Seems it's a 50/50 where it all ends up. Reset the prop, get one set of colors, reset it again, get the opposite set.

    I run into the same problem when I was trying to findout more colors for the chip.
    half the time it was one way, and other times it was the other way.
    I wonder if this has something to do with the video hardware in the chip.
Sign In or Register to comment.