Improve remap calculation efficiency.