[Pixman] [PATCH 11/15] pixman-filter: made IMPULSE.IMPULSE not produce a zero-wide filter

Bill Spitzak spitzak at gmail.com
Tue Dec 22 11:15:31 PST 2015


On Tue, Dec 22, 2015 at 4:21 AM, Oded Gabbay <oded.gabbay at gmail.com> wrote:

> On Sat, Dec 12, 2015 at 8:06 PM,  <spitzak at gmail.com> wrote:
> > From: Bill Spitzak <spitzak at gmail.com>
> >
> > With the other patch to put error on the center pixel, this produces
> > the same result as BOX.IMPULSE filter.
> > ---
> >  pixman/pixman-filter.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
> > index 00126cd..64981cd 100644
> > --- a/pixman/pixman-filter.c
> > +++ b/pixman/pixman-filter.c
> > @@ -327,7 +327,9 @@ pixman_filter_create_separable_convolution (int
>        *n_values,
> >      subsample_y = (1 << subsample_bits_y);
> >
> >      width = filter_width (reconstruct_x, sample_x, sx);
> > +    if (width < 1) width = 1;
>
> Please put the assignment in a new line
>

Okay I will get these.

>
> >      height = filter_width (reconstruct_y, sample_y, sy);
> > +    if (height < 1) height = 1;
>
> Same comment
>
> >
> >      *n_values = 4 + width * subsample_x + height * subsample_y;
> >
> > --
> > 1.9.1
> >
> > _______________________________________________
> > Pixman mailing list
> > Pixman at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/pixman
>
> I have the same request as with the other patch (center pixel). I can
> see the visual difference - the picture in scale demo doesn't
> disappear when reconstruct & sample are IMPLUSE - but I would like
> some additional explanation to better understand.
>
> In which cases width/height are smaller than 1 ? How does that happen
> ? How this patch solves it ?
>

The impulse filters have a width of zero (if you could actually plot them
they are an infinitely thin and infinitely tall line with an area of 1.0).
Once convolved with any other filter you will get a filter of width 1, with
a value equal to the other filter at the center of the impulse filter. The
convolving code detects the impulse filters and calculates this directly
(it is possible the impulse filter calculating function, which returns 1.0,
is not necessary as it is never called?).

The proper result of impulse+impulse is 1.0 when the subsample is in the
pixel center and 0.0 otherwise. But I don't think the result is useful (it
means there are dots where the pixel centers line up). Also it would
require the code to handle un-normalized filters which would complicate it
a good deal. So I just made it produce the same as BOX.IMPULSE (ie nearest
pixel).


>
>        Oded
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pixman/attachments/20151222/bdbcf349/attachment.html>


More information about the Pixman mailing list