[devel] Make the 16-to-8 scaling accurate. Dividing by 256 with no rounding is

wrong (high by one) 25% of the time. Dividing by 257 with rounding is
    wrong in 128 out of 65536 cases. Getting the right answer all the time
    without division is easy.
This commit is contained in:
John Bowler
2011-06-10 23:24:58 -05:00
committed by Glenn Randers-Pehrson
parent cc2770850a
commit b2bee3374c
12 changed files with 81 additions and 55 deletions

View File

@@ -159,6 +159,10 @@ Version 1.5.3beta11 [June 11, 2011]
Revised documentation about png_set_user_limits() to say that it can
only be used to reduce the defined limit, and that it also affects
png writing.
Make the 16-to-8 scaling accurate. Dividing by 256 with no rounding is
wrong (high by one) 25% of the time. Dividing by 257 with rounding is
wrong in 128 out of 65536 cases. Getting the right answer all the time
without division is easy.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit