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

refactor/m46245: use mortonAddr() for RAHT Morton code generation

This is part of a series that implements a single method of Cartesian to
Morton code conversion.
parent 6a598edf
......@@ -388,17 +388,7 @@ AttributeDecoder::decodeReflectancesRaht(
std::vector<MortonCodeWithIndex> packedVoxel(voxelCount);
for (int n = 0; n < voxelCount; n++) {
weight[n] = 1;
const auto position = pointCloud[n];
int x = int(position[0]);
int y = int(position[1]);
int z = int(position[2]);
uint64_t mortonCode = 0;
for (int b = 0; b < aps.raht_depth; b++) {
mortonCode |= (uint64_t)((x >> b) & 1) << (3 * b + 2);
mortonCode |= (uint64_t)((y >> b) & 1) << (3 * b + 1);
mortonCode |= (uint64_t)((z >> b) & 1) << (3 * b);
}
packedVoxel[n].mortonCode = mortonCode;
packedVoxel[n].mortonCode = mortonAddr(pointCloud[n], 0);
packedVoxel[n].index = n;
}
sort(packedVoxel.begin(), packedVoxel.end());
......@@ -456,17 +446,7 @@ AttributeDecoder::decodeColorsRaht(
std::vector<MortonCodeWithIndex> packedVoxel(voxelCount);
for (int n = 0; n < voxelCount; n++) {
weight[n] = 1;
const auto position = pointCloud[n];
int x = int(position[0]);
int y = int(position[1]);
int z = int(position[2]);
uint64_t mortonCode = 0;
for (int b = 0; b < aps.raht_depth; b++) {
mortonCode |= (uint64_t)((x >> b) & 1) << (3 * b + 2);
mortonCode |= (uint64_t)((y >> b) & 1) << (3 * b + 1);
mortonCode |= (uint64_t)((z >> b) & 1) << (3 * b);
}
packedVoxel[n].mortonCode = mortonCode;
packedVoxel[n].mortonCode = mortonAddr(pointCloud[n], 0);
packedVoxel[n].index = n;
}
sort(packedVoxel.begin(), packedVoxel.end());
......
......@@ -660,17 +660,7 @@ AttributeEncoder::encodeReflectancesTransformRaht(
const int voxelCount = int(pointCloud.getPointCount());
std::vector<MortonCodeWithIndex> packedVoxel(voxelCount);
for (int n = 0; n < voxelCount; n++) {
const auto position = pointCloud[n];
int x = int(position[0]);
int y = int(position[1]);
int z = int(position[2]);
uint64_t mortonCode = 0;
for (int b = 0; b < aps.raht_depth; b++) {
mortonCode |= (uint64_t)((x >> b) & 1) << (3 * b + 2);
mortonCode |= (uint64_t)((y >> b) & 1) << (3 * b + 1);
mortonCode |= (uint64_t)((z >> b) & 1) << (3 * b);
}
packedVoxel[n].mortonCode = mortonCode;
packedVoxel[n].mortonCode = mortonAddr(pointCloud[n], 0);
packedVoxel[n].index = n;
}
sort(packedVoxel.begin(), packedVoxel.end());
......@@ -745,17 +735,7 @@ AttributeEncoder::encodeColorsTransformRaht(
const int voxelCount = int(pointCloud.getPointCount());
std::vector<MortonCodeWithIndex> packedVoxel(voxelCount);
for (int n = 0; n < voxelCount; n++) {
const auto position = pointCloud[n];
int x = int(position[0]);
int y = int(position[1]);
int z = int(position[2]);
uint64_t mortonCode = 0;
for (int b = 0; b < aps.raht_depth; b++) {
mortonCode |= (uint64_t)((x >> b) & 1) << (3 * b + 2);
mortonCode |= (uint64_t)((y >> b) & 1) << (3 * b + 1);
mortonCode |= (uint64_t)((z >> b) & 1) << (3 * b);
}
packedVoxel[n].mortonCode = mortonCode;
packedVoxel[n].mortonCode = mortonAddr(pointCloud[n], 0);
packedVoxel[n].index = n;
}
sort(packedVoxel.begin(), packedVoxel.end());
......
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