fix the range of SAD
Merge pull request #279 from sijchen/sad_fix2

fix the range of SAD