[MPlayer-dev-eng] [PATCH] vf_ass: avoid a division

Nicolas George nicolas.george at normalesup.org
Thu Sep 16 10:47:49 CEST 2010


Le decadi 30 fructidor, an CCXVIII, Grigori Goronzy a écrit :
> Instead of "x / 255" at all it's usually faster to do "(x + 255) >> 8",
> at least in my experience. You can easily transform all divisions to
> shifts in this inner loop. Haven't done any tests, though.

That is indeed much faster (+16,7% instead of +4.6%), but the rounding is
slightly different. I'll look more closely into it.

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/20100916/7215b8e1/attachment.pgp>


More information about the MPlayer-dev-eng mailing list