15#ifndef DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_MESH_PREDICTION_SCHEME_MULTI_PARALLELOGRAM_ENCODER_H_
16#define DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_MESH_PREDICTION_SCHEME_MULTI_PARALLELOGRAM_ENCODER_H_
30template <
typename DataTypeT,
class TransformT,
class MeshDataT>
50 int num_components,
const PointIndex *entry_to_point_id_map)
override;
60template <
typename DataTypeT,
class TransformT,
class MeshDataT>
61bool MeshPredictionSchemeMultiParallelogramEncoder<DataTypeT, TransformT,
63 ComputeCorrectionValues(
const DataTypeT *in_data,
CorrType *out_corr,
64 int size,
int num_components,
68 const std::vector<int32_t> *
const vertex_to_data_map =
72 std::unique_ptr<DataTypeT[]> pred_vals(
new DataTypeT[num_components]());
73 std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
74 new DataTypeT[num_components]());
79 static_cast<int>(this->
mesh_data().data_to_corner_map()->
size() - 1);
82 this->
mesh_data().data_to_corner_map()->at(p);
87 int num_parallelograms = 0;
88 for (
int i = 0; i < num_components; ++i) {
89 pred_vals[i] =
static_cast<DataTypeT
>(0);
91 while (corner_id != kInvalidCornerIndex) {
93 p, corner_id, table, *vertex_to_data_map, in_data, num_components,
94 parallelogram_pred_vals.get())) {
95 for (
int c = 0; c < num_components; ++c) {
96 pred_vals[c] += parallelogram_pred_vals[c];
102 corner_id = table->SwingRight(corner_id);
103 if (corner_id == start_corner_id) {
104 corner_id = kInvalidCornerIndex;
107 const int dst_offset = p * num_components;
108 if (num_parallelograms == 0) {
111 const int src_offset = (p - 1) * num_components;
113 in_data + dst_offset, in_data + src_offset, out_corr + dst_offset);
116 for (
int c = 0; c < num_components; ++c) {
117 pred_vals[c] /= num_parallelograms;
119 this->
transform().ComputeCorrection(in_data + dst_offset, pred_vals.get(),
120 out_corr + dst_offset);
124 for (
int i = 0; i < num_components; ++i) {
125 pred_vals[i] =
static_cast<DataTypeT
>(0);
127 this->
transform().ComputeCorrection(in_data, pred_vals.get(), out_corr);
MeshPredictionSchemeEncoder(const PointAttribute *attribute, const TransformT &transform, const MeshDataT &mesh_data)
Definition mesh_prediction_scheme_encoder.h:31
const MeshData & mesh_data() const
Definition mesh_prediction_scheme_encoder.h:38
typename MeshDataT::CornerTable CornerTable
Definition mesh_prediction_scheme_multi_parallelogram_encoder.h:36
MeshPredictionSchemeMultiParallelogramEncoder(const PointAttribute *attribute, const TransformT &transform, const MeshDataT &mesh_data)
Definition mesh_prediction_scheme_multi_parallelogram_encoder.h:42
bool IsInitialized() const override
Definition mesh_prediction_scheme_multi_parallelogram_encoder.h:55
MeshPredictionSchemeMultiParallelogramEncoder(const PointAttribute *attribute)
Definition mesh_prediction_scheme_multi_parallelogram_encoder.h:38
typename PredictionSchemeEncoder< DataTypeT, TransformT >::CorrType CorrType
Definition mesh_prediction_scheme_multi_parallelogram_encoder.h:34
bool ComputeCorrectionValues(const DataTypeT *in_data, CorrType *out_corr, int size, int num_components, const PointIndex *entry_to_point_id_map) override
Definition mesh_prediction_scheme_multi_parallelogram_encoder.h:63
PredictionSchemeMethod GetPredictionMethod() const override
Definition mesh_prediction_scheme_multi_parallelogram_encoder.h:51
Definition point_attribute.h:33
const PointAttribute * attribute() const
Definition prediction_scheme_encoder.h:79
Transform::CorrType CorrType
Definition prediction_scheme_encoder.h:41
const Transform & transform() const
Definition prediction_scheme_encoder.h:80
n< br > font size
Definition meshpage.php:3536
Definition attribute_octahedron_transform.cc:21
bool ComputeParallelogramPrediction(int data_entry_id, const CornerIndex ci, const CornerTableT *table, const std::vector< int32_t > &vertex_to_data_map, const DataTypeT *in_data, int num_components, DataTypeT *out_prediction)
Definition mesh_prediction_scheme_parallelogram_shared.h:45
CornerIndex CornerIndex
Definition mesh_edgebreaker_encoder_impl.cc:35
PredictionSchemeMethod
Definition compression_shared.h:80
@ MESH_PREDICTION_MULTI_PARALLELOGRAM
Definition compression_shared.h:87
Definition GameApi_pl.cc:29382