26 unsigned long pw_lsb = (mask >> 1) * 0x0001000100010001ULL;
27 unsigned long pw_msb = pw_lsb + 0x0001000100010001ULL;
28 for (i = 0; i <= w - (int)
sizeof(
long)/2; i +=
sizeof(long)/2) {
29 long a = *(
long*)(src+i);
30 long b = *(
long*)(dst+i);
31 *(
long*)(dst+i) = ((a&pw_lsb) + (b&pw_lsb)) ^ ((a^b)&pw_msb);
34 dst[i] = (dst[i] + src[i]) &
mask;
37 static void diff_int16_c(uint16_t *dst,
const uint16_t *src1,
const uint16_t *src2,
unsigned mask,
int w){
39 #if !HAVE_FAST_UNALIGNED
40 if((
long)src2 & (
sizeof(
long)-1)){
41 for(i=0; i+3<w; i+=4){
42 dst[i+0] = (src1[i+0]-src2[i+0]) & mask;
43 dst[i+1] = (src1[i+1]-src2[i+1]) & mask;
44 dst[i+2] = (src1[i+2]-src2[i+2]) & mask;
45 dst[i+3] = (src1[i+3]-src2[i+3]) & mask;
50 unsigned long pw_lsb = (mask >> 1) * 0x0001000100010001ULL;
51 unsigned long pw_msb = pw_lsb + 0x0001000100010001ULL;
53 for (i = 0; i <= w - (int)
sizeof(
long)/2; i +=
sizeof(long)/2) {
54 long a = *(
long*)(src1+i);
55 long b = *(
long*)(src2+i);
56 *(
long*)(dst+i) = ((a|pw_msb) - (b&pw_lsb)) ^ ((a^b^pw_msb)&pw_msb);
60 dst[i] = (src1[i] - src2[i]) &
mask;
71 l = (
mid_pred(l, src[i], (l + src[i] - lt) & mask) + diff[i]) & mask;
88 const int pred =
mid_pred(l, src1[i], (l + src1[i] - lt) & mask);
91 dst[i] = (l -
pred) & mask;
101 for(i=0; i<w-1; i++){