High field magnetoresistance of (TMTSF)2ClO4 and (TMTSF)2PF6. Quantum effects and phase transitions