|
|
|
@@ -67,10 +67,10 @@ static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, |
|
|
|
ptrdiff_t line_size) |
|
|
|
{ |
|
|
|
int i; |
|
|
|
vec_u8 perm = vec_lvsl(0, pixels); |
|
|
|
const vec_u8 zero = (const vec_u8)vec_splat_u8(0); |
|
|
|
|
|
|
|
for (i = 0; i < 8; i++) { |
|
|
|
vec_u8 perm = vec_lvsl(0, pixels); |
|
|
|
/* Read potentially unaligned pixels. |
|
|
|
* We're reading 16 pixels, and actually only want 8, |
|
|
|
* but we simply ignore the extras. */ |
|
|
|
@@ -157,8 +157,7 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1, |
|
|
|
const uint8_t *s2, int stride) |
|
|
|
{ |
|
|
|
int i; |
|
|
|
vec_u8 perm1 = vec_lvsl(0, s1); |
|
|
|
vec_u8 perm2 = vec_lvsl(0, s2); |
|
|
|
vec_u8 perm; |
|
|
|
const vec_u8 zero = (const vec_u8)vec_splat_u8(0); |
|
|
|
vec_s16 shorts1, shorts2; |
|
|
|
|
|
|
|
@@ -166,17 +165,19 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1, |
|
|
|
/* Read potentially unaligned pixels. |
|
|
|
* We're reading 16 pixels, and actually only want 8, |
|
|
|
* but we simply ignore the extras. */ |
|
|
|
perm = vec_lvsl(0, s1); |
|
|
|
vec_u8 pixl = vec_ld(0, s1); |
|
|
|
vec_u8 pixr = vec_ld(15, s1); |
|
|
|
vec_u8 bytes = vec_perm(pixl, pixr, perm1); |
|
|
|
vec_u8 bytes = vec_perm(pixl, pixr, perm); |
|
|
|
|
|
|
|
// Convert the bytes into shorts. |
|
|
|
shorts1 = (vec_s16)vec_mergeh(zero, bytes); |
|
|
|
|
|
|
|
// Do the same for the second block of pixels. |
|
|
|
perm = vec_lvsl(0, s2); |
|
|
|
pixl = vec_ld(0, s2); |
|
|
|
pixr = vec_ld(15, s2); |
|
|
|
bytes = vec_perm(pixl, pixr, perm2); |
|
|
|
bytes = vec_perm(pixl, pixr, perm); |
|
|
|
|
|
|
|
// Convert the bytes into shorts. |
|
|
|
shorts2 = (vec_s16)vec_mergeh(zero, bytes); |
|
|
|
@@ -197,17 +198,19 @@ static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1, |
|
|
|
/* Read potentially unaligned pixels. |
|
|
|
* We're reading 16 pixels, and actually only want 8, |
|
|
|
* but we simply ignore the extras. */ |
|
|
|
perm = vec_lvsl(0, s1); |
|
|
|
pixl = vec_ld(0, s1); |
|
|
|
pixr = vec_ld(15, s1); |
|
|
|
bytes = vec_perm(pixl, pixr, perm1); |
|
|
|
bytes = vec_perm(pixl, pixr, perm); |
|
|
|
|
|
|
|
// Convert the bytes into shorts. |
|
|
|
shorts1 = (vec_s16)vec_mergeh(zero, bytes); |
|
|
|
|
|
|
|
// Do the same for the second block of pixels. |
|
|
|
perm = vec_lvsl(0, s2); |
|
|
|
pixl = vec_ld(0, s2); |
|
|
|
pixr = vec_ld(15, s2); |
|
|
|
bytes = vec_perm(pixl, pixr, perm2); |
|
|
|
bytes = vec_perm(pixl, pixr, perm); |
|
|
|
|
|
|
|
// Convert the bytes into shorts. |
|
|
|
shorts2 = (vec_s16)vec_mergeh(zero, bytes); |
|
|
|
|