[Pixman] [PATCH 0/2] 7-bit bilinear interpolation precision
siarhei.siamashka at gmail.com
Sat Jun 30 08:28:20 PDT 2012
On Tue, Jun 26, 2012 at 6:13 AM, Jeff Muizelaar <jmuizelaar at mozilla.com> wrote:
> On 2012-06-25, at 7:44 PM, Siarhei Siamashka wrote:
>> These are the test patches for switching to 7-bit bilinear
>> interpolation precisions. The first patch makes bilinear precision
>> configurable. The second patch tweaks SSE2 bilinear scaler for better
>> performance using PMADDWD instruction. Both should be applied after:
> We recently switched to using the same precision as Skia on Android. (4 bits for RGBA32 and 2 bits for RGB565)
This is a good point. If using just 4 or even 2 bits of interpolation
precision is acceptable for Skia, then maybe the current bilinear
interpolation precision is really excessive in pixman. It would be too
generous to give a handicap to Skia :)
So should we also try 4-bit interpolation? Compared to 7-bit or 8-bit
interpolation, it has an advantage that all the calculations need only
16-bit unsigned variables. This is faster for at least C, x86 SSE2 and
ARM NEON code.
Reducing interpolation precision is simple, because the existing code
still can work correctly with lower precision assuming that it is
using BILINEAR_INTERPOLATION_BITS constant for shifts and bitmasks.
But going back is difficult after the code is optimized to take
advantage of lower precision for more speed.
More information about the Pixman