mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-04-22 05:39:54 +08:00
parent
4f77ea0ac2
commit
811a423005
@ -1,4 +1,2 @@
|
||||
|
||||
_Frank Galligan, Google
|
||||
\[author]
|
||||
\[author]_
|
||||
_Frank Galligan, Google_
|
||||
|
@ -1,9 +0,0 @@
|
||||
|
||||
## Terms and Definitions (TBD)
|
||||
|
||||
For the purposes of this document, the following terms and definitions apply:
|
||||
|
||||
| Term | Definition |
|
||||
| ------- | ---------------- |
|
||||
| | |
|
||||
{:.terms }
|
@ -51,7 +51,6 @@ void DecodeAttributeData() {
|
||||
}
|
||||
Attribute_AssignPointsToCorners();
|
||||
}
|
||||
ß
|
||||
for (i = 0; i < num_attributes_decoders; ++i) {
|
||||
curr_att_dec = i;
|
||||
is_face_visited_.assign(num_faces, false);
|
||||
|
@ -1,8 +1,8 @@
|
||||
---
|
||||
layout: spec-page
|
||||
title: Draco Bitstream Specification (Draft)
|
||||
title: Draco Bitstream Specification
|
||||
version: Version 2,1
|
||||
version_date: Released 2017-xx-xx
|
||||
version_date: Released 2017-10-02
|
||||
---
|
||||
|
||||
<ol class="breadcrumb">
|
||||
@ -18,7 +18,6 @@ version_date: Released 2017-xx-xx
|
||||
{% include_relative 00.00.05.toc.md %}
|
||||
|
||||
{% include_relative 01.00.00.scope.md %}
|
||||
{% include_relative 02.00.00.terms.md %}
|
||||
{% include_relative 03.00.00.symbols.md %}
|
||||
{% include_relative 04.00.00.conventions.md %}
|
||||
{% include_relative draco.decoder.md %}
|
||||
|
@ -86,16 +86,16 @@ void MeshPredictionSchemeGeometricNormalPredictorArea_ComputePredictedValue(
|
||||
|
||||
~~~~~
|
||||
void CanonicalizeIntegerVector(vec, center_value_) {
|
||||
abs_sum = std::abs(vec[0]) + std::abs(vec[1]) + std::abs(vec[2]);
|
||||
abs_sum = Abs(vec[0]) + Abs(vec[1]) + Abs(vec[2]);
|
||||
if (abs_sum == 0) {
|
||||
vec[0] = center_value_;
|
||||
} else {
|
||||
vec[0] = (vec[0] * center_value_) / abs_sum;
|
||||
vec[1] = (vec[1] * center_value_) / abs_sum;
|
||||
if (vec[2] >= 0) {
|
||||
vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
|
||||
vec[2] = center_value_ - Abs(vec[0]) - Abs(vec[1]);
|
||||
} else {
|
||||
vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
|
||||
vec[2] = -(center_value_ - Abs(vec[0]) - Abs(vec[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -138,14 +138,14 @@ void IntegerVectorToQuantizedOctahedralCoords(
|
||||
t = (int_vec[2] + center_value_);
|
||||
} else {
|
||||
if (int_vec[1] < 0) {
|
||||
s = std::abs(int_vec[2]);
|
||||
s = Abs(int_vec[2]);
|
||||
} else {
|
||||
s = (max_value_ - std::abs(int_vec[2]));
|
||||
s = (max_value_ - Abs(int_vec[2]));
|
||||
}
|
||||
if (int_vec[2] < 0) {
|
||||
t = std::abs(int_vec[1]);
|
||||
t = Abs(int_vec[1]);
|
||||
} else {
|
||||
t = (max_value_ - std::abs(int_vec[1]));
|
||||
t = (max_value_ - Abs(int_vec[1]));
|
||||
}
|
||||
}
|
||||
CanonicalizeOctahedralCoords(s, t, out_s, out_t, center_value_, max_value_);
|
||||
|
@ -39,7 +39,9 @@ void InvertDiamond(s, t, center_value_) {
|
||||
s = -t;
|
||||
t = -temp;
|
||||
} else {
|
||||
std::swap(s, t);
|
||||
temp = s;
|
||||
s = t;
|
||||
t = temp;
|
||||
}
|
||||
s = (s + corner_point_s) / 2;
|
||||
t = (t + corner_point_t) / 2;
|
||||
@ -128,7 +130,7 @@ void PredictionSchemeNormalOctahedronCanonicalizedDecodingTransform_ComputeOrigi
|
||||
pred_in, corr, out, center_value_, max_quantized_value_) {
|
||||
t.assign(2, center_value_);
|
||||
SubtractVectors(pred_in, t, &pred);
|
||||
pred_is_in_diamond = std::abs(pred[0]) + std::abs(pred[1]) <= center_value_;
|
||||
pred_is_in_diamond = Abs(pred[0]) + Abs(pred[1]) <= center_value_;
|
||||
if (!pred_is_in_diamond) {
|
||||
InvertDiamond(&pred[0], &pred[1], center_value_);
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ void GetPositionForEntryId(entry_id, pos) {
|
||||
corner = encoded_attribute_value_index_to_corner_map[curr_att_dec][entry_id];
|
||||
point_id = corner_to_point_map[corner];
|
||||
mapped_index = indices_map_[0][point_id];
|
||||
pos_orig = seq_int_att_dec_original_values[std::make_pair(0, 0)];
|
||||
pos_orig = seq_int_att_dec_original_values[0][0];
|
||||
for (i = 0; i < 3; ++i) {
|
||||
pos.push_back(pos_orig[(mapped_index * 3) + i]);
|
||||
}
|
||||
|
@ -47,8 +47,8 @@ void OctaherdalCoordsToUnitVector(in_s, in_t, out_vector) {
|
||||
}
|
||||
y = 2.0 * s - 1.0;
|
||||
z = 2.0 * t - 1.0;
|
||||
x = std::min(std::min(2.0 * spt - 1.0, 3.0 - 2.0 * spt),
|
||||
std::min(2.0 * smt + 1.0, 1.0 - 2.0 * smt)) * x_sign;
|
||||
x = Min(Min(2.0 * spt - 1.0, 3.0 - 2.0 * spt),
|
||||
Min(2.0 * smt + 1.0, 1.0 - 2.0 * smt)) * x_sign;
|
||||
normSquared = x * x + y * y + z * z;
|
||||
if (normSquared < 1e-6) {
|
||||
out_vector[0] = 0;
|
||||
|
@ -19,7 +19,7 @@ void Dot(vec_x, vec_y, dot) {
|
||||
void AbsSum(vec, abs_sum) {
|
||||
result = 0;
|
||||
for (i = 0; i < vec.size(); ++i) {
|
||||
result += std::abs(vec[i]);
|
||||
result += Abs(vec[i]);
|
||||
}
|
||||
abs_sum = result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user