Optimize MovingFrameComparator

Store precomputed number of different pixels for each column, update
counts when increasing row (moving frame down).