Simultaneous inversion of velocity distribution and interface positions