[Pixman] [PATCH 34/37] armv6: Add fetcher for x8r8g8b8 bilinear-interpolation scaled images

Ben Avison bavison at riscosopen.org
Tue Sep 9 11:51:42 PDT 2014


This is constrained to support X increments in the positive X direction only.
It also doesn't attempt to support any form of image repeat.

Here are some affine-bench results for a variety of horizontal and vertical
scaling factors.

Before:
    x increment   0.5   0.75  1.0   1.5   2.0
y increment
    0.5            3.9   3.8   3.7   3.6   3.4
    0.75           3.8   3.8   3.7   3.5   3.3
    1.0            3.8   3.7         3.5   3.3
    1.5            3.7   3.6   3.5   3.3   3.1
    2.0            3.6   3.5   3.4   3.2   3.0

After:
    x increment   0.5   0.75  1.0   1.5   2.0
y increment
    0.5           20.8  19.3  18.8  19.6  18.4
    0.75          17.8  16.2  15.7  16.6  15.2
    1.0           21.3  18.4        18.9  16.9
    1.5           12.5  11.1  10.5  11.4  10.2
    2.0           10.5   9.1   8.7   9.4   8.3

Improvement:
    x increment   0.5     0.75    1.0     1.5     2.0
y increment
    0.5           +436.3% +406.2% +402.8% +448.2% +437.9%
    0.75          +364.2% +330.4% +324.7% +372.3% +354.5%
    1.0           +461.5% +392.4%         +446.9% +415.9%
    1.5           +236.3% +204.8% +198.8% +242.2% +224.1%
    2.0           +187.0% +156.5% +154.3% +193.3% +177.1%
---
 pixman/pixman-arm-simd-asm-scaled.S |    8 ++++++++
 pixman/pixman-arm-simd.c            |   26 ++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/pixman/pixman-arm-simd-asm-scaled.S b/pixman/pixman-arm-simd-asm-scaled.S
index 85ca212..81da932 100644
--- a/pixman/pixman-arm-simd-asm-scaled.S
+++ b/pixman/pixman-arm-simd-asm-scaled.S
@@ -211,6 +211,14 @@ generate_nearest_scaled_cover_function \
 
 generate_bilinear_scaled_cover_functions  32, a8r8g8b8, 3, 3, 3, 3, 3, 3, 3, 3, nop_macro, convert_8888_08080808
 
+.macro convert_x888_08080808  in_ag, rb
+        uxtb16  \rb, \in_ag
+        uxtb    \in_ag, \in_ag, ror #8
+        orr     \in_ag, \in_ag, #0xFF0000
+.endm
+
+generate_bilinear_scaled_cover_functions  32, x8r8g8b8, 3, 3, 3, 3, 3, 3, 3, 3, nop_macro, convert_x888_08080808
+
 /******************************************************************************/
 
 .macro pass2_1pixel_internal  t0, t1, b0, b1, tmp, mul, d
diff --git a/pixman/pixman-arm-simd.c b/pixman/pixman-arm-simd.c
index f783c17..141fffd 100644
--- a/pixman/pixman-arm-simd.c
+++ b/pixman/pixman-arm-simd.c
@@ -412,6 +412,24 @@ static inline void armv6_convert_adjacent_a8r8g8b8 (const void *void_source,
 
 BIND_GET_SCANLINE_BILINEAR_SCALED_COVER(armv6, a8r8g8b8, uint32_t)
 
+static inline void armv6_convert_adjacent_x8r8g8b8 (const void *void_source,
+                                                    int         x,
+                                                    uint32_t   *lag,
+                                                    uint32_t   *rag,
+                                                    uint32_t   *lrb,
+                                                    uint32_t   *rrb)
+{
+    const uint32_t *source = void_source;
+    uint32_t left  = source[x];
+    uint32_t right = source[x+1];
+    *lag = ((left & 0xff00) >> 8) | 0x00ff0000;
+    *rag = ((right & 0xff00) >> 8) | 0x00ff0000;
+    *lrb = (left & 0x00ff00ff);
+    *rrb = (right & 0x00ff00ff);
+}
+
+BIND_GET_SCANLINE_BILINEAR_SCALED_COVER(armv6, x8r8g8b8, uint32_t)
+
 #define NEAREST_SCALED_COVER_USES_SRC_BUFFER(op, src_format, dst_format) \
     (PIXMAN_OP_##op != PIXMAN_OP_SRC ||                                  \
      (PIXMAN_##dst_format != PIXMAN_a8r8g8b8 &&                          \
@@ -774,6 +792,14 @@ static const pixman_iter_info_t arm_simd_iters[] =
       NULL
     },
 
+    { PIXMAN_x8r8g8b8,
+      PIXMAN_ARM_BILINEAR_SCALED_COVER_FLAGS,
+      ITER_NARROW | ITER_SRC,
+      armv6_get_scanline_bilinear_init_x8r8g8b8,
+      armv6_get_scanline_bilinear_scaled_cover_x8r8g8b8,
+      NULL
+    },
+
     { PIXMAN_r5g6b5,
       (FAST_PATH_STANDARD_FLAGS             |
        FAST_PATH_ID_TRANSFORM               |
-- 
1.7.5.4



More information about the Pixman mailing list