Efficient algorithms for scalable video coding