point and box encoding/decoding