Optimized pipelining of update_hspeed and update_vspeed