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

Arpi arpi at thot.banki.hu
Tue Nov 20 21:17:05 CET 2001


Hi,

> >         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 ;)
:)
you're right i mean with >>8

btw in HQ Enterprise Edition we could use double floating point precision
for DVD mastering :)))

> > 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];
hmm. tricky :)

> btw it was only the intel cpus which didnt benefit much from it, nick had 
> some impressive speedups
maybe just our cpus are too fast and they can't benefit as the bottleneck is
video ram speed :(

> > Michael, Nick, what do you think about it? would it help mmx code speed?
> not much
ok. then i'll leave it in alone.


A'rpi / Astral & ESP-team

--
mailto:arpi at thot.banki.hu
http://esp-team.scene.hu



More information about the MPlayer-dev-eng mailing list