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

Oded Shimon ods15 at ods15.dyndns.org
Wed Feb 23 20:21:02 CET 2005


On Wednesday 23 February 2005 01:21, 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 rewrote most of the filter, and added YUV support using the exact same 
reverse alpha used for RGB (treating the YUV channels as RGB channels).
This worked great on black and dark scenes, but for some reason it started 
completely messing up on bright red or bright blue - the reverse alpha area 
becomes TOO red.

I figured a simple-minded equation for the YUV channels didn't work like that, 
so I worked out the whole math of converting the YUV to RGB, reversing alpha, 
and then converting to YUV, simplified, and ended up with the exact same 
equation I already had, :/ Meaning the original equation DOES work on YUV, 
it's just because of the clipping that it apparently sucks.

2 possible options:
Disable YV12 altogether for the filter, let the user do 'scale=,format=rgba' 
before the filter.
Allow YV12, and convert only the necessary area to RGBA and back.

anyone has an idea for a third better option?...

http://dividedsky.net/~ods15/snapshot2.png

- ods15




More information about the MPlayer-dev-eng mailing list