An Efficient Scene Coordinate Encoding and Relocalization Method