Optimal binary encoding scheme for the fast motion estimation based on Hamming distances