<div dir="ltr"><div dir="ltr">I think you can force the interpolation to bilinear or impulse. However you are going to revert to 1980's style scaling with extreme aliasing.<div><br></div><div>This is some of my work from 4 years ago and unfortunately it never got finished due to rejection by the Pixman maintainers (who I think may not be working on it any more). This was to implement a two-pass algorithm in Pixman that could also do non-affine (perspective) transforms. It should be considerably faster for any down-scaling, even if the filter is set to bilinear. The current code is not 2-pass (in effect both passes are run for every output pixel, rather than saving the result of the first pass, this is in fact worse than convolving with a 2-D filter), but at least produces modern results.</div><div><br></div><div>The problem is that the filters cannot be specified as arrays of weights, due to the need to choose arbitrary filter sizes, both to allow non-affine transforms and just because most 2-pass algorithms require unexpected filter sizes (such as the derivative along the x axis of the input but the y axis of the output). IMHO the most practical way to get this is to just make "GOOD" and "BEST" select two implementation-chosen filters (BILINEAR and IMPULSE would also be allowed) and scrap any ability to specify the filter more accurately by the client. This seemed to produce considerable pushback in pixman and was rejected and I gave up after succeeding in getting the api implemented in Cairo.</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 16, 2019 at 10:38 AM Joshua Watt <<a href="mailto:jpewhacker@gmail.com">jpewhacker@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I recently upgrade from Cairo 1.12 to 1.14 (yes, I know these are old<br>
versions), and after doing so noticed a approximately 70% reduction in<br>
performance when rendering scenes that make heavy use of image scaling.<br>
I did some digging and tracking the offending commit down to the<br>
commit: f337342c8 ("V6 image: Use convolution filters for sample<br>
reconstruction when downscaling")<br>
<br>
It appears that this commit is attempting to improve the quality of<br>
downscaled images by implementing new interpolation algorithms in cairo<br>
instead of using the pixman algorithms. My theory is that this is much<br>
slower on ARM processes that have NEON support because pixman has<br>
special implementations of the interpolations algorithms written to<br>
take advantage of NEON, while the new cairo implementations do not.<br>
<br>
Does anyone have any ideas on what a good path forward would be to<br>
restore the ARM+NEON performance? I am planning on trying to reproduce<br>
this with a newer version of cairo to see if it is still a problem, but<br>
I suspect it will be based on the lack of any significant changes in<br>
this code to either cairo or pixman.<br>
<br>
-- <br>
Joshua Watt <<a href="mailto:JPEWhacker@gmail.com" target="_blank">JPEWhacker@gmail.com</a>><br>
<br>
-- <br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org" target="_blank">cairo@cairographics.org</a><br>
<a href="https://lists.cairographics.org/mailman/listinfo/cairo" rel="noreferrer" target="_blank">https://lists.cairographics.org/mailman/listinfo/cairo</a></blockquote></div>