[Pixman] [PATCH 3/3] BILINEAR->NEAREST filter optimization for simple rotation and translation

Soeren Sandmann sandmann at cs.au.dk
Tue May 24 09:49:57 PDT 2011


Andrea Canciani <ranma42 at gmail.com> writes:

> On Mon, May 23, 2011 at 8:43 AM, Andrea Canciani <ranma42 at gmail.com> wrote:
>> On Sun, May 22, 2011 at 11:15 PM, Siarhei Siamashka
>> <siarhei.siamashka at gmail.com> wrote:
>>> From: Siarhei Siamashka <siarhei.siamashka at nokia.com>
>>>
>>> Simple rotation and translation are the additional cases when BILINEAR
>>> filter can be safely reduced to NEAREST.
>>
>> I believe that this reduction is valid for any matrix which describes
>> a unit transform followed
>> by an integer translation (i.e. rotation(90 degrees), scale(-1,1),
>> translate(1,0) composed
>> in any possible way).
>>
>> This happens whenever the translational component of the matrix is
>> integral, the projective
>> component is identity (already tested by AFFINE_TRANSFORM) and the
>> upper-left 2x2
>> matrix multiplied by its transpose results in the 2x2 identity.
>
> Uh, we already have an implementation of this (which is what cairo
> uses to optimize filters to nearest):
> http://cgit.freedesktop.org/cairo/tree/src/cairo-matrix.c#n728
> (lines 728-762)

See also this:

    http://permalink.gmane.org/gmane.comp.graphics.pixman/284


Soren


More information about the Pixman mailing list