Differential D9642 Diff 31360 extern/draco/draco/src/draco/compression/point_cloud/algorithms/float_points_tree_decoder.cc
Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/compression/point_cloud/algorithms/float_points_tree_decoder.cc
- This file was moved from extern/draco/dracoenc/src/draco/compression/point_cloud/algorithms/float_points_tree_decoder.cc.
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | const Self &operator=(const SourceType &source) { | ||||
| return *this; | return *this; | ||||
| } | } | ||||
| private: | private: | ||||
| OutputIterator oit_; | OutputIterator oit_; | ||||
| }; | }; | ||||
| FloatPointsTreeDecoder::FloatPointsTreeDecoder() | FloatPointsTreeDecoder::FloatPointsTreeDecoder() | ||||
| : num_points_(0), compression_level_(0) { | : num_points_(0), compression_level_(0), num_points_from_header_(0) { | ||||
| qinfo_.quantization_bits = 0; | qinfo_.quantization_bits = 0; | ||||
| qinfo_.range = 0; | qinfo_.range = 0; | ||||
| } | } | ||||
| bool FloatPointsTreeDecoder::DecodePointCloudKdTreeInternal( | bool FloatPointsTreeDecoder::DecodePointCloudKdTreeInternal( | ||||
| DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) { | DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) { | ||||
| if (!buffer->Decode(&qinfo_.quantization_bits)) | if (!buffer->Decode(&qinfo_.quantization_bits)) return false; | ||||
| return false; | if (qinfo_.quantization_bits > 31) return false; | ||||
| if (qinfo_.quantization_bits > 31) | if (!buffer->Decode(&qinfo_.range)) return false; | ||||
| return false; | if (!buffer->Decode(&num_points_)) return false; | ||||
| if (!buffer->Decode(&qinfo_.range)) | if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) | ||||
| return false; | |||||
| if (!buffer->Decode(&num_points_)) | |||||
| return false; | |||||
| if (!buffer->Decode(&compression_level_)) | |||||
| return false; | return false; | ||||
| if (!buffer->Decode(&compression_level_)) return false; | |||||
| // Only allow compression level in [0..6]. | // Only allow compression level in [0..6]. | ||||
| if (6 < compression_level_) { | if (6 < compression_level_) { | ||||
| LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n", | LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n", | ||||
| compression_level_); | compression_level_); | ||||
| return false; | return false; | ||||
| } | } | ||||
| Show All 40 Lines | switch (compression_level_) { | ||||
| qpoints_decoder.DecodePoints(buffer, oit); | qpoints_decoder.DecodePoints(buffer, oit); | ||||
| break; | break; | ||||
| } | } | ||||
| default: | default: | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| if (qpoints->size() != num_points_) | if (qpoints->size() != num_points_) { | ||||
| return false; | return false; | ||||
| } | |||||
| return true; | return true; | ||||
| } | } | ||||
| } // namespace draco | } // namespace draco | ||||