Commit 4e830636 authored by David Flynn's avatar David Flynn
Browse files

geometry: signal geometryCodecType in header

This commit introduces signalling for geometryCodecType in the bitstream
headers in order to allow the decoder to be more easily slaved to the
bitstream -- ie, to avoid needing to configure a special decoding mode.
parent 5181146c
...@@ -80,6 +80,11 @@ class PCCTMC3Decoder3 { ...@@ -80,6 +80,11 @@ class PCCTMC3Decoder3 {
std::cout << "Error: bistream version not supported!" << std::endl; std::cout << "Error: bistream version not supported!" << std::endl;
return -1; return -1;
} }
// determine the geometry codec type
uint8_t geometryCodecRaw;
PCCReadFromBuffer<uint8_t>(bitstream.buffer, geometryCodecRaw, bitstream.size);
uint8_t hasColors = 0; uint8_t hasColors = 0;
PCCReadFromBuffer<uint8_t>(bitstream.buffer, hasColors, bitstream.size); PCCReadFromBuffer<uint8_t>(bitstream.buffer, hasColors, bitstream.size);
uint8_t hasReflectances = 0; uint8_t hasReflectances = 0;
...@@ -136,6 +141,10 @@ class PCCTMC3Decoder3 { ...@@ -136,6 +141,10 @@ class PCCTMC3Decoder3 {
return -1; return -1;
} }
// determine the geometry codec type
uint8_t geometryCodecRaw;
PCCReadFromBuffer<uint8_t>(bitstream.buffer, geometryCodecRaw, bitstream.size);
uint64_t positionsSize = bitstream.size; uint64_t positionsSize = bitstream.size;
decodePositionsHeader(bitstream, pointCloud); decodePositionsHeader(bitstream, pointCloud);
...@@ -189,6 +198,10 @@ class PCCTMC3Decoder3 { ...@@ -189,6 +198,10 @@ class PCCTMC3Decoder3 {
return -1; return -1;
} }
// determine the geometry codec type
uint8_t geometryCodecRaw;
PCCReadFromBuffer<uint8_t>(bitstream.buffer, geometryCodecRaw, bitstream.size);
uint64_t positionsSize = bitstream.size; uint64_t positionsSize = bitstream.size;
size_t depth; size_t depth;
size_t level; size_t level;
......
...@@ -143,6 +143,7 @@ class PCCTMC3Encoder3 { ...@@ -143,6 +143,7 @@ class PCCTMC3Encoder3 {
PCCWriteToBuffer<uint32_t>(PCCTMC3MagicNumber, bitstream.buffer, bitstream.size); PCCWriteToBuffer<uint32_t>(PCCTMC3MagicNumber, bitstream.buffer, bitstream.size);
PCCWriteToBuffer<uint32_t>(PCCTMC3FormatVersion, bitstream.buffer, bitstream.size); PCCWriteToBuffer<uint32_t>(PCCTMC3FormatVersion, bitstream.buffer, bitstream.size);
PCCWriteToBuffer<uint8_t>(int(params.geometryCodec), bitstream.buffer, bitstream.size);
PCCWriteToBuffer<uint8_t>(uint8_t(pointCloud.hasColors()), bitstream.buffer, bitstream.size); PCCWriteToBuffer<uint8_t>(uint8_t(pointCloud.hasColors()), bitstream.buffer, bitstream.size);
PCCWriteToBuffer<uint8_t>(uint8_t(pointCloud.hasReflectances()), bitstream.buffer, PCCWriteToBuffer<uint8_t>(uint8_t(pointCloud.hasReflectances()), bitstream.buffer,
bitstream.size); bitstream.size);
...@@ -184,6 +185,7 @@ class PCCTMC3Encoder3 { ...@@ -184,6 +185,7 @@ class PCCTMC3Encoder3 {
init(); init();
PCCWriteToBuffer<uint32_t>(PCCTMC3MagicNumber, bitstream.buffer, bitstream.size); PCCWriteToBuffer<uint32_t>(PCCTMC3MagicNumber, bitstream.buffer, bitstream.size);
PCCWriteToBuffer<uint32_t>(PCCTMC3FormatVersion, bitstream.buffer, bitstream.size); PCCWriteToBuffer<uint32_t>(PCCTMC3FormatVersion, bitstream.buffer, bitstream.size);
PCCWriteToBuffer<uint8_t>(int(params.geometryCodec), bitstream.buffer, bitstream.size);
if (int ret = quantization(inputPointCloud, params)) { if (int ret = quantization(inputPointCloud, params)) {
return ret; return ret;
...@@ -239,6 +241,7 @@ class PCCTMC3Encoder3 { ...@@ -239,6 +241,7 @@ class PCCTMC3Encoder3 {
init(); init();
PCCWriteToBuffer<uint32_t>(PCCTMC3MagicNumber, bitstream.buffer, bitstream.size); PCCWriteToBuffer<uint32_t>(PCCTMC3MagicNumber, bitstream.buffer, bitstream.size);
PCCWriteToBuffer<uint32_t>(PCCTMC3FormatVersion, bitstream.buffer, bitstream.size); PCCWriteToBuffer<uint32_t>(PCCTMC3FormatVersion, bitstream.buffer, bitstream.size);
PCCWriteToBuffer<uint8_t>(int(params.geometryCodec), bitstream.buffer, bitstream.size);
// Write out inputPointCloud file, just so that we can get it into the TMC1 pipeline. // Write out inputPointCloud file, just so that we can get it into the TMC1 pipeline.
pcc::PCCPointSet3 tempPointCloud(inputPointCloud); pcc::PCCPointSet3 tempPointCloud(inputPointCloud);
......
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