A Rate Control Algorithm for the H.264 Encoder