[vlc-devel] Re: VCD OGT subtitles and rescaling

Sigmund Augdal sigmunau at stud.ntnu.no
Tue Dec 23 14:12:53 CET 2003


On Mon, Dec 22, 2003 at 10:53:31PM -0500, R. Bernstein wrote:
> A rough cut at SVCD subtitles now works. A small problem seems to be
> the rescaling and positioning of them. The subtitle bitmaps have
> aspect ratio 1:1 while the video picture used is 4:3. 
> 
> Also the video seems to be scaled down say with respect to what's
> shown in xine.  In vlc the video window is 480 x 360 pixels while in
> xine it is 768 x 480 pixels. The video is in fact 480x480 pixels.  Any
> suggestions for how to scale the subpicture? Or have it blended with
> scaling?  It would also be nice if there is an option to antialias it
> as well.
Last time I played with xine it allways started it's vout window with the
xine splashscreen, any video shown after that reused the vout window, so the
video is allways scaled to the size of the splashscreen. Don't know if this
is what happens here though.

> 
> Which leads me to rendering. Internally I've made the bitmaps be in
> the form used in the spudec, the DVD subtitle render routine. However
> a couple things I notice. A simple format would remove the run-length
> encoding and just have a simple list of pixels interpreted as a
> 2-dimensional array. However there is a run-length of in the upper
> nibble the low-order byte of a 16-bit word. For OGT subtitles I've
> encoded with a run-length of 1 everwhere. The second weird thing is
> that although the color number and run length are put in a single
> byte, but each pixel occupies a 16-bit word. Given this, the code
> would be simplified and sped up by removing the shift/unshift-ing
> or'ing and going on in the AddNibble routine of spudec and instead
> just store by bytes, e.g. 8-bit run-length in one byte, 8-bit color on
> another, rather than 0-byte, 4-bit run-length, and 4-bit color. But
> again, removing the run-length would make scaling and anitaliasing
> easier.
You are running down the wrong track here. The DVD subtitle renderer routine
is created to render DVD subtitles fast and easily, and the DVD subtitles
are run-length encoded. You should rather write your own renderer functions
that take advantage of the structure of the OGT. I have a hope that some
time in the future we will have some general functions to blit one image on
top of another. This seems like a good place to start implementing such
functions.

Sigmund

> 
> -- 
> This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
> To unsubscribe, please read http://developers.videolan.org/lists.html
> If you are in trouble, please contact <postmaster at videolan.org>

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the vlc-devel mailing list