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

Grigori Goronzy greg at chown.ath.cx
Thu Sep 16 10:47:50 CEST 2010


On 09/16/2010 10:46 AM, Siarhei Siamashka wrote:
> On Thu, Sep 16, 2010 at 11:21 AM, Grigori Goronzy <greg at chown.ath.cx> wrote:
>> 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.
> 
> I suggest checking this link for the bit-exact division-free implementation:
> http://research.swtch.com/2008/01/division-via-multiplication.html
> 

Interesting, but do we need bit-exact results here? I think no.

Grigori


More information about the MPlayer-dev-eng mailing list