Commit 7030e44b authored by David Flynn's avatar David Flynn
Browse files

attr: make LoD sharing determination more robust

Avoids testing undefined APS parameters by using the HLS signalling
order (and guards) to determine compatibility.
parent 08880f88
...@@ -66,11 +66,17 @@ AttributeLods::generate( ...@@ -66,11 +66,17 @@ AttributeLods::generate(
bool bool
AttributeLods::isReusable(const AttributeParameterSet& aps) const AttributeLods::isReusable(const AttributeParameterSet& aps) const
{ {
// No LoDs cached => can be reused by anything
if (numPointsInLod.empty()) if (numPointsInLod.empty())
return true; return true;
if (_aps.lod_decimation_enabled_flag != aps.lod_decimation_enabled_flag) // If the other aps doesn't use LoDs, it is compatible.
return false; // Otherwise, if both use LoDs, check each parameter
if (!(_aps.lodParametersPresent() && aps.lodParametersPresent()))
return true;
// NB: the following comparison order needs to be the same as the i/o
// order otherwise comparisons may involve undefined values
if (_aps.num_pred_nearest_neighbours != aps.num_pred_nearest_neighbours) if (_aps.num_pred_nearest_neighbours != aps.num_pred_nearest_neighbours)
return false; return false;
...@@ -78,22 +84,25 @@ AttributeLods::isReusable(const AttributeParameterSet& aps) const ...@@ -78,22 +84,25 @@ AttributeLods::isReusable(const AttributeParameterSet& aps) const
if (_aps.search_range != aps.search_range) if (_aps.search_range != aps.search_range)
return false; return false;
if (_aps.num_detail_levels != aps.num_detail_levels)
return false;
if (_aps.lod_neigh_bias != aps.lod_neigh_bias) if (_aps.lod_neigh_bias != aps.lod_neigh_bias)
return false; return false;
if ( // until this feature is stable, always generate LoDs.
_aps.intra_lod_prediction_enabled_flag if (_aps.scalable_lifting_enabled_flag || aps.scalable_lifting_enabled_flag)
!= aps.intra_lod_prediction_enabled_flag)
return false; return false;
if (_aps.num_detail_levels != aps.num_detail_levels) if (_aps.lod_decimation_enabled_flag != aps.lod_decimation_enabled_flag)
return false; return false;
if (_aps.dist2 != aps.dist2) if (_aps.dist2 != aps.dist2)
return false; return false;
// until this feature is stable, always generate LoDs. if (
if (_aps.scalable_lifting_enabled_flag || aps.scalable_lifting_enabled_flag) _aps.intra_lod_prediction_enabled_flag
!= aps.intra_lod_prediction_enabled_flag)
return false; return false;
return true; return true;
......
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