本人水平比较菜,下面这个函数怎么看都看不出功能,主要是X7在这里的功能是什么。请教热心人士帮忙解答一下。
__inline int32 sad_4pixel(int32 src1, int32 src2, int32 mask)
{
int32 x7;
x7 = src2 ^ src1; /* check odd/even combination */
if ((uint32)src2 >= (uint32)src1)
{
src1 = src2 - src1; /* subs */
}
else
{
src1 = src1 - src2;
}
x7 = x7 ^ src1; /* only odd bytes need to add carry */
x7 = mask & ((uint32)x7 >> 1);
x7 = (x7 << 8) - x7;
src1 = src1 + (x7 >> 7); /* add 0xFF to the negative byte, add back carry */
src1 = src1 ^(x7 >> 7); /* take absolute value of negative byte */
return src1;
}