Commit 9d34012b authored by Yiting Shao's avatar Yiting Shao Committed by David Flynn
Browse files

attr/m48894: introduce neighbour bias LoD predictor construction

This adoption allows determining the weights of each point's
predicting neighbours with a reduced influence of the, for
instance, z component.
parent a96dda0c
......@@ -36,6 +36,7 @@ categories:
-
- !conditional '"${group}" =~ m{^cat3}'
- lodDecimation: 1
- lod_neigh_bias: ${seq_lod_bias}
##
# attribute coding -- reflectance
......
......@@ -45,6 +45,7 @@ categories:
-
- !conditional '"${group}" =~ m{^cat3}'
- lodDecimation: 1
- lod_neigh_bias: ${seq_lod_bias}
##
# attribute coding -- reflectance
......
......@@ -39,6 +39,7 @@ categories:
-
- !conditional '"${group}" =~ m{^cat3}'
- levelOfDetailCount: 0
- lod_neigh_bias: ${seq_lod_bias}
- positionQuantizationScaleAdjustsDist2: 1
- dist2: ${seq_dist2}
- intraLodPredictionEnabled: 1
......
......@@ -35,6 +35,7 @@ categories:
-
- !conditional '"${group}" =~ m{^cat3}'
- levelOfDetailCount: 0
- lod_neigh_bias: ${seq_lod_bias}
- positionQuantizationScaleAdjustsDist2: 1
- dist2: ${seq_dist2}
- intraLodPredictionEnabled: 1
......
......@@ -8,6 +8,7 @@ sequences:
# precision is actually (21, 20, 16)
src-geometry-precision: 21
seq_lod: 10
seq_lod_bias: '1,1,2'
seq_dist2: 8192
has_refl: 1
has_colour: 1
......@@ -23,6 +24,7 @@ sequences:
# precision is actually (20, 20, 16)
src-geometry-precision: 20
seq_lod: 10
seq_lod_bias: '1,1,2'
seq_dist2: 16384
has_refl: 1
has_colour: 1
......@@ -38,6 +40,7 @@ sequences:
# precision is actually (21, 20, 17)
src-geometry-precision: 21
seq_lod: 10
seq_lod_bias: '1,1,2'
seq_dist2: 16384
has_refl: 1
has_colour: 1
......@@ -57,6 +60,7 @@ sequences:
group: cat3-frame
src-geometry-precision: 18
seq_lod: 10
seq_lod_bias: '1,1,8'
seq_dist2: 16384
has_refl: 1
bitdepth_refl: 8
......@@ -72,6 +76,7 @@ sequences:
group: cat3-frame
src-geometry-precision: 18
seq_lod: 10
seq_lod_bias: '1,1,8'
seq_dist2: 16384
has_refl: 1
bitdepth_refl: 8
......@@ -87,6 +92,7 @@ sequences:
group: cat3-frame
src-geometry-precision: 18
seq_lod: 10
seq_lod_bias: '1,1,8'
seq_dist2: 16384
has_refl: 1
bitdepth_refl: 8
......@@ -104,6 +110,7 @@ sequences:
group: cat3-frame
src-geometry-precision: 18
seq_lod: 10
seq_lod_bias: '1,1,8'
seq_dist2: 16384
has_refl: 1
bitdepth_refl: 8
......@@ -121,6 +128,7 @@ sequences:
group: cat3-frame
src-geometry-precision: 18
seq_lod: 10
seq_lod_bias: '1,1,8'
seq_dist2: 16384
has_refl: 1
bitdepth_refl: 8
......@@ -138,6 +146,7 @@ sequences:
group: cat3-frame
src-geometry-precision: 18
seq_lod: 10
seq_lod_bias: '1,1,8'
seq_dist2: 16384
has_refl: 1
bitdepth_refl: 8
......@@ -155,6 +164,7 @@ sequences:
group: cat3-frame
src-geometry-precision: 18
seq_lod: 10
seq_lod_bias: '1,1,8'
seq_dist2: 16384
has_refl: 1
bitdepth_refl: 8
......
......@@ -36,6 +36,7 @@ categories:
-
- !conditional '"${group}" =~ m{^cat3}'
- lodDecimation: 1
- lod_neigh_bias: ${seq_lod_bias}
- positionQuantizationScaleAdjustsDist2: 1
- dist2: ${seq_dist2}
......
......@@ -348,6 +348,11 @@ Attribute's number of levels of detail.
Attribute's list of squared distances, or initial value for automatic
derivation.
### `--lod_neigh_bias=INT-VALUE-LIST`
A set of three bias factors corresponding to the first, second and third
geometry axes used to weight nearest neighbours during the LoD generation
and weighting processes. The value `1,1,1` implies no bias.
### `--qp=INT-VALUE`
Attribute's luma quantization parameter.
......
......@@ -331,6 +331,16 @@ struct Box3 {
}
};
//---------------------------------------------------------------------------
// element-wise multiplication of two vectors
template<typename T>
Vec3<T>
times(Vec3<T> lhs, const Vec3<T>& rhs)
{
return Vec3<T>{lhs[0] * rhs[0], lhs[1] * rhs[1], lhs[2] * rhs[2]};
}
//---------------------------------------------------------------------------
typedef DEPRECATED_MSVC Vec3<double> PCCVector3D DEPRECATED;
......
......@@ -666,7 +666,7 @@ computeNearestNeighbors(
aps.scalable_lifting_enabled_flag, nodeSizeLog2,
pointCloud[pointIndex1]);
double norm2 = (point - point1).getNorm2();
double norm2 = times(point - point1, aps.lod_neigh_bias).getNorm2();
if (nodeSizeLog2 > 0 && point == point1) {
norm2 = double(1 << (nodeSizeLog2 - 1));
norm2 = norm2 * norm2;
......@@ -696,7 +696,8 @@ computeNearestNeighbors(
aps.scalable_lifting_enabled_flag, nodeSizeLog2,
pointCloud[pointIndex1]);
double norm2 = (point - point1).getNorm2();
double norm2 =
times(point - point1, aps.lod_neigh_bias).getNorm2();
if (nodeSizeLog2 > 0 && point == point1) {
norm2 = (double)(1 << (nodeSizeLog2 - 1));
norm2 = norm2 * norm2;
......@@ -720,7 +721,7 @@ computeNearestNeighbors(
const int32_t pointIndex1 = packedVoxel[indexes[startIndex + k]].index;
const auto& point1 = pointCloud[pointIndex1];
predictor.insertNeighbor(
pointIndex1, (point - point1).getNorm2(),
pointIndex1, times(point - point1, aps.lod_neigh_bias).getNorm2(),
aps.num_pred_nearest_neighbours,
startIndex + k - i + 2 * aps.search_range);
}
......@@ -742,7 +743,8 @@ computeNearestNeighbors(
packedVoxel[indexes[startIndex + k]].index;
const auto& point1 = pointCloud[pointIndex1];
predictor.insertNeighbor(
pointIndex1, (point - point1).getNorm2(),
pointIndex1,
times(point - point1, aps.lod_neigh_bias).getNorm2(),
aps.num_pred_nearest_neighbours,
startIndex + k - i + 2 * aps.search_range);
}
......
......@@ -556,6 +556,10 @@ ParseParameters(int argc, char* argv[], Parameters& params)
params_attr.aps.search_range, 128,
"Range for nearest neighbor search")
("lod_neigh_bias",
params_attr.aps.lod_neigh_bias, {1, 1, 1},
"Attribute's intra prediction weight for Z axis")
("lodDecimation",
params_attr.aps.lod_decimation_enabled_flag, false,
"Controls LoD generation method:\n"
......
......@@ -279,6 +279,7 @@ struct AttributeParameterSet {
int max_num_direct_predictors;
int adaptive_prediction_threshold;
int search_range;
Vec3<double> lod_neigh_bias;
bool intra_lod_prediction_enabled_flag;
// NB: derived from num_detail_levels_minus1
......
......@@ -278,6 +278,9 @@ write(const AttributeParameterSet& aps)
if (isLifting) {
bs.writeUe(aps.num_pred_nearest_neighbours);
bs.writeUe(aps.num_detail_levels);
bs.writeUe(aps.lod_neigh_bias.x());
bs.writeUe(aps.lod_neigh_bias.y());
bs.writeUe(aps.lod_neigh_bias.z());
if (aps.attr_encoding == AttributeEncoding::kLiftingTransform)
bs.write(aps.scalable_lifting_enabled_flag);
......@@ -333,6 +336,9 @@ parseAps(const PayloadBuffer& buf)
if (isLifting) {
bs.readUe(&aps.num_pred_nearest_neighbours);
bs.readUe(&aps.num_detail_levels);
bs.readUe(&aps.lod_neigh_bias.x());
bs.readUe(&aps.lod_neigh_bias.y());
bs.readUe(&aps.lod_neigh_bias.z());
aps.scalable_lifting_enabled_flag = false;
if (aps.attr_encoding == AttributeEncoding::kLiftingTransform)
......
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