Joint inversion of quality factor based on upgoing and downgoing waves