8a6af9f98f
Changed calculations to use shifts instead of if-then-else. Eliminates branches. Change-Id: I11b75e8bb305301ffd9cb577fb7df059a3cf9ea4