Video quality optimization in adaptive streaming