[Subhandler-devel] Experience with SVCD/VCD on videolan
Status: Alpha
Brought to you by:
jsanchez
From: R. B. <ro...@pa...> - 2004-01-15 04:09:49
|
I've recently been adding SVCD and CVD subtitle handling in VideoLan's vlc client. I started with subhandler which ahs been extremely helpful. Although I'm not totally finished with this, folks might be interested in looking or trying the code. In some small ways, it may be a tad cleaner; some duplicated code has been made into a macros or a procedures. One thing that I think has been a win has been taking out the color palette encoding and using an underlying YUV format. When trying to scale to counteract the scaling effects of scaled chromas like YUY2 or I420, having individual pixel entries helps I think. The routine that does the scaling I think is pretty simple and seems to work well. It scales down and works for aspect ratios between 1/2 and 1 (the inverse of say 4:3 or 16:9) where you combine at most 3 linear pixels into one. In vlc I've noticed as alluded to above that for YUY2 or I420 formats I've had to reverse scale the subtitles (e.g. 3:4 for a 4:3 aspect ratio). However for the RGB formats, no scaling should be done. I looked at the subhandler code and I don't see if it has to deal with the problem as well. (It does look like there is a bug somewhere in subhandler at the ends of the lines of the boundaries of the subtitles. Perhaps the next line data is bleading through.) One bad thing about vlc in its current form, is that there really isn't a image library that I can use to do the blending. Nothing as simple as what you do in xine and say put pixel with color c at postion x/y. In fact I'm not sure there are *simple* routines exposed in the the core to say convert YUV to RGB. (There are some *complicated*, not very well documented, and not exposed routines or macros though.) So alas I've had to write code blend in all the different chromas and that's been tough going. Anyway, to close. If folks have nice non-proprietary subtitle test cases - e.g. subtitles in different colors, maybe with different transparancies I'd appreciate of learning. Of course I could over time create such, but I'd rather be coding and not possibly recreating work that others might have. Thanks |