[MPlayer-dev-eng] Re: [MPlayer-users] color of subtitles

Jindrich Makovicka makovick at kmlinux.fjfi.cvut.cz
Sat Nov 2 20:36:45 CET 2002


Michael Niedermayer wrote:

>Hi
>  
>
>>you mean fonts as 24-bit pixmaps? 
>>    
>>
>yes
>  
>
>>isn't it overkill?
>>    
>>
>perhaps, but it could look really nice :)))
>
I would postpone this, as I don't want to rewrite all the vo stuff at 
once and keeping both (freetype vs old bitmap) font engines working is a 
pretty tedious work. This is also the main reason why I still didn't 
write the support fur multiple font styles & sizes.

>>>i would suggest the following approch for color subs:
>>>1. generate pictures of all chars & colors in RGB32
>>>2. convert these to the same colorspace as the output buffer
>>>      
>>>
>>maybe it would be enough to do these two in draw_alpha_buf
>>    
>>
>yes, good idea, it seems the osd/sub/font stuff is different now relative to 
>the last time i looked at it ...
>
>btw, note, 2. can be done easiely with the swscaler 
>
>  
>
>>>3. simply render them (the nice sideeffect is that all formats except
>>>RGB15/16) can be handled by the same osd render function, so there is less
>>>code to optimize and its simpler & faster IMHO
>>>      
>>>
>>what do you mean by "simply" ? in yv12 and yuy2 you still have to deal
>>with the chroma subsampling (it can't be done sooner because chroma
>>depends on the x&y position).
>>    
>>
>?!
>if u have a font in YV12 and render it into an YV12 buffer then the operation 
>is identical to 3 gray font + gray buffers, except that the u & v buffers are 
>1/4 the size 
>for YUY2 font & YUY2 buffer its just 1 buffer with 2 bytes per pixel
>  
>
The main issue I encountered was that without a proper y/u/v alignment 
the osd looks ugly. Before putting the buffer on the screen, you don't 
know how they'll be aligned, it depends on the x and y position mod 2. 
(see the patch and the xmod & ymod params, there's also some kind of 
antialiasing of u & v).

-- 
Jindrich Makovicka





More information about the MPlayer-dev-eng mailing list