Commit 4b80ca8f authored by David Flynn's avatar David Flynn
Browse files

geom/m44753: guard adjacent child contextualization with a GPS flag

The commit adds a flag to conditionally enable/disable the feature.
parent 5af7b571
......@@ -172,6 +172,10 @@ respectively.
Controls the use of early termination of the geometry octree for
isolated points.
### `--adjacentChildContextualization=0|1`
Controls the contextualization of occupancy bits according to the
state of adjacent children of neighbouring nodes.
### `--intra_pred_max_node_size_log2=INT-VALUE`
Intra occupancy prediction uses an octree node's neighbours to predict
its occupancy. The prediction mode is enabled for octree nodes smaller
......
......@@ -134,6 +134,7 @@ updatePatternFromNeighOccupancy(
GeometryNeighPattern
makeGeometryNeighPattern(
bool adjacent_child_contextualization_enabled_flag,
const PCCVector3<uint32_t>& position,
const int nodeSizeLog2,
const MortonMap3D& occupancyAtlas)
......@@ -171,6 +172,9 @@ makeGeometryNeighPattern(
// the occupancy contextualisation bits.
GeometryNeighPattern gnp = {neighPattern, 0, 0};
if (!adjacent_child_contextualization_enabled_flag)
return gnp;
if (x > 0)
gnp = updatePatternFromNeighOccupancy(occupancyAtlas, x - 1, y, z, gnp, 0);
......
......@@ -166,10 +166,12 @@ struct GeometryNeighPattern {
};
//============================================================================
// determine the occupancy pattern of the six neighbours of the node at
// @position.
// @position. If @adjacent_child_contextualization_enabled_flag is true,
// the occupancy state of previously coded neighbours is used to refine
// the neighbour pattern and derive external adjacency counts for each child.
GeometryNeighPattern makeGeometryNeighPattern(
bool adjacent_child_contextualization_enabled_flag,
const PCCVector3<uint32_t>& currentPosition,
const int nodeSizeLog2,
const MortonMap3D& occupancyAtlas);
......
......@@ -363,6 +363,10 @@ ParseParameters(int argc, char* argv[], Parameters& params)
params.encoder.gps.inferred_direct_coding_mode_enabled_flag, true,
"Permits early termination of the geometry octree for isolated points")
("adjacentChildContextualization",
params.encoder.gps.adjacent_child_contextualization_enabled_flag, true,
"Occupancy contextualization using neighbouring adjacent children")
("intra_pred_max_node_size_log2",
params.encoder.gps.intra_pred_max_node_size_log2, 0,
"octree nodesizes eligible for occupancy intra prediction")
......
......@@ -451,8 +451,10 @@ decodeGeometryOctree(
node0.pos, nodeSizeLog2, fifo, fifoCurrLvlEnd, &occupancyAtlas,
&occupancyAtlasOrigin);
GeometryNeighPattern gnp =
makeGeometryNeighPattern(node0.pos, nodeSizeLog2, occupancyAtlas);
GeometryNeighPattern gnp = makeGeometryNeighPattern(
gps.adjacent_child_contextualization_enabled_flag, node0.pos,
nodeSizeLog2, occupancyAtlas);
node0.neighPattern = gnp.neighPattern;
occupancyAdjacencyGt0 = gnp.adjacencyGt0;
occupancyAdjacencyGt1 = gnp.adjacencyGt1;
......
......@@ -479,8 +479,10 @@ encodeGeometryOctree(
node0.pos, nodeSizeLog2, fifo, fifoCurrLvlEnd, &occupancyAtlas,
&occupancyAtlasOrigin);
GeometryNeighPattern gnp =
makeGeometryNeighPattern(node0.pos, nodeSizeLog2, occupancyAtlas);
GeometryNeighPattern gnp = makeGeometryNeighPattern(
gps.adjacent_child_contextualization_enabled_flag, node0.pos,
nodeSizeLog2, occupancyAtlas);
node0.neighPattern = gnp.neighPattern;
occupancyAdjacencyGt0 = gnp.adjacencyGt0;
occupancyAdjacencyGt1 = gnp.adjacencyGt1;
......
......@@ -190,6 +190,11 @@ struct GeometryParameterSet {
// Selects between bitwise and bytewise occupancy coding
bool bitwise_occupancy_coding_flag;
// Controlls contextualization of occupancy bits and refinement of
// the neighbour pattern according to the occupancy of adjacent
// children in neighbouring nodes.
bool adjacent_child_contextualization_enabled_flag;
// Experimental knob to control the number of contexts used
// for occupancy coding.
int geom_occupancy_ctx_reduction_factor;
......
......@@ -194,6 +194,7 @@ write(const GeometryParameterSet& gps)
bs.write(gps.neighbour_context_restriction_flag);
bs.write(gps.inferred_direct_coding_mode_enabled_flag);
bs.write(gps.bitwise_occupancy_coding_flag);
bs.write(gps.adjacent_child_contextualization_enabled_flag);
bs.writeUe(gps.geom_occupancy_ctx_reduction_factor);
bs.writeUe(gps.neighbour_avail_boundary_log2);
bs.writeUe(gps.intra_pred_max_node_size_log2);
......@@ -222,6 +223,7 @@ parseGps(const PayloadBuffer& buf)
bs.read(&gps.neighbour_context_restriction_flag);
bs.read(&gps.inferred_direct_coding_mode_enabled_flag);
bs.read(&gps.bitwise_occupancy_coding_flag);
bs.read(&gps.adjacent_child_contextualization_enabled_flag);
bs.readUe(&gps.geom_occupancy_ctx_reduction_factor);
bs.readUe(&gps.neighbour_avail_boundary_log2);
bs.readUe(&gps.intra_pred_max_node_size_log2);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment