Copyright 2004 Ken Greenebaum
Paeth predictive filter
n
horiz = abs(above – upperLeft);
n
vert
= abs(left
– upperLeft);
n
diag
= abs(left + above – 2* upperLeft);
n
if (horiz <= vert && horiz <= diag)
n
return left;
n
if (vert <= diag)
n
return above;
n
return upperLeft;