> if(histogram[0] || src[-stride]!=src2[-stride2]) > sum += 256*(bw*bh - histogram[0]); > return sum; > > should achive the same without the larger memset() Does ZMBV support blocks larger than 16x16? If so, this (and the current code, too) will break for such blocks. Dark Shikari