15#ifndef DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_PREDICTION_SCHEME_WRAP_DECODING_TRANSFORM_H_
16#define DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_PREDICTION_SCHEME_WRAP_DECODING_TRANSFORM_H_
27template <
typename DataTypeT,
typename CorrTypeT = DataTypeT>
37 const CorrTypeT *corr_vals,
38 DataTypeT *out_original_vals)
const {
40 static_assert(std::is_same<DataTypeT, CorrTypeT>::value,
41 "Predictions and corrections must have the same type.");
44 static_assert(std::is_same<DataTypeT, int32_t>::value,
45 "Only int32_t is supported for predicted values.");
51 const uint32_t *
const uint_predicted_vals =
52 reinterpret_cast<const uint32_t *
>(predicted_vals);
53 const uint32_t *
const uint_corr_vals =
54 reinterpret_cast<const uint32_t *
>(corr_vals);
56 out_original_vals[i] =
57 static_cast<DataTypeT
>(uint_predicted_vals[i] + uint_corr_vals[i]);
58 if (out_original_vals[i] > this->
max_value()) {
59 out_original_vals[i] -= this->
max_dif();
60 }
else if (out_original_vals[i] < this->
min_value()) {
61 out_original_vals[i] += this->
max_dif();
Definition decoder_buffer.h:30
bool Decode(T *out_val)
Definition decoder_buffer.h:68
Definition attribute_octahedron_transform.cc:21