Initialize the error-limiting transfer function (lookup table). The raw F-S error computation can potentially compute error values of up to +- MAXJSAMPLE. But we want the maximum correction applied to a pixel to be much less, otherwise obviously wrong pixels will be created. (Typical effects include weird fringes at color-area boundaries, isolated bright pixels in a dark area, etc.) The standard advice for avoiding this problem is to ensure that the "corners" of the color cube are allocated as output colors; then repeated errors in the same direction cannot cause cascading error buildup. However, that only prevents the error from getting completely out of hand; Aaron Giles reports that error limiting improves the results even with corner colors allocated. A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty well, but the smoother transfer function used below is even better. Thanks to Aaron Giles for this idea.