[Pixman] [PATCH v13 07/14] pixman-filter: Correct Simpsons integration

Bill Spitzak spitzak at gmail.com
Sat Mar 5 02:37:42 UTC 2016

On Fri, Mar 4, 2016 at 3:00 PM, Søren Sandmann <soren.sandmann at gmail.com>

> On Wed, Feb 10, 2016 at 1:25 AM, <spitzak at gmail.com> wrote:
>> From: Bill Spitzak <spitzak at gmail.com>
>> 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,6,6...6,2,1. Since it divided
>> by
>> 3 this produced about 2x the desired value (the normalization fixed this).
>> Also this is effectively a linear interpolation, not Simpsons integration.
> It is not true that the previous code used these weights because it only
> ran for half the segments (it had += 2). The intention with the code was to
> do both the 4 and the 2 weight in one loop, but for that to work a1 and a2
> would have to be updated, which the code didn't do. So it was indeed buggy,
> and I think the new code is correct.

You are right, the old code did weights of 1,2,0,6,0,6,...,2,1. This would
explain why it worked even when I removed normalization.

There should be spaces before the parentheses in the SAMPLE() macros,
> though.

Ok will fix.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pixman/attachments/20160304/c367f80a/attachment.html>

More information about the Pixman mailing list