uvgVPCCenc 1.2.0
uvgVPCCenc is an open-source real-time V-PCC encoder library written in C++ from scratch.
Loading...
Searching...
No Matches
parameters.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 * This file is part of uvgVPCCenc V-PCC encoder.
3 *
4 * Copyright (c) 2024, Tampere University, ITU/ISO/IEC, project contributors
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without modification,
8 * are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:
9 *
10 * * Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 * * Redistributions in binary form must reproduce the above copyright notice, this
14 * list of conditions and the following disclaimer in the documentation and/or
15 * other materials provided with the distribution.
16 *
17 * * Neither the name of Tampere University, ITU/ISO/IEC nor the names of its
18 * contributors may be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
26 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON
29 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS
32 ****************************************************************************/
33
35
36#pragma once
37
38#include <cstddef>
39#include <string>
40#include <vector>
41
43#include "uvgutils/utils.hpp"
44
45
46namespace uvgvpcc_enc {
47
48// Configuration of the encoder, only const variable //
49// Value here are default values non defined in presets. It is strongly NON-recommended to modify the values here. Use 'setParameter' or
50// 'setParameters' function in the application instead.
51struct Parameters {
52 // ___ General parameters __ //
53 size_t geoBitDepthInput; // (inputGeometryBitDepth3D?) geometry3dCoordinatesBitdepth // TODO(lf)rename in resolution or something more
54 // catchy ?
55 std::string presetName;
56 size_t sizeGOF;
57 size_t nbThreadPCPart = 0; // 0 means the actual number of detected threads
58 size_t maxConcurrentFrames = 0; // 0 means the actual value is set to max(4 x sizeGOF, 2 x nbThread)
59 bool doubleLayer = true;
60 std::string logLevel = "INFO";
61 bool errorsAreFatal = true;
62
63 // ___ Debug parameters ___ //
65 bool exportStatistics = false;
68 std::string statisticsDir;
69 bool timerLog = false; // TODO(lf): remove and activate it if loglevel is profiling
70
71 // ___ Activate or not some features ___ //
72 bool lowDelayBitstream = false;
73
74 // ___ Voxelization ___ // (grid-based segmentation)
75 size_t geoBitDepthVoxelized; // voxelizedGeometryBitDepth3D // grid-based segmentation
76
77 // ___ Slicing Algorithm ___ //
78 bool activateSlicing = false; // Boolean to activate the slicing algorithm or run the original algorithm
79
80 // ___ KdTree ___ //
81 size_t kdTreeMaxLeafSize = 10; // TODO(lf)deprecated no ? (as there are other parameterrs for it, for each kdtree case)
82
83 // Normal computation //
86
87 // Normal orientation //
89
90 // PPI segmentation //
91 const std::vector<uvgutils::VectorN<double, 3>> projectionPlaneOrientations = {
92 {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}, {-1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, {0.0, 0.0, -1.0}}};
93 const size_t projectionPlaneCount = 6; // TODO(lf): move out from parameters ?
94
95 // ___ PPI smoothing ___ // (fast grid-based refine segmentation)
96 size_t geoBitDepthRefineSegmentation; // refineSegmentationGeometryBitDepth3D
97 // TODO(lf)verify that all scale set by user are compatible
98 size_t refineSegmentationMaxNNVoxelDistanceLUT; // lf note : 9**2 = 81 ~ 192/2
101
103 // TODO(lf)check the config if all concerned parameters are poqwer of two
104 // Slicing Algorithm refine segmentation parameter
105 size_t slicingRefineSegmentationMaxNNVoxelDistanceLUT; // lf note : 9**2 = 81 ~ 192/2
109
110 // ___ Patch generation ___ // (patch segmentation)
111 size_t maxAllowedDist2RawPointsDetection = 5; // TODO(lf): add verification to avoid segfault because index out of bound
114 // lf : for reworked function only. If the value is 4, the euclidian distance is 16. // TODO(lf): the default value should be 2 I
115 // guess // Nop, it should be 1 // TODO(lf): make sure to use <= instead of < in the for loop so to avoid this confusion.
117 // TODO(lf)there is a mix with patchPackingBlockSize // TODO(lf)rename it as blocSizeOccupancyMap or something like this
118 size_t minLevel = 64; // TODO(lf): must be a power of 2 ? So give the power of two and do only shifting, no division // might be
119 // related to the different avaliable position of the projection plan of each path
122 size_t quantizerSizeX = static_cast<size_t>(1) << log2QuantizerSizeX; // TODO(lf): investigate
123 size_t quantizerSizeY = static_cast<size_t>(1) << log2QuantizerSizeY;
125 size_t distanceFiltering = 32; // tmp_a in TMC2 // TODO(lf) check impact on quality
126 size_t peakPerBlockBlockSize = 2; // peak per block filtering size
127
128
129 // ___ Patch packing ___ //
130 size_t mapWidth; // TODO(lf)check if it is a multipl of occupancy resolution
132 // TODO(lf): lf : As Joose explain to me, in theory, it would be the height which is constant and equals to 64*nbThreads
135 float gpaTresholdIoU = 0.3; // global patch allocation threshold for the intersection over union process
136 size_t patchPackingBlockSize = 4; // link in the bitsream to asps.asps_log2_patch_packing_block_size
137
138 // ___ Map generation ___ //
141 std::string attributeBgFill = "patchExtension";
142 size_t blockSizeBBPE = 8;
145 bool dynamicMapHeight = true;
146
147 // ___ 2D encoding parameters ___ //
149 size_t intraFramePeriod = 64; // TODO(lf): Not useful yet as a new 2D encoder is created for each GOF. (64 is default Kvazaar value. In
150 // uvgVPCCenc, the value is indirectly set by 8 or 16, depending on the size of the 2D encoding GOP)
151 bool encoderInfoSEI = false;
152
153 // Occupancy map
154 std::string occupancyEncoderName = "Kvazaar";
157 std::string occupancyEncodingFormat = "YUV420";
159 0; // 0 by default means that this variable will have for value during execution the actual number of detected threads
160 size_t occupancyMapDSResolution; // 'Rate' or 'qp' for the occupancy map (downscalling factor)
164 std::string occupancyFFmpegCodecName; // Name of the codec as specified in ffmpeg documentation
167
168 // Geometry map
169 std::string geometryEncoderName = "Kvazaar";
172 std::string geometryEncodingFormat = "YUV420";
174 0; // 0 by default means that this variable will have for value during execution the actual number of detected threads
177 std::string geometryFFmpegCodecName; // Name of the codec as specified in ffmpeg documentation
180
181 // Attribute map
182 std::string attributeEncoderName = "Kvazaar";
185 std::string attributeEncodingFormat = "YUV420";
187 0; // 0 by default means that this variable will have for value during execution the actual number of detected threads
190 std::string attributeFFmpegCodecName; // Name of the codec as specified in ffmpeg documentation
193
194 // ___ Bitstream generation ___ //
196
197 // ___ Miscellaneous ___ //
198 // bool useEncoderCommand = false; // lf : All mention of this parameter has been commented. This might be usefull to support command line
199 // 2D encoder in the futur.
200};
201
202
203extern const Parameters* p_; // Const pointer to a non-const Parameter struct instance in parameters.cpp
204
206void setParameterValue(const std::string& parameterName, const std::string& parameterValue, const bool& fromPreset);
207
208} // namespace uvgvpcc_enc
Definition uvgvpccenc.hpp:49
void setParameterValue(const std::string &parameterName, const std::string &parameterValue, const bool &fromPreset)
Definition parameters.cpp:216
void initializeParameterMap(Parameters &param)
Definition parameters.cpp:53
const Parameters * p_
Definition uvgvpccenc.cpp:597
Definition parameters.hpp:51
bool activateSlicing
Definition parameters.hpp:78
bool encoderInfoSEI
Definition parameters.hpp:151
std::string logLevel
Definition parameters.hpp:60
size_t refineSegmentationMaxNNVoxelDistanceLUT
Definition parameters.hpp:98
std::string occupancyEncoderName
Definition parameters.hpp:154
size_t mapGenerationBackgroundValueAttribute
Definition parameters.hpp:139
size_t distanceFiltering
Definition parameters.hpp:125
size_t mapWidth
Definition parameters.hpp:130
size_t normalComputationMaxDiagonalStep
Definition parameters.hpp:85
std::string occupancyEncodingPreset
Definition parameters.hpp:161
size_t kdTreeMaxLeafSize
Definition parameters.hpp:81
bool mapGenerationFillEmptyBlock
Definition parameters.hpp:144
size_t geometryEncodingNbThread
Definition parameters.hpp:173
size_t quantizerSizeX
Definition parameters.hpp:122
size_t log2QuantizerSizeX
Definition parameters.hpp:120
std::string attributeFFmpegCodecParams
Definition parameters.hpp:192
std::string occupancyEncodingFormat
Definition parameters.hpp:157
const std::vector< uvgutils::VectorN< double, 3 > > projectionPlaneOrientations
Definition parameters.hpp:91
bool displayBitstreamGenerationFps
Definition parameters.hpp:195
size_t omRefinementTreshold4
Definition parameters.hpp:163
size_t maxAllowedDist2RawPointsDetection
Definition parameters.hpp:111
std::string geometryEncodingPreset
Definition parameters.hpp:176
size_t log2QuantizerSizeY
Definition parameters.hpp:121
size_t surfaceThickness
Definition parameters.hpp:124
double refineSegmentationLambda
Definition parameters.hpp:99
std::string occupancyFFmpegCodecName
Definition parameters.hpp:164
size_t mapGenerationBackgroundValueGeometry
Definition parameters.hpp:140
std::string attributeEncoderName
Definition parameters.hpp:182
size_t slicingRefineSegmentationIterationCount
Definition parameters.hpp:107
size_t minLevel
Definition parameters.hpp:118
size_t maxConcurrentFrames
Definition parameters.hpp:58
size_t omRefinementTreshold2
Definition parameters.hpp:162
std::string statisticsDir
Definition parameters.hpp:68
std::string attributeFFmpegCodecOptions
Definition parameters.hpp:191
std::string attributeEncodingMode
Definition parameters.hpp:184
std::string intermediateFilesDir
Definition parameters.hpp:67
bool geometryEncodingIsLossless
Definition parameters.hpp:170
size_t sizeGOP2DEncoding
Definition parameters.hpp:148
bool enablePatchSplitting
Definition parameters.hpp:116
size_t geometryEncodingQp
Definition parameters.hpp:175
bool attributeEncodingIsLossless
Definition parameters.hpp:183
bool errorsAreFatal
Definition parameters.hpp:61
size_t quantizerSizeY
Definition parameters.hpp:123
bool useTmc2YuvDownscaling
Definition parameters.hpp:143
bool timerLog
Definition parameters.hpp:69
size_t intraFramePeriod
Definition parameters.hpp:149
bool exportIntermediateFiles
Definition parameters.hpp:64
std::string attributeFFmpegCodecName
Definition parameters.hpp:190
double slicingRefineSegmentationLambda
Definition parameters.hpp:106
size_t attributeEncodingNbThread
Definition parameters.hpp:186
size_t minimumMapHeight
Definition parameters.hpp:131
const size_t projectionPlaneCount
Definition parameters.hpp:93
std::string geometryEncoderName
Definition parameters.hpp:169
size_t patchSegmentationMaxPropagationDistance
Definition parameters.hpp:113
size_t geoBitDepthVoxelized
Definition parameters.hpp:75
bool intermediateFilesDirTimeStamp
Definition parameters.hpp:66
size_t normalComputationKnnCount
Definition parameters.hpp:84
size_t patchPackingBlockSize
Definition parameters.hpp:136
size_t slicingRefineSegmentationIDEVDist
Definition parameters.hpp:108
size_t slicingRefineSegmentationMaxNNVoxelDistanceLUT
Definition parameters.hpp:105
bool occupancyEncodingIsLossless
Definition parameters.hpp:155
float gpaTresholdIoU
Definition parameters.hpp:135
size_t refineSegmentationIterationCount
Definition parameters.hpp:100
bool exportStatistics
Definition parameters.hpp:65
size_t refineSegmentationIDEVDist
Definition parameters.hpp:102
bool doubleLayer
Definition parameters.hpp:59
size_t sizeGOF
Definition parameters.hpp:56
std::string geometryEncodingMode
Definition parameters.hpp:171
std::string geometryFFmpegCodecParams
Definition parameters.hpp:179
size_t spacePatchPacking
Definition parameters.hpp:133
size_t minPointCountPerCC
Definition parameters.hpp:112
std::string geometryEncodingFormat
Definition parameters.hpp:172
std::string attributeEncodingFormat
Definition parameters.hpp:185
std::string presetName
Definition parameters.hpp:55
size_t geoBitDepthInput
Definition parameters.hpp:53
std::string attributeEncodingPreset
Definition parameters.hpp:189
std::string occupancyFFmpegCodecParams
Definition parameters.hpp:166
size_t peakPerBlockBlockSize
Definition parameters.hpp:126
bool lowDelayBitstream
Definition parameters.hpp:72
size_t occupancyEncodingNbThread
Definition parameters.hpp:158
size_t occupancyMapDSResolution
Definition parameters.hpp:160
size_t nbThreadPCPart
Definition parameters.hpp:57
std::string geometryFFmpegCodecOptions
Definition parameters.hpp:178
size_t blockSizeBBPE
Definition parameters.hpp:142
bool dynamicMapHeight
Definition parameters.hpp:145
bool interPatchPacking
Definition parameters.hpp:134
size_t normalOrientationKnnCount
Definition parameters.hpp:88
std::string occupancyEncodingMode
Definition parameters.hpp:156
size_t attributeEncodingQp
Definition parameters.hpp:188
std::string geometryFFmpegCodecName
Definition parameters.hpp:177
size_t geoBitDepthRefineSegmentation
Definition parameters.hpp:96
std::string attributeBgFill
Definition parameters.hpp:141
std::string occupancyFFmpegCodecOptions
Definition parameters.hpp:165