Skip to content

[smooth] Reduce shift in multiply-shift optimization.

Alexei Podtelezhnikov requested to merge multiply-shift into master
  • src/smooth/ftgrays.c (FT_UDIVPREP, FT_UDIV): Reduce shift.

Smaller shifts that keep the division operands of FT_UDIVPREP within 32 bits result in slightly faster divisions, which is noticeable in the overall performance. The loss of precision is tolerable until the divisors (the components dx and dy) approach 32 - PIXEL_BITS. With PIXEL_BITS = 8, this corresponds to 65,000 pixels or the bitmap size that we refuse to render anyway.

Using ftbench -p -s60 -t5 -bc timesi.ttf,

Before: 8.52 us/op After: 8.32 us/op

Edited by Alexei Podtelezhnikov

Merge request reports