[Pixman] [PATCH v13 08/14] pixman-filter: Corrections to the integral() function

Søren Sandmann soren.sandmann at gmail.com
Fri Mar 4 23:12:34 UTC 2016


On Wed, Feb 10, 2016 at 1:25 AM, <spitzak at gmail.com> wrote:

> From: Bill Spitzak <spitzak at gmail.com>
>
> The IMPULSE special-cases did not sample the center of the of the region.
> This caused it to sample the filters outside their range, and produce
> assymetric filters and other errors. Fixing this required changing the
> arguments to integral() so the correct point could be determined.
>
> I fixed the nice filter and the integration to directly produce normalized
> values. Re-normalization is still needed for impulse.box or
> impulse.triangle
> so I did not remove it.
>
> Distribute fixed error over all filter samples, to remove a high-frequency
> bit of noise in the center of some filters (lancoz at large scale value).
>
> box.box, which I expect will be very common as it is the proposed "good"
> filter,
> was made a lot faster and more accurate. This is easy as the caller already
> intersected the two boxes, so the width is the integral.
>
> v7: This is a merge of 4 patches and lots of new code cleanup and fixes
>  determined by examining the gnuplot output
>

Please split this back out into separate patches that each fix one problem:

- Fixing IMPULSE special cases
- Distributing errors evenly
- BOX.BOX speedups

There are several of these changes I'm not convinced about, and they are
hard to review as one big patch.

diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c

> index 8b8fb82..e82871f 100644
> --- a/pixman/pixman-filter.c
> +++ b/pixman/pixman-filter.c
> @@ -79,7 +79,7 @@ sinc (double x)
>  }
>
>  static double
> -lanczos (double x, int n)
> +lanczos (double x, double n)
>  {
>      return sinc (x) * sinc (x * (1.0 / n));
>  }
>

What is the point of this change? I don't think Lanczos makes sense with a
non-integral number of lobes.

@@ -99,7 +99,7 @@ lanczos3_kernel (double x)
>  static double
>  nice_kernel (double x)
>  {
> -    return lanczos3_kernel (x * 0.75);
> +    return lanczos3_kernel (x * 0.75) * 0.75;
>  }
>

I don't think this makes sense given that normalization is happening later
anyway.


Søren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pixman/attachments/20160304/79c25bb2/attachment.html>


More information about the Pixman mailing list