encoder: h264: improve automatic bitrate calculation.