[Pixman] [PATCH 12/15] pixman-filter: Turn off subsampling when not necessary
Oded Gabbay
oded.gabbay at gmail.com
Tue Dec 22 04:44:09 PST 2015
On Sat, Dec 12, 2015 at 8:06 PM, <spitzak at gmail.com> wrote:
> From: Bill Spitzak <spitzak at gmail.com>
>
> If sample is IMPULSE and reconstruct is BOX or IMPULSE the sub-pixel
> position of the sample is not relevant, so only one subsample is needed.
Why ?
I mean why it is not relevant ? and why only one subsample is needed ?
Oded
> ---
> pixman/pixman-filter.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c
> index 64981cd..7e10108 100644
> --- a/pixman/pixman-filter.c
> +++ b/pixman/pixman-filter.c
> @@ -230,6 +230,8 @@ filter_width (pixman_kernel_t reconstruct,
> pixman_kernel_t sample,
> double scale)
> {
> + if (reconstruct == PIXMAN_KERNEL_BOX && sample == PIXMAN_KERNEL_IMPULSE)
> + return 0;
> return ceil (scale * filters[sample].width + filters[reconstruct].width);
> }
>
> @@ -323,13 +325,13 @@ pixman_filter_create_separable_convolution (int *n_values,
> int subsample_x, subsample_y;
> int width, height;
>
> - subsample_x = (1 << subsample_bits_x);
> - subsample_y = (1 << subsample_bits_y);
> -
> width = filter_width (reconstruct_x, sample_x, sx);
> - if (width < 1) width = 1;
> + if (width < 1) { width = 1; subsample_bits_x = 0; }
> height = filter_width (reconstruct_y, sample_y, sy);
> - if (height < 1) height = 1;
> + if (height < 1) { height = 1; subsample_bits_y = 0; }
> +
> + subsample_x = (1 << subsample_bits_x);
> + subsample_y = (1 << subsample_bits_y);
>
> *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
More information about the Pixman
mailing list