[MPlayer-dev-eng] Re: [PATCH] New video filter: deblendlogo

Martin Atkins mart at degeneration.co.uk
Thu Feb 24 01:10:18 CET 2005


Joey Parrish wrote:
> On Wed, Feb 23, 2005 at 01:21:28AM +0200, Oded Shimon wrote:
>>
>>If I get some time I might look into it and fix the filter. Generally color 
>>converting at all is (a little) lossy, so if it's possible in some way to 
>>make this filter work in YUV without converting anything, it would be 
>>awesome. I think it is possible, as far as I can tell, alpha works just as 
>>well on YUV as it does on RGB. All you need to do is first convert the input 
>>png image to YUV instead of RGB (and store the alpha separately or 
>>something).
> 
> 
> I agree.  Using swscale inside the filter is a BAD idea.  You should
> either support it or let the automatic conversions handle it.  Faking
> YV12 support is not helpful at all.
> 

My original patch declared that it only supported the RGB formats, but 
mplayer didn't automatically do the necessary conversions to output to 
YUV drivers/formats, and at the time I didn't know how to work the 
format filter. It added the scale filter to convert to BGRA, but since 
the xv driver can't support BGRA it didn't work.

Doing the alpha calculations directly on the YV12 data would certainly 
be ideal, but I don't know enough about the YUV colourspace to do that. 
My second patch was just a workaround since I got feedback that without 
YUV support it was of little use, since few file formats use the RGB 
colourspace.

If someone who knows more about YUV than me can make the reverse alpha 
blend work on YV12 then that would definitely be a better solution. 
Alternatively, my original patch without the YV12 "support" is complete 
except for a small bug with the checking to ignore pixels where the 
template is completely transparent or opaque, where I compared against 
255 instead of 1.0 causing a crash when opaque pixels appear in the 
template. With that fixed, that code will do exactly the same as my more 
recent version but without the YV12->RGB->YV12 path.

All the best,
Martin Atkins




More information about the MPlayer-dev-eng mailing list