[MPlayer-dev-eng] Improved remove-logo filter

Rich Felker dalias at aerifal.cx
Tue Sep 12 21:13:44 CEST 2006


On Mon, Sep 11, 2006 at 06:40:40PM -0700, Trent Piepho wrote:
> The existing remove-logo filter has several serious bugs.  For example,
> this logo mask http://www.speakeasy.org/~xyzzy/pictures/mask.png produced
> this output http://www.speakeasy.org/~xyzzy/pictures/old_remove_logo.jpg
> The improved filter with bugs fixed produces this,
> http://www.speakeasy.org/~xyzzy/pictures/new_remove_logo.jpg
> 
> In addition to fixing the bugs, I re-wrote the code that actually does
> the filtering work.  For each pixel, the old code would take a circular
> mask, mask that against the logo, and then average the resulting pixels. 
> In my version a custom mask is created for each pixel, which contains
> just the pixels to be used (ie.  the circular mask and the logo mask are
> combined into one mask when the filter initializes) and has a minimal
> bounding box.  This eliminates one of the masking operations and produces
> a smaller rectangle (since much of the circular mask is going to be part
> of the logo and not used) that needs to be processed for each pixel. 
> This speeds to the filter up by around a factor of two, depending on the
> logo.
> 
> I further optimized the code by writing a MMX2 mask and sum core, that
> provides an additional speedup of about 60% for the blurring operation. 
> There is of course a C version if MMX2 is not enabled.

Your inline asm constraints look wrong (passing in a 64bit int via
register??) and you use some _-prefixed variable names which I believe
are reserved by C. Idea sounds good tho.

Rich




More information about the MPlayer-dev-eng mailing list