From: SourceForge.net <no...@so...> - 2004-01-26 03:48:39
|
Patches item #884449, was opened at 2004-01-25 15:31 Message generated for change (Comment added) made by kevko You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=506989&aid=884449&group_id=64301 Category: Bugfix Group: Patch against CVS tvtime Status: Open Resolution: None Priority: 5 Submitted By: Kevin Ko (kevko) Assigned to: Billy Biggs (vektor) Summary: vbi clock-signal locking to improve CC decoding Initial Comment: Re: Bug [ 720072 ] Closed Caption text messed up The original method used in ccdecode() used some hard limits to determine the first pair of peaks in the binary 10 (repeated 7 times) clock-in. These settings were not kosher with my cable signal, and so I experienced, at best, dropped/wrong characters. Though more often than not, I was unable to decode XDS or CC data. I wrote a tool to visualize the data from /dev/vbi? (code is ugly, but if any wants it, I'll take the time to clean it up; just email me), and realized that with my setup, the locking was occurring too early. Noisy signals were also hopeless (despite diz's excellent filter), because the sample threshold would vary too widely. This applies a more general search to latch onto the VBI clock-in by first optimizing a metric that takes both distance and signal value into account. It then takes advantage of the fixed clock-in VBI freq of 1.006976Mhz (28.64 Mhz sampling freqs for bttv and philips tuner cards) in conjunction with said metric to search out the remaining clock-in values. An average of the 7 maximum and minimum values is taken to determine the threshold, the result of which being more stable than that from a single pair of measurements. CONCLUSION (in case you want to skip all my noise above): Things seem to work well with apparently unnoticeable overhead (relative to the expensive stuff like image filtering), and top doesn't show much of a difference on my athlon. Now, I can decode XDS and captions without any problems on all supported channels (not just one), and the resulting output seems relatively free of errors. For images of the signal and general illustrations of my decoding problem/solution: http://www.princeton.edu/~kko/tvtime/ And as an added bonus, you can see how well diz's filter works on a noisy signal. (it's quite good!) :-) ---------------------------------------------------------------------- >Comment By: Kevin Ko (kevko) Date: 2004-01-25 19:48 Message: Logged In: YES user_id=457203 Alrighty, I think I've got something a bit better which is less dependent on these hard coded numbers. The 'latching' part remains the same and helps with determining the avg threshold. After finding the last minimum, I jump to the last pair of 11's in the VBI frame using the threshold alone (the first part of the frame after the clock-in is a bunch of 0's). This was originally done with a constant jump, so this should be better. (thanks to ntsc-cc's source for giving me notice of this) Decoding also occurs over a complete sample cycle rather than just my randomly chosen range consisting of five samples surrounding the desired point. Anyhow, this is better now: sort of like ntsc-cc for the decode part, with a clock-in/threshold portion that isn't based on hard values. My bad for the extra hassle! Should have noticed at first... ;b ---------------------------------------------------------------------- Comment By: Billy Biggs (vektor) Date: 2004-01-25 18:05 Message: Logged In: YES user_id=153320 You'd better check it out, my setup right now prevents me from even being able to run tvtime ;-) My setup and schedule is sort of messed up as I try and finish/defend my thesis. ---------------------------------------------------------------------- Comment By: Kevin Ko (kevko) Date: 2004-01-25 18:03 Message: Logged In: YES user_id=457203 i'd like to double-check my increment numbers... or perhaps you should just try the existing ones? what i've used doesn't seem exactly right because of round-off. latching to the clock should still be fine, however. i'll think about it and get back to you. ---------------------------------------------------------------------- Comment By: Billy Biggs (vektor) Date: 2004-01-25 15:58 Message: Logged In: YES user_id=153320 ahem, i'd check it in if sourceforge weren't fucking busted... sigh. ---------------------------------------------------------------------- Comment By: Billy Biggs (vektor) Date: 2004-01-25 15:39 Message: Logged In: YES user_id=153320 Very cool. Yeah, I was also pretty impressed with diz's filter, but figured something like missing the clock in would be breaking stuff, that whole like 'find the first peak' thing was just broken. Your code looks awesome, and your viewer app is a lot like diz's xvbidecode app. :) You should drop by #tvtime or #livid on freenode, btw. I'll apply this now, thanks a ton. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=506989&aid=884449&group_id=64301 |