Commit 5abf6659 authored by Toshiyasu Sugio's avatar Toshiyasu Sugio Committed by David Flynn
Browse files

attr/m49630: permit unconditional signalling of prediction index

This adoption permits removal of an arithmetic coding dependency in the
predicting lod scheme when lifting_adaptive_prediction_threshold is
equal to 0.
parent 5097aa9b
......@@ -234,6 +234,8 @@ AttributeDecoder::computeReflectancePredictionWeights(
PCCResidualsDecoder& decoder)
{
predictor.computeWeights();
int64_t maxDiff = 0;
if (predictor.neighborCount > 1) {
int64_t minValue = 0;
int64_t maxValue = 0;
......@@ -247,11 +249,11 @@ AttributeDecoder::computeReflectancePredictionWeights(
maxValue = reflectanceNeighbor;
}
}
const int64_t maxDiff = maxValue - minValue;
if (maxDiff > aps.adaptive_prediction_threshold) {
predictor.predMode =
decoder.decodePredMode(aps.max_num_direct_predictors);
}
maxDiff = maxValue - minValue;
}
if (maxDiff >= aps.adaptive_prediction_threshold) {
predictor.predMode = decoder.decodePredMode(aps.max_num_direct_predictors);
}
}
......@@ -314,6 +316,8 @@ AttributeDecoder::computeColorPredictionWeights(
PCCResidualsDecoder& decoder)
{
predictor.computeWeights();
int64_t maxDiff = 0;
if (predictor.neighborCount > 1) {
int64_t minValue[3] = {0, 0, 0};
int64_t maxValue[3] = {0, 0, 0};
......@@ -329,13 +333,13 @@ AttributeDecoder::computeColorPredictionWeights(
}
}
}
const int64_t maxDiff = (std::max)(
maxDiff = (std::max)(
maxValue[2] - minValue[2],
(std::max)(maxValue[0] - minValue[0], maxValue[1] - minValue[1]));
if (maxDiff > aps.adaptive_prediction_threshold) {
predictor.predMode =
decoder.decodePredMode(aps.max_num_direct_predictors);
}
}
if (maxDiff >= aps.adaptive_prediction_threshold) {
predictor.predMode = decoder.decodePredMode(aps.max_num_direct_predictors);
}
}
......
......@@ -407,7 +407,7 @@ AttributeEncoder::computeReflectancePredictionWeights(
const int64_t qs)
{
predictor.computeWeights();
predictor.maxDiff = -1;
predictor.maxDiff = 0;
if (predictor.neighborCount > 1) {
int64_t minValue = 0;
int64_t maxValue = 0;
......@@ -423,7 +423,7 @@ AttributeEncoder::computeReflectancePredictionWeights(
}
const int64_t maxDiff = maxValue - minValue;
predictor.maxDiff = maxDiff;
if (maxDiff > aps.adaptive_prediction_threshold) {
if (maxDiff >= aps.adaptive_prediction_threshold) {
uint64_t attrValue =
pointCloud.getReflectance(indexesLOD[predictorIndex]);
......@@ -530,7 +530,7 @@ AttributeEncoder::encodeReflectancesPred(
for (size_t predictorIndex = 0; predictorIndex < pointCount;
++predictorIndex) {
auto& predictor = predictors[predictorIndex];
if (predictor.maxDiff > aps.adaptive_prediction_threshold) {
if (predictor.maxDiff >= aps.adaptive_prediction_threshold) {
encoder.encodePredMode(
predictor.predMode, aps.max_num_direct_predictors);
}
......@@ -585,7 +585,7 @@ AttributeEncoder::computeColorPredictionWeights(
const int64_t qs2)
{
predictor.computeWeights();
predictor.maxDiff = -1;
predictor.maxDiff = 0;
if (predictor.neighborCount > 1) {
int64_t minValue[3] = {0, 0, 0};
int64_t maxValue[3] = {0, 0, 0};
......@@ -606,7 +606,7 @@ AttributeEncoder::computeColorPredictionWeights(
(std::max)(maxValue[0] - minValue[0], maxValue[1] - minValue[1]));
predictor.maxDiff = maxDiff;
if (maxDiff > aps.adaptive_prediction_threshold) {
if (maxDiff >= aps.adaptive_prediction_threshold) {
Vec3<uint8_t> attrValue =
pointCloud.getColor(indexesLOD[predictorIndex]);
......@@ -734,7 +734,7 @@ AttributeEncoder::encodeColorsPred(
for (size_t predictorIndex = 0; predictorIndex < pointCount;
++predictorIndex) {
auto& predictor = predictors[predictorIndex];
if (predictor.maxDiff > aps.adaptive_prediction_threshold) {
if (predictor.maxDiff >= aps.adaptive_prediction_threshold) {
encoder.encodePredMode(
predictor.predMode, aps.max_num_direct_predictors);
}
......
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