[MPlayer-dev-eng] [PATCH] vf_osd: OSD filter for MPlayer

Jason Tackaberry tack at sault.org
Sun Jul 17 22:48:34 CEST 2005


On Sun, 2005-07-17 at 21:59 +0200, Michael Niedermayer wrote:
> non constant statics/globals

One of the goals of vf_osd is that the OSD survive loops and loadfile
commands. Given that, I need to keep track of some things that are
common for all vf_osd instances.

> > +fprintf(stderr, "@@@ INIT OSD: %d %d\n", width, height);
> 
> mp_msg()

Oops, that debugging stuff shouldn't even be in there.  I'll remove it.

> the swscaler will happily convert any rectangular region you want

I got the impression from the SwScaler API that it could only convert
slices, and when I tried even that I couldn't make it work.  Perhaps
I'll try again and ask for advice here.

> > +   And we'd need to do a second pass for alpha anyway.
> 
> you could extend the swscaler to support RGBA->YUVA

The SwScaler code is a little bit intimidating. :)  But yes, it would be
better to update SwScaler to do RGBA->YUVA.  Since bmovl does its own
colorspace conversion as well, I figured this wouldn't be a requirement
to get the patch accepted, but could be a future improvement.

> mmx should be detected at runtime if its easy and wont cause a slowdown

Ok, that should be an easy change. 

> 
> > +		"emms\n\t"
> 
> ehm, uhm, you dont want to do that in the innerost loop, its sloooow on some 
> cpus

Thanks for spotting that.
> 	
> > +				:: "r" (dst),
> > +				   "r" (src),
> > +				   "r" (osd),
> > +				   "r" (alpha),
> > +				   "m" (c) : "%ecx", "memory"
> > +				);
> 
> input operands may not be changed

Setting the output operands works ok in blend_image() (the code quote
above), but causes a segfault when I make dst_byte/dst_alpha output
operands in premultiply_alpha_byte_8().  The main problem of course is
that I'm a bit clueless when it comes to asm.  Perhaps there are some
common caveats I'm running into?

Thanks for the comments, Michael.

Cheers,
Jason.




More information about the MPlayer-dev-eng mailing list