Differential D9642 Diff 31697 extern/draco/draco/src/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_decoding_transform.h
Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_decoding_transform.h
- This file was moved from extern/draco/dracoenc/src/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_decoding_transform.h.
| Show All 38 Lines | public: | ||||
| PredictionSchemeNormalOctahedronCanonicalizedDecodingTransform() {} | PredictionSchemeNormalOctahedronCanonicalizedDecodingTransform() {} | ||||
| // Dummy to fulfill concept. | // Dummy 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->Decode(¢er_value)) | } | ||||
| if (!buffer->Decode(¢er_value)) { | |||||
| return false; | return false; | ||||
| } | |||||
| (void)center_value; | (void)center_value; | ||||
| if (!this->set_max_quantized_value(max_quantized_value)) | if (!this->set_max_quantized_value(max_quantized_value)) { | ||||
| return false; | return false; | ||||
| } | |||||
| // Account for reading wrong values, e.g., due to fuzzing. | // Account for reading wrong values, e.g., due to fuzzing. | ||||
| if (this->quantization_bits() < 2) | if (this->quantization_bits() < 2) { | ||||
| return false; | return false; | ||||
| if (this->quantization_bits() > 30) | } | ||||
| if (this->quantization_bits() > 30) { | |||||
| return false; | return false; | ||||
| } | |||||
| return true; | return true; | ||||
| } | } | ||||
| 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()); | ||||
| DRACO_DCHECK_LE(pred_vals[1], 2 * this->center_value()); | DRACO_DCHECK_LE(pred_vals[1], 2 * this->center_value()); | ||||
| ▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines | |||||