Branchless calculation of ref_offset.