Commit 780b950b authored by Ohji Nakagami's avatar Ohji Nakagami Committed by David Flynn
Browse files

trisoup/m44703: use octree coding when trisoup leaf size equals 1

When trisoup was completely independent, trisoup handled lossless
geometry coding by using a leaf size of 1 and no triangles.  This
commit replaces that mode with the better performing octree geometry
coder.
parent 55fcc441
......@@ -10,6 +10,8 @@ categories:
##
# geometry parameters (trisoup)
- geometryCodec: 2
- neighbourAvailBoundaryLog2: 9
- inferredDirectCodingMode: 0
- triSoupDepth: ${test-depth}
- triSoupIntToOrigScale: '$eval{ 1 << ( ${src-geometry-precision} - ${test-depth} ) }'
- triSoupLevel:
......
......@@ -10,6 +10,8 @@ categories:
##
# geometry parameters (trisoup)
- geometryCodec: 2
- neighbourAvailBoundaryLog2: 9
- inferredDirectCodingMode: 0
- triSoupDepth: ${test-depth}
- triSoupIntToOrigScale: '$eval{ 1 << ( ${src-geometry-precision} - ${test-depth} ) }'
- triSoupLevel:
......
......@@ -417,6 +417,31 @@ ParseParameters(int argc, char* argv[], Parameters& params)
1.0f / params.encoder.sps.donotuse_trisoup_int_to_orig_scale;
}
// TriSoup geometry is only enabled when trisoup depth > triangle_level.
// NB: this happens after the scale factor fudge above, since the user
// believes they are configuring trisoup
if (params.encoder.gps.geom_codec_type == GeometryCodecType::kTriSoup) {
const auto& gps = params.encoder.gps;
int trisoupNodeSizeLog2 = gps.trisoup_depth - gps.trisoup_triangle_level;
if (trisoupNodeSizeLog2 <= 0) {
err.warn() << "TriSoup disabled when depth <= triangle level\n";
params.encoder.gps.geom_codec_type = GeometryCodecType::kOctree;
}
}
// Certain coding modes are not available when trisoup is enabled.
// Disable them, and warn if set (they may be set as defaults).
if (params.encoder.gps.geom_codec_type == GeometryCodecType::kTriSoup) {
if (!params.encoder.gps.geom_unique_points_flag)
err.warn() << "TriSoup geometry does not preserve duplicated points\n";
if (params.encoder.gps.inferred_direct_coding_mode_enabled_flag)
err.warn() << "TriSoup geometry is incompatable with IDCM\n";
params.encoder.gps.geom_unique_points_flag = true;
params.encoder.gps.inferred_direct_coding_mode_enabled_flag = false;
}
// support disabling attribute coding (simplifies configuration)
if (params.disableAttributeCoding) {
params.encoder.attributeIdxMap.clear();
......
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