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

Reimar Döffinger Reimar.Doeffinger at gmx.de
Thu Sep 23 21:10:10 CEST 2010


On Sun, Sep 19, 2010 at 11:41:36AM +0200, Nicolas George wrote:
> +    opacity = (0x10203 * opacity + 0x80) >> 8; /* 0x10203 = (1<<32)/(255*255) */

If it is actually "=" you could just write ((1 << 32)/(255*255))
Well, you'd have tu use 1ULL instead of 1, and hope the compiler
does not do something stupid like trying a 64 bit multiply.
Still, might be worth it.
Seems ok otherwise.


More information about the MPlayer-dev-eng mailing list