Avoid a float division per block

The difference in speed is barely noticeable, but still.
Add caches and calculate each SAD only once

This makes it ~33% faster here. Sadly most of that comes from the
caching, not from my brilliant idea.