Differential D9642 Diff 31697 extern/draco/draco/src/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_decoding_transform.h
Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_decoding_transform.h
- This file was moved from extern/draco/dracoenc/src/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_decoding_transform.h.
| Show All 12 Lines | |||||
| // limitations under the License. | // limitations under the License. | ||||
| // | // | ||||
| #ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED | #ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED | ||||
| #ifndef DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_PREDICTION_SCHEME_NORMAL_OCTAHEDRON_DECODING_TRANSFORM_H_ | #ifndef DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_PREDICTION_SCHEME_NORMAL_OCTAHEDRON_DECODING_TRANSFORM_H_ | ||||
| #define DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_PREDICTION_SCHEME_NORMAL_OCTAHEDRON_DECODING_TRANSFORM_H_ | #define DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_PREDICTION_SCHEME_NORMAL_OCTAHEDRON_DECODING_TRANSFORM_H_ | ||||
| #include <cmath> | #include <cmath> | ||||
| #include "draco/draco_features.h" | |||||
| #include "draco/compression/attributes/normal_compression_utils.h" | #include "draco/compression/attributes/normal_compression_utils.h" | ||||
| #include "draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_transform_base.h" | #include "draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_transform_base.h" | ||||
| #include "draco/core/decoder_buffer.h" | #include "draco/core/decoder_buffer.h" | ||||
| #include "draco/core/macros.h" | #include "draco/core/macros.h" | ||||
| #include "draco/core/vector_d.h" | #include "draco/core/vector_d.h" | ||||
| #include "draco/draco_features.h" | |||||
| namespace draco { | namespace draco { | ||||
| // Class for converting correction values transformed by the octahedral normal | // Class for converting correction values transformed by the octahedral normal | ||||
| // transform back to the original values. See the corresponding encoder for more | // transform back to the original values. See the corresponding encoder for more | ||||
| // details. | // details. | ||||
| template <typename DataTypeT> | template <typename DataTypeT> | ||||
| class PredictionSchemeNormalOctahedronDecodingTransform | class PredictionSchemeNormalOctahedronDecodingTransform | ||||
| : public PredictionSchemeNormalOctahedronTransformBase<DataTypeT> { | : public PredictionSchemeNormalOctahedronTransformBase<DataTypeT> { | ||||
| public: | public: | ||||
| typedef VectorD<DataTypeT, 2> Point2; | typedef VectorD<DataTypeT, 2> Point2; | ||||
| typedef DataTypeT CorrType; | typedef DataTypeT CorrType; | ||||
| typedef DataTypeT DataType; | typedef DataTypeT DataType; | ||||
| PredictionSchemeNormalOctahedronDecodingTransform() {} | PredictionSchemeNormalOctahedronDecodingTransform() {} | ||||
| // Dummy function to fulfill concept. | // Dummy function to fulfill concept. | ||||
| void Init(int num_components) {} | void Init(int num_components) {} | ||||
| bool DecodeTransformData(DecoderBuffer *buffer) { | bool DecodeTransformData(DecoderBuffer *buffer) { | ||||
| DataTypeT max_quantized_value, center_value; | DataTypeT max_quantized_value, center_value; | ||||
| if (!buffer->Decode(&max_quantized_value)) | if (!buffer->Decode(&max_quantized_value)) { | ||||
| return false; | return false; | ||||
| } | |||||
| if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) { | if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) { | ||||
| if (!buffer->Decode(¢er_value)) | if (!buffer->Decode(¢er_value)) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | |||||
| (void)center_value; | (void)center_value; | ||||
| return this->set_max_quantized_value(max_quantized_value); | return this->set_max_quantized_value(max_quantized_value); | ||||
| } | } | ||||
| inline void ComputeOriginalValue(const DataType *pred_vals, | inline void ComputeOriginalValue(const DataType *pred_vals, | ||||
| const CorrType *corr_vals, | const CorrType *corr_vals, | ||||
| DataType *out_orig_vals) const { | DataType *out_orig_vals) const { | ||||
| DRACO_DCHECK_LE(pred_vals[0], 2 * this->center_value()); | DRACO_DCHECK_LE(pred_vals[0], 2 * this->center_value()); | ||||
| ▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines | |||||