A method of encoding a point cloud to generate a bitstream of compressed point cloud data representing a three-dimensional location of an object, the point cloud being located within a volumetric space recursively split into sub-volumes and containing points of the point cloud, wherein a current volume is partitioned into a first set of child sub-volumes and a second set of child sub-volumes, the first set of child sub-volumes being positioned in a first plane and the second set of child sub-volumes being positioned in a second plane parallel to the first plane, and wherein an occupancy bit associated with each respective child sub-volume indicates whether that respective child sub-volume contains at least one of the points, both the first plane and the second plane being orthogonal to an axis, the method comprising: determining whether the current volume is planar based on whether all child sub-volumes containing at least one point are positioned in either the first set or the second set; tracking already-encoded occupied volume data for positions on the axis, wherein the tracking includes storing, in a data structure, volume data for at least one already-encoded occupied volume, characterized in that one or both of an index in the data structure and representative position data for the at least one already-encoded occupied volume is obtained based on applying a hash function to coordinates data for said at least one already-encoded occupied volume; and further characterized by obtaining an index in the data structure for the current volume based on applying the hash function to coordinates data for the current volume, wherein the coordinates data for the current volume comprises position data on the axis for the current volume, and wherein the hash function assigns the index in the data structure to the current volume based on the lowest N bits of the position data on the axis for the current volume; entropy encoding in the bitstream a planar mode flag to signal whether the current volume is planar, wherein the entropy encoding includes determining a context for coding the planar mode flag based on a distance between the current volume and a closest already-encoded occupied volume among those tracked already-encoded occupied volumes that have a same index in the data structure as the current volume; encoding occupancy bits for at least some of the child sub-volumes; and outputting the bitstream of compressed point cloud data. determining whether the current volume is planar based on whether all child sub-volumes containing at least one point are positioned in either the first set or the second set; tracking already-encoded occupied volume data for positions on the axis, wherein the tracking includes storing, in a data structure, volume data for at least one already-encoded occupied volume, one or both of an index in the data structure and representative position data for the at least one already-encoded occupied volume is obtained based on applying a hash function to coordinates data for said at least one already-encoded occupied volume; and further characterized by obtaining an index in the data structure for the current volume based on applying the hash function to coordinates data for the current volume, wherein the coordinates data for the current volume comprises position data on the axis for the current volume, and wherein the hash function assigns the index in the data structure to the current volume based on the lowest N bits of the position data on the axis for the current volume; entropy encoding in the bitstream a planar mode flag to signal whether the current volume is planar, wherein the entropy encoding includes determining a context for coding the planar mode flag based on a distance between the current volume and a closest already-encoded occupied volume among those tracked already-encoded occupied volumes that have a same index in the data structure as the current volume; encoding occupancy bits for at least some of the child sub-volumes; and outputting the bitstream of compressed point cloud data.