[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft-devel] FT_MulDiv optimization
From: |
Alexei Podtelezhnikov |
Subject: |
Re: [ft-devel] FT_MulDiv optimization |
Date: |
Fri, 15 Aug 2014 23:12:48 -0400 |
Werner,
FT_MulFix optimized like this on line 543:
if ( ua <= 2048 && ub <= 1048576L )
ua = ( ua * ub + 0x8000UL ) >> 16;
Of course, when we anchor 2048 and use unsigned multiplication, it
should safely have been
if ( ua <= 2048 && ub <= 2097135L )
but that's not my point. I do not know why 2048 is chosen, but we can
relax the condition similarly to the recent FT_MulDiv change. We can
use this to cover the old range *completely* and grab some more:
if ( ua + ( ub >> 8 ) <= 8191UL )
So, what was so special about 2048?
Alexei
- Re: [ft-devel] FT_MulDiv optimization,
Alexei Podtelezhnikov <=