pixman-filter: Correct Simpsons integration
authorBill Spitzak <spitzak@gmail.com>
Wed, 31 Aug 2016 05:03:10 +0000 (22:03 -0700)
committerSøren Sandmann Pedersen <soren.sandmann@gmail.com>
Fri, 2 Sep 2016 04:40:12 +0000 (00:40 -0400)
commit6ae281fbb7a02b94a3900b6677a51cdd28096ed7
treed5000bc0f9cc2fc8e9bb380eb2ca8b77678a80b7
parent6acaf2bcb1246529143c112dbce6dd9d6f7cb51e
pixman-filter: Correct Simpsons integration

Simpsons uses cubic curve fitting, with 3 samples defining each
cubic. This makes the weights of the samples be in a pattern of
1,4,2,4,2...4,1, and then dividing the result by 3.

The previous code was using weights of 1,2,0,6,0,6...,2,1.

With this fix the integration is accurate enough that the number of
samples could be reduced a lot. Multiples of 12 seem to work best.

v7: Merged with patch to reduce from 128 samples to 16
v9: Changed samples from 16 to 12
v10: Fixed rebase error that made it not compile
v11: minor whitespace change
v14: more whitespace changes

Signed-off-by: Bill Spitzak <spitzak@gmail.com>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Søren Sandmann <soren.sandmann@gmail.com>
pixman/pixman-filter.c