aspect ratio correction garbage pixels in recent snapshot
|Reported by:||SF/ewelsh42||Owned by:||fingolfin|
Builds from a recent snapshot (January 26th, 2009) exhibit garbage pixels when aspect ratio correction is enabled, independent of which filter is used. The error was traced back to a (recent?) change in graphics/scaler/intern.h
The interpolate32_1_1() function was overoptimized to save a bit shift. ((A>>1) + (B>>1)) had been replaced with ((A + B) >> 1). Unfortunately, adding A + B prior to downshifting can result in a uint32 overflow, resulting in garbage pixel colors.
Reverting to the previous non-overflowing version fixes the problem. Diff attached.
Ticket imported from: #2542162. Ticket imported from: bugs/4126.