34 static int pix_norm1_altivec(
uint8_t *pix,
int line_size)
37 const vector
unsigned int zero =
38 (
const vector
unsigned int) vec_splat_u32(0);
39 vector
unsigned char perm = vec_lvsl(0, pix);
40 vector
unsigned int sv = (vector
unsigned int) vec_splat_u32(0);
41 vector
signed int sum;
43 for (i = 0; i < 16; i++) {
45 vector
unsigned char pixl = vec_ld(0, pix);
46 vector
unsigned char pixr = vec_ld(15, pix);
47 vector
unsigned char pixv = vec_perm(pixl, pixr, perm);
50 sv = vec_msum(pixv, pixv, sv);
55 sum = vec_sums((vector
signed int) sv, (vector
signed int) zero);
56 sum = vec_splat(sum, 3);
62 static int pix_sum_altivec(
uint8_t *pix,
int line_size)
65 const vector
unsigned int zero =
66 (
const vector
unsigned int) vec_splat_u32(0);
67 vector
unsigned char perm = vec_lvsl(0, pix);
68 vector
unsigned int sad = (vector
unsigned int) vec_splat_u32(0);
69 vector
signed int sumdiffs;
71 for (i = 0; i < 16; i++) {
73 vector
unsigned char pixl = vec_ld(0, pix);
74 vector
unsigned char pixr = vec_ld(15, pix);
75 vector
unsigned char t1 = vec_perm(pixl, pixr, perm);
78 sad = vec_sum4s(t1, sad);
84 sumdiffs = vec_sums((vector
signed int) sad, (vector
signed int) zero);
85 sumdiffs = vec_splat(sumdiffs, 3);
86 vec_ste(sumdiffs, 0, &s);