Energy spectrum and barrier localization of quantum well electrons in parallel magnetic fields