A description of the algorithms used to set these flags is given in the documentation for omqualitymap- please refer to this for further details.