const vector unsigned char zero = (const vector unsigned char)(0);
const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0);
int pix_abs16x16_x2_altivec(uint8_t *pix1, uint8_t *pix2, int line_size){    int i;    int s __attribute__((aligned(16)));    const vector unsigned char zero = (const vector unsigned char)(0);    vector unsigned char *tv;    vector unsigned char pix1v, pix2v, pix2iv, avgv, t5;    vector unsigned int sad;    vector signed int sumdiffs;    s = 0;    sad = (vector unsigned int)(0);    for(i=0;i<16;i++) {        /*           Read unaligned pixels into our vectors. The vectors are as follows:           pix1v: pix1[0]-pix1[15]           pix2v: pix2[0]-pix2[15]	pix2iv: pix2[1]-pix2[16]        */        tv = (vector unsigned char *) pix1;        pix1v = vec_perm(tv[0], tv[1], vec_lvsl(0, pix1));                tv = (vector unsigned char *) &pix2[0];        pix2v = vec_perm(tv[0], tv[1], vec_lvsl(0, &pix2[0]));        tv = (vector unsigned char *) &pix2[1];        pix2iv = vec_perm(tv[0], tv[1], vec_lvsl(0, &pix2[1]));        /* Calculate the average vector */        avgv = vec_avg(pix2v, pix2iv);        /* Calculate a sum of abs differences vector */        t5 = vec_sub(vec_max(pix1v, avgv), vec_min(pix1v, avgv));        /* Add each 4 pixel group together and put 4 results into sad */        sad = vec_sum4s(t5, sad);                pix1 += line_size;        pix2 += line_size;    }    /* Sum up the four partial sums, and put the result into s */    sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);    sumdiffs = vec_splat(sumdiffs, 3);    vec_ste(sumdiffs, 0, &s);    return s;}