[cairo] Concerns about using filters for downscaling

Søren Sandmann sandmann at cs.au.dk
Tue Mar 25 19:44:06 PDT 2014


Owen Taylor <otaylor at redhat.com> writes:

>> Also, the pixman convolution filter is designed to be implemented in a
>> separable way, but the current code doesn't do that. This optimization
>> should be another major speedup for filters with wide support such as as
>> Lanczos.
>
> What's the idea? Just an optimization of the per-pixel convolution?
> creating an intermediate image that is a 1D convolution of the source
> image and then convolving that the other way? (That seems only be
> possible for strict scales.)

Yes, in principle, but done in one pass. Instead of creating a full
intermediate image, just maintain k 1D convolved scanlines if the filter
has size k x k.

It is indeed only possible for pure scalings. That is a quite important
case though, and the standard BILINEAR filter is already doing this
optimization (See fast_fetch_bilinear_cover() and
ssse3_fetch_bilinear_cover()).


Søren


More information about the cairo mailing list