Elimitated a single math operation from the frame size check.

Experimented with using a flat array and shifts - it was slower.