[MPlayer-dev-eng] [PATCH] OSD through EOSD

Nicolas George nicolas.george at normalesup.org
Fri Aug 13 21:11:24 CEST 2010


Le sextidi 26 thermidor, an CCXVIII, Reimar Döffinger a écrit :
> Except that it means you definitely can't remove this, at least
> bicubic scaling can produce interpolated values with
> value > alpha even when value <= alpha for all surrounding
> values, and that means _very_ ugly artefacts if in addition
> the video background is very bright.

I thought of that, and at first I left the test to catch those cases. But as
I cleaned and aligned the code, I noticed it went like this:

> > +  spu->scaled_image[scaled] =  (color[0] * scale[0] + color[1] * scale[1] + color[2] * scale[2] + color[3] * scale[3]) >> 16;
> > +  spu->scaled_aimage[scaled] = (alpha[0] * scale[0] + alpha[1] * scale[1] + alpha[2] * scale[2] + alpha[3] * scale[3]) >> 16;

And, shortening the identifiers names to fit in one mail line:

sc_i = (c[0] * sc[0] + c[1] * sc[1] + c[2] * sc[2] + c[3] * sc[3]) >> 16;
sc_a = (a[0] * sc[0] + a[1] * sc[1] + a[2] * sc[2] + a[3] * sc[3]) >> 16;

color[i] and alpha[i] are the input values, therefore color[i] <= alpha[i]
(unless the input is bogus). scale[i] are the bilinear coefficients, they
are the same for both lines. Then color[i] * scale[i] <= alpha[i] *
scale[i]. Summing and shifting will preserve the relation.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100813/bb8466f5/attachment.pgp>


More information about the MPlayer-dev-eng mailing list