Commit f805b3ce authored by David Flynn's avatar David Flynn
Browse files

cli: add cfg option to simplify dist2 specification

The dist2 values used by the pred/lift attribute coding schemes is
dependent upon the distances between points in the point cloud.  Using
the --positionQuantizationScale option to scale the input point cloud
therefore affects the required dist2 values.

This commit adds the --positionQuantizationScaleAdjustsDist2=1|0 option
to simplify the configuration of dist2.  When enabled, the encoder will
automatically scale any dist2 values by the squared position scale
parent 316c4aec
......@@ -46,6 +46,9 @@ using namespace pcc;
struct Parameters {
bool isDecoder;
// command line parsing should adjust dist2 values according to PQS
bool positionQuantizationScaleAdjustsDist2;
std::string uncompressedDataPath;
std::string compressedStreamPath;
std::string reconstructedDataPath;
......@@ -255,6 +258,10 @@ ParseParameters(int argc, char* argv[], Parameters& params)
params.encoder.sps.seq_source_geom_scale_factor, 1.f,
"Scale factor to be applied to point positions during quantization process")
params.positionQuantizationScaleAdjustsDist2, false,
"Scale dist2 values by squared positionQuantizationScale")
params.encoder.gps.geom_unique_points_flag, true,
"Enables removal of duplicated points")
......@@ -410,6 +417,17 @@ ParseParameters(int argc, char* argv[], Parameters& params)
// In order to simplify specification of dist2 values, which are
// depending on the scale of the coded point cloud, the following
// adjust the dist2 values according to PQS. The user need only
// specify the unquantised PQS value.
if (params.positionQuantizationScaleAdjustsDist2) {
double pqs = params.encoder.sps.seq_source_geom_scale_factor;
double pqs2 = pqs * pqs;
for (auto& dist2 : attr_aps.dist2)
dist2 = int64_t(std::round(pqs2 * dist2));
// Set default threshold based on bitdepth
if (attr_aps.adaptive_prediction_threshold == -1) {
attr_aps.adaptive_prediction_threshold = 1
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