[MPlayer-dev-eng] [PATCH] display DVD subtitles

Michael Niedermayer michaelni at gmx.at
Tue Nov 20 21:10:44 CET 2001


Hi

On Tuesday 20 November 2001 19:56, Arpi wrote:
[...]
>         for(x=0;x<w;x++){
>             if(srca[x]) dstbase[x]=((dstbase[x]*srca[x])>>8)+src[x];
>         }
>
> it was the fastest posisble way to render transparent bitmaps over the
> image using plain C code.
>
> also an important limitation:  color+alpha must be less or equal to 255
> (because there is no >255 range checking and clipping)
>
> But.
> As now we have some MMX code for sub rendering, what about making this
> optional, or forget it all, and use the simplest way:
> 0 = opaque sub
> ...
> 255 = transparent sub
>
> so the equation is simpler:  dst=dst*alpha+color
?
u mean 
dst=((dst*alpha)>>8)+color; or do u want me to replace the mmx code with 
floating point code ;)

>
> it's easier to implement in MMX (now i know why wasn't mmx version
not really, the special case for srca==0 only costs 1 instruction per loop
MMX algo in C: 
dstbase[x]=((dstbase[x]*(byte)(srca[x]-1))>>8)+src[x];
btw it was only the intel cpus which didnt benefit much from it, nick had 
some impressive speedups

> faster...) and for realtime generated fonts (dvd subpic) it's easier to
> use.
>
> Michael, Nick, what do you think about it? would it help mmx code speed?
not much

[...]

michael



More information about the MPlayer-dev-eng mailing list