swscale: refactor horizontal scaling