diff options
author | Matt Turner <mattst88@gmail.com> | 2013-01-30 21:00:31 -0800 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2014-03-13 20:00:56 -0700 |
commit | c57211d3825c8be5c4b5b9197e6720f59e8425a8 (patch) | |
tree | bd0e9d9a672788e9e6e50cdd0e55b51c431e8025 | |
parent | a144f6a3acc59069fa731e94edec5cfd44d70e02 (diff) |
mmx: faster bilinear interpolation (get rid of XOR instruction)mmx-nearest
This is a port of Siarhei's commit d768558ce to the MMX code.
-rw-r--r-- | pixman/pixman-mmx.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c index fe0a027..7aa3347 100644 --- a/pixman/pixman-mmx.c +++ b/pixman/pixman-mmx.c @@ -3670,11 +3670,10 @@ FAST_NEAREST_MAINLOOP_COMMON (mmx_8888_n_8888_normal_OVER, #define BILINEAR_DECLARE_VARIABLES \ const __m64 mm_wt = _mm_set_pi16 (wt, wt, wt, wt); \ const __m64 mm_wb = _mm_set_pi16 (wb, wb, wb, wb); \ - const __m64 mm_addc7 = _mm_set_pi16 (0, 1, 0, 1); \ - const __m64 mm_xorc7 = _mm_set_pi16 (0, BMSK, 0, BMSK); \ - const __m64 mm_ux = _mm_set_pi16 (unit_x, unit_x, unit_x, unit_x); \ + const __m64 mm_addc = _mm_set_pi16 (0, 1, 0, 1); \ + const __m64 mm_ux = _mm_set_pi16 (unit_x, -unit_x, unit_x, -unit_x); \ const __m64 mm_zero = _mm_setzero_si64 (); \ - __m64 mm_x = _mm_set_pi16 (vx, vx, vx, vx) + __m64 mm_x = _mm_set_pi16 (vx, -(vx + 1), vx, -(vx + 1)) #define BILINEAR_INTERPOLATE_ONE_PIXEL(pix) \ do { \ @@ -3689,9 +3688,8 @@ do { \ __m64 hi = _mm_add_pi16 (t_hi, b_hi); \ __m64 lo = _mm_add_pi16 (t_lo, b_lo); \ /* calculate horizontal weights */ \ - __m64 mm_wh = _mm_add_pi16 (mm_addc7, _mm_xor_si64 (mm_xorc7, \ - _mm_srli_pi16 (mm_x, \ - 16 - BILINEAR_INTERPOLATION_BITS))); \ + __m64 mm_wh = _mm_add_pi16 (mm_addc, _mm_srli_pi16 (mm_x, \ + 16 - BILINEAR_INTERPOLATION_BITS)); \ /* horizontal interpolation */ \ __m64 p = _mm_unpacklo_pi16 (lo, hi); \ __m64 q = _mm_unpackhi_pi16 (lo, hi); \ |