38 static void get_pixels_altivec(int16_t *restrict
block,
const uint8_t *pixels,
42 vector
unsigned char perm = vec_lvsl(0, pixels);
43 const vector
unsigned char zero =
44 (
const vector
unsigned char) vec_splat_u8(0);
46 for (i = 0; i < 8; i++) {
50 vector
unsigned char pixl = vec_ld(0, pixels);
51 vector
unsigned char pixr = vec_ld(7, pixels);
52 vector
unsigned char bytes = vec_perm(pixl, pixr, perm);
55 vector
signed short shorts = (vector
signed short) vec_mergeh(zero,
59 vec_st(shorts, i * 16, (vector
signed short *) block);
65 static void diff_pixels_altivec(int16_t *restrict block,
const uint8_t *
s1,
69 vector
unsigned char perm1 = vec_lvsl(0, s1);
70 vector
unsigned char perm2 = vec_lvsl(0, s2);
71 const vector
unsigned char zero =
72 (
const vector
unsigned char) vec_splat_u8(0);
73 vector
signed short shorts1, shorts2;
75 for (i = 0; i < 4; i++) {
79 vector
unsigned char pixl = vec_ld(0, s1);
80 vector
unsigned char pixr = vec_ld(15, s1);
81 vector
unsigned char bytes = vec_perm(pixl, pixr, perm1);
84 shorts1 = (vector
signed short) vec_mergeh(zero, bytes);
88 pixr = vec_ld(15, s2);
89 bytes = vec_perm(pixl, pixr, perm2);
92 shorts2 = (vector
signed short) vec_mergeh(zero, bytes);
95 shorts1 = vec_sub(shorts1, shorts2);
98 vec_st(shorts1, 0, (vector
signed short *) block);
110 pixl = vec_ld(0, s1);
111 pixr = vec_ld(15, s1);
112 bytes = vec_perm(pixl, pixr, perm1);
115 shorts1 = (vector
signed short) vec_mergeh(zero, bytes);
118 pixl = vec_ld(0, s2);
119 pixr = vec_ld(15, s2);
120 bytes = vec_perm(pixl, pixr, perm2);
123 shorts2 = (vector
signed short) vec_mergeh(zero, bytes);
126 shorts1 = vec_sub(shorts1, shorts2);
129 vec_st(shorts1, 0, (vector
signed short *) block);
141 unsigned high_bit_depth)
149 if (!high_bit_depth) {