mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-10-11 02:31:30 +08:00
Re-org files, refine styles, add README, et al.
Draco bitstream spec source should be ready for author contributions.
This commit is contained in:
parent
c2fb47ac5d
commit
8d8c88e08f
@ -1 +1 @@
|
|||||||
@import url("https://fonts.googleapis.com/css?family=Inconsolata");body{font-family:Arial,sans-serif;margin:10% 25% 10% 10%;line-height:1.3}a{color:navy;text-decoration:none}a:visited{color:navy;text-decoration:none}a:hover{text-decoration:underline}pre{font-family:"Inconsolata",monospace;border:2px solid #ddd;padding:1em;margin-left:1em;overflow-x:auto}code{font-family:"Inconsolata",monospace}table{border-collapse:collapse;min-width:50%;margin-left:1em}th,td{border:2px solid #ccc;padding:.5em}th{background-color:#333;color:#fff}table.terms th{display:none}table.terms td{vertical-align:top}table.conventions th{display:none}table.conventions td{vertical-align:top}table.conventions td:first-child{white-space:nowrap}table.nohead th{display:none}table.xyhead th,table.xyhead td:first-child{background-color:#9bbb59}table.xyhead th{color:#000;font-weight:normal}figure.highlight{background-color:#f2f2f2;padding-left:1em;padding-right:1em;border:2px solid #ccc}div.syntax{background-color:#fff;background-image:linear-gradient(90deg, transparent 540px, #abced4 540px, #abced4 542px, transparent 542px),linear-gradient(#ddd .1em, transparent .1em);background-size:100% 1.3em;border-left:2px solid #ddd;border-right:2px solid #ddd;border-bottom:2px solid #ddd;white-space:pre;font-family:"Inconsolata",monospace;font-size:1em;padding-left:1em;margin-left:1em;width:720px}
|
@import url("https://fonts.googleapis.com/css?family=Inconsolata");body{font-family:Arial,sans-serif;margin:10% 25% 10% 10%;line-height:1.3}a{color:navy;text-decoration:none}a:visited{color:navy;text-decoration:none}a:hover{text-decoration:underline}code{font-family:"Inconsolata",monospace}table{border-collapse:collapse;min-width:50%;margin-left:1em}th,td{border:2px solid #ccc;padding:.5em}th{background-color:#333;color:#fff}table.terms th{display:none}table.terms td{vertical-align:top}table.conventions th{display:none}table.conventions td{vertical-align:top}table.conventions td:first-child{white-space:nowrap}table.nohead th{display:none}table.xyhead th,table.xyhead td:first-child{background-color:#9bbb59}table.xyhead th{color:#000;font-weight:normal}figure.highlight{background-color:#f2f2f2;padding-left:1em;padding-right:1em;border:2px solid #ccc}div.draco-syntax pre{background-color:#fff;background-image:linear-gradient(90deg, transparent 580px, #abced4 580px, #abced4 582px, transparent 582px),linear-gradient(#ddd .1em, transparent .1em);background-size:100% 1.3em;border-left:2px solid #ddd;border-right:2px solid #ddd;border-bottom:2px solid #ddd;white-space:pre;font-family:"Inconsolata",monospace;font-size:1em;padding-left:1em;margin-left:1em;width:720px}
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
|
|
||||||
<p><em>Last modified: 2017-07-10 14:30:06 -0700</em></p>
|
<p><em>Last modified: 2017-07-12 15:15:50 -0700</em></p>
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<h2 id="conventions">Conventions</h2>
|
<h2 id="conventions">Conventions</h2>
|
||||||
|
|
||||||
|
<h3 id="general-conventions">General Conventions</h3>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<p>When bit reading is finished it will always pad the read to the current
|
<p>When bit reading is finished it will always pad the read to the current
|
||||||
@ -40,3 +42,51 @@ first, then the connectivity section, and then the attribute section.</p>
|
|||||||
decoded.</p>
|
decoded.</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<h3 id="method-of-describing-bitstream-syntax">Method of describing bitstream syntax</h3>
|
||||||
|
|
||||||
|
<p><strong>FIXME: This section is borrowed from AV1, and should be modified for the Draco
|
||||||
|
spec.</strong></p>
|
||||||
|
|
||||||
|
<p>The description style of the syntax is similar to the C++ programming language.
|
||||||
|
Syntax elements in the bitstream are represented in bold type. Each syntax
|
||||||
|
element is described by its name (using only lower case letters with
|
||||||
|
underscore characters) and a descriptor for its method of coded
|
||||||
|
representation. The decoding process behaves according to the value of the
|
||||||
|
syntax element and to the values of previously decoded syntax elements. When a
|
||||||
|
value of a syntax element is used in the syntax tables or the text, it appears
|
||||||
|
in regular (i.e. not bold) type. If the value of a syntax element is being
|
||||||
|
computed (e.g. being written with a default value instead of being coded in
|
||||||
|
the bitstream), it also appears in regular type.</p>
|
||||||
|
|
||||||
|
<p>In some cases the syntax tables may use the values of other variables derived
|
||||||
|
from syntax elements values. Such variables appear in the syntax tables, or
|
||||||
|
text, named by a mixture of lower case and upper case letter and without any
|
||||||
|
underscore characters. Variables starting with an upper case letter are
|
||||||
|
derived for the decoding of the current syntax structure and all depending
|
||||||
|
syntax structures. These variables may be used in the decoding process for
|
||||||
|
later syntax structures. Variables starting with a lower case letter are only
|
||||||
|
used within the process from which they are derived.</p>
|
||||||
|
|
||||||
|
<p>Constant values appear in all upper case letters with underscore characters.</p>
|
||||||
|
|
||||||
|
<p>Constant lookup tables appear in all lower case letters with underscore
|
||||||
|
characters.</p>
|
||||||
|
|
||||||
|
<p>Hexadecimal notation, indicated by prefixing the hexadecimal number by <code class="highlighter-rouge">0x</code>,
|
||||||
|
may be used when the number of bits is an integer multiple of 4. For example,
|
||||||
|
<code class="highlighter-rouge">0x1a</code> represents a bit string <code class="highlighter-rouge">0001 1010</code>.</p>
|
||||||
|
|
||||||
|
<p>Binary notation is indicated by prefixing the binary number by <code class="highlighter-rouge">0b</code>. For
|
||||||
|
example, <code class="highlighter-rouge">0b00011010</code> represents a bit string <code class="highlighter-rouge">0001 1010</code>. Binary numbers may
|
||||||
|
include underscore characters to enhance readability. If present, the
|
||||||
|
underscore characters appear every 4 binary digits starting from the LSB. For
|
||||||
|
example, <code class="highlighter-rouge">0b11010</code> may also be written as <code class="highlighter-rouge">0b1_1010</code>.</p>
|
||||||
|
|
||||||
|
<p>A value equal to 0 represents a FALSE condition in a test statement. The
|
||||||
|
value TRUE is represented by any value not equal to 0.</p>
|
||||||
|
|
||||||
|
<p>The following table lists examples of the syntax specification format. When
|
||||||
|
<code class="highlighter-rouge">syntax_element</code> appears (with bold face font), it specifies that this syntax
|
||||||
|
element is parsed from the bitstream.</p>
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
## Conventions
|
## Conventions
|
||||||
|
|
||||||
|
### General Conventions
|
||||||
|
|
||||||
* When bit reading is finished it will always pad the read to the current
|
* When bit reading is finished it will always pad the read to the current
|
||||||
byte.
|
byte.
|
||||||
|
|
||||||
@ -24,3 +26,52 @@
|
|||||||
|
|
||||||
* The hole and split data must be decoded before the EdgeBreaker symbols are
|
* The hole and split data must be decoded before the EdgeBreaker symbols are
|
||||||
decoded.
|
decoded.
|
||||||
|
|
||||||
|
|
||||||
|
### Method of describing bitstream syntax
|
||||||
|
|
||||||
|
**FIXME: This section is borrowed from AV1, and should be modified for the Draco
|
||||||
|
spec.**
|
||||||
|
|
||||||
|
The description style of the syntax is similar to the C++ programming language.
|
||||||
|
Syntax elements in the bitstream are represented in bold type. Each syntax
|
||||||
|
element is described by its name (using only lower case letters with
|
||||||
|
underscore characters) and a descriptor for its method of coded
|
||||||
|
representation. The decoding process behaves according to the value of the
|
||||||
|
syntax element and to the values of previously decoded syntax elements. When a
|
||||||
|
value of a syntax element is used in the syntax tables or the text, it appears
|
||||||
|
in regular (i.e. not bold) type. If the value of a syntax element is being
|
||||||
|
computed (e.g. being written with a default value instead of being coded in
|
||||||
|
the bitstream), it also appears in regular type.
|
||||||
|
|
||||||
|
In some cases the syntax tables may use the values of other variables derived
|
||||||
|
from syntax elements values. Such variables appear in the syntax tables, or
|
||||||
|
text, named by a mixture of lower case and upper case letter and without any
|
||||||
|
underscore characters. Variables starting with an upper case letter are
|
||||||
|
derived for the decoding of the current syntax structure and all depending
|
||||||
|
syntax structures. These variables may be used in the decoding process for
|
||||||
|
later syntax structures. Variables starting with a lower case letter are only
|
||||||
|
used within the process from which they are derived.
|
||||||
|
|
||||||
|
Constant values appear in all upper case letters with underscore characters.
|
||||||
|
|
||||||
|
Constant lookup tables appear in all lower case letters with underscore
|
||||||
|
characters.
|
||||||
|
|
||||||
|
Hexadecimal notation, indicated by prefixing the hexadecimal number by `0x`,
|
||||||
|
may be used when the number of bits is an integer multiple of 4. For example,
|
||||||
|
`0x1a` represents a bit string `0001 1010`.
|
||||||
|
|
||||||
|
Binary notation is indicated by prefixing the binary number by `0b`. For
|
||||||
|
example, `0b00011010` represents a bit string `0001 1010`. Binary numbers may
|
||||||
|
include underscore characters to enhance readability. If present, the
|
||||||
|
underscore characters appear every 4 binary digits starting from the LSB. For
|
||||||
|
example, `0b11010` may also be written as `0b1_1010`.
|
||||||
|
|
||||||
|
A value equal to 0 represents a FALSE condition in a test statement. The
|
||||||
|
value TRUE is represented by any value not equal to 0.
|
||||||
|
|
||||||
|
The following table lists examples of the syntax specification format. When
|
||||||
|
`syntax_element` appears (with bold face font), it specifies that this syntax
|
||||||
|
element is parsed from the bitstream.
|
||||||
|
|
||||||
|
@ -2,33 +2,30 @@
|
|||||||
|
|
||||||
<h3 id="decode">Decode()</h3>
|
<h3 id="decode">Decode()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>Decode() {
|
||||||
Decode() { <b>Type</b>
|
|
||||||
DecodeHeader()
|
DecodeHeader()
|
||||||
DecodeConnectivityData()
|
DecodeConnectivityData()
|
||||||
DecodeAttributeData()}
|
DecodeAttributeData()}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 id="decodeheader">DecodeHeader()</h3>
|
<h3 id="decodeheader">DecodeHeader()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>DecodeHeader() {
|
||||||
DecodeHeader() { <b>Type</b>
|
draco_string UI8[5]
|
||||||
<b>draco_string</b> UI8[5]
|
major_version UI8
|
||||||
<b>major_version</b> UI8
|
minor_version UI8
|
||||||
<b>minor_version</b> UI8
|
encoder_type UI8
|
||||||
<b>encoder_type</b> UI8
|
encoder_method UI8
|
||||||
<b>encoder_method</b> UI8
|
|
||||||
flags
|
flags
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 id="decodeattributedata">DecodeAttributeData()</h3>
|
<h3 id="decodeattributedata">DecodeAttributeData()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>DecodeAttributeData() {
|
||||||
DecodeAttributeData() { <b>Type</b>
|
num_attributes_decoders UI8
|
||||||
<b>num_attributes_decoders</b> UI8
|
|
||||||
for (i = 0; i < num_attributes_decoders; ++i) {
|
for (i = 0; i < num_attributes_decoders; ++i) {
|
||||||
CreateAttributesDecoder(i);
|
CreateAttributesDecoder(i);
|
||||||
}
|
}
|
||||||
@ -40,4 +37,5 @@ DecodeAttributeData() { <b>Type</b
|
|||||||
}
|
}
|
||||||
DecodeAllAttributes()
|
DecodeAllAttributes()
|
||||||
OnAttributesDecoded()
|
OnAttributesDecoded()
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,35 +2,35 @@
|
|||||||
|
|
||||||
### Decode()
|
### Decode()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
Decode() { <b>Type</b>
|
Decode() {
|
||||||
DecodeHeader()
|
DecodeHeader()
|
||||||
DecodeConnectivityData()
|
DecodeConnectivityData()
|
||||||
DecodeAttributeData()}
|
DecodeAttributeData()}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax}
|
||||||
|
|
||||||
|
|
||||||
### DecodeHeader()
|
### DecodeHeader()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
DecodeHeader() { <b>Type</b>
|
DecodeHeader() {
|
||||||
<b>draco_string</b> UI8[5]
|
draco_string UI8[5]
|
||||||
<b>major_version</b> UI8
|
major_version UI8
|
||||||
<b>minor_version</b> UI8
|
minor_version UI8
|
||||||
<b>encoder_type</b> UI8
|
encoder_type UI8
|
||||||
<b>encoder_method</b> UI8
|
encoder_method UI8
|
||||||
flags
|
flags
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax}
|
||||||
|
|
||||||
|
|
||||||
### DecodeAttributeData()
|
### DecodeAttributeData()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
DecodeAttributeData() { <b>Type</b>
|
DecodeAttributeData() {
|
||||||
<b>num_attributes_decoders</b> UI8
|
num_attributes_decoders UI8
|
||||||
for (i = 0; i < num_attributes_decoders; ++i) {
|
for (i = 0; i < num_attributes_decoders; ++i) {
|
||||||
CreateAttributesDecoder(i);
|
CreateAttributesDecoder(i);
|
||||||
}
|
}
|
||||||
@ -42,4 +42,5 @@ DecodeAttributeData() { <b>Type</b
|
|||||||
}
|
}
|
||||||
DecodeAllAttributes()
|
DecodeAllAttributes()
|
||||||
OnAttributesDecoded()
|
OnAttributesDecoded()
|
||||||
</div>
|
~~~~~
|
||||||
|
{:.draco-syntax}
|
||||||
|
@ -2,25 +2,24 @@
|
|||||||
|
|
||||||
<h3 id="initializedecoder">InitializeDecoder()</h3>
|
<h3 id="initializedecoder">InitializeDecoder()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>InitializeDecoder() {
|
||||||
InitializeDecoder() { <b>Type</b>
|
edgebreaker_decoder_type UI8
|
||||||
<b>edgebreaker_decoder_type</b> UI8
|
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 id="decodeconnectivity">DecodeConnectivity()</h3>
|
<h3 id="decodeconnectivity">DecodeConnectivity()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>DecodeConnectivity() {
|
||||||
DecodeConnectivity() { <b>Type</b>
|
num_new_verts UI32
|
||||||
<b>num_new_verts</b> UI32
|
num_encoded_vertices UI32
|
||||||
<b>num_encoded_vertices</b> UI32
|
num_faces UI32
|
||||||
<b>num_faces</b> UI32
|
num_attribute_data I8
|
||||||
<b>num_attribute_data</b> I8
|
num_encoded_symbols UI32
|
||||||
<b>num_encoded_symbols</b> UI32
|
num_encoded_split_symbols UI32
|
||||||
<b>num_encoded_split_symbols</b> UI32
|
encoded_connectivity_size UI32
|
||||||
<b>encoded_connectivity_size</b> UI32
|
// file pointer must be set to current position
|
||||||
// file pointer must be set to current position + encoded_connectivity_size
|
// + encoded_connectivity_size
|
||||||
hole_and_split_bytes = DecodeHoleAndTopologySplitEvents()
|
hole_and_split_bytes = DecodeHoleAndTopologySplitEvents()
|
||||||
// file pointer must be set to old current position
|
// file pointer must be set to old current position
|
||||||
EdgeBreakerTraversalValence_Start()
|
EdgeBreakerTraversalValence_Start()
|
||||||
@ -46,13 +45,12 @@ DecodeConnectivity() { <b>Type</b
|
|||||||
// Preallocate vertex to value mapping
|
// Preallocate vertex to value mapping
|
||||||
AssignPointsToCorners()
|
AssignPointsToCorners()
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 id="assignpointstocorners">AssignPointsToCorners()</h3>
|
<h3 id="assignpointstocorners">AssignPointsToCorners()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>AssignPointsToCorners() {
|
||||||
AssignPointsToCorners() { <b>Type</b>
|
|
||||||
decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
|
decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
|
||||||
if (attribute_data_.size() == 0) {
|
if (attribute_data_.size() == 0) {
|
||||||
for (f = 0; f < decoder_->mesh()->num_faces(); ++f) {
|
for (f = 0; f < decoder_->mesh()->num_faces(); ++f) {
|
||||||
@ -123,13 +121,12 @@ AssignPointsToCorners() { <b>Type</b
|
|||||||
}
|
}
|
||||||
decoder_->point_cloud()->set_num_points(point_to_corner_map.size());
|
decoder_->point_cloud()->set_num_points(point_to_corner_map.size());
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 id="decodeconnectivity-1">DecodeConnectivity()</h3>
|
<h3 id="decodeconnectivity-1">DecodeConnectivity()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>DecodeConnectivity(num_symbols) {
|
||||||
DecodeConnectivity(num_symbols) { <b>Type</b>
|
|
||||||
for (i = 0; i < num_symbols; ++i) {
|
for (i = 0; i < num_symbols; ++i) {
|
||||||
symbol = TraversalValence_DecodeSymbol()
|
symbol = TraversalValence_DecodeSymbol()
|
||||||
corner = 3 * num_faces++
|
corner = 3 * num_faces++
|
||||||
@ -184,13 +181,12 @@ DecodeConnectivity(num_symbols) { <b>Type</b
|
|||||||
}
|
}
|
||||||
Return num_vertices;
|
Return num_vertices;
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 id="updatecornertableforsymbolc">UpdateCornerTableForSymbolC()</h3>
|
<h3 id="updatecornertableforsymbolc">UpdateCornerTableForSymbolC()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>UpdateCornerTableForSymbolC(corner) {
|
||||||
UpdateCornerTableForSymbolC(corner) { <b>Type</b>
|
|
||||||
corner_a = active_corner_stack.back();
|
corner_a = active_corner_stack.back();
|
||||||
corner_b = corner_table_->Previous(corner_a);
|
corner_b = corner_table_->Previous(corner_a);
|
||||||
while (corner_table_->Opposite(corner_b) >= 0) {
|
while (corner_table_->Opposite(corner_b) >= 0) {
|
||||||
@ -206,13 +202,12 @@ UpdateCornerTableForSymbolC(corner) { <b>Type</b
|
|||||||
corner + 2, corner_table_->Vertex(corner_table_->Previous(corner_a)));
|
corner + 2, corner_table_->Vertex(corner_table_->Previous(corner_a)));
|
||||||
return vertex_x;
|
return vertex_x;
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 id="updatecornertableforsymbollr">UpdateCornerTableForSymbolLR()</h3>
|
<h3 id="updatecornertableforsymbollr">UpdateCornerTableForSymbolLR()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>UpdateCornerTableForSymbolLR(corner, symbol) {
|
||||||
UpdateCornerTableForSymbolLR(corner, symbol) { <b>Type</b>
|
|
||||||
if (symbol == TOPOLOGY_R) {
|
if (symbol == TOPOLOGY_R) {
|
||||||
opp_corner = corner + 2;
|
opp_corner = corner + 2;
|
||||||
} else {
|
} else {
|
||||||
@ -227,13 +222,12 @@ UpdateCornerTableForSymbolLR(corner, symbol) { <b>Type</b
|
|||||||
corner_table_->Previous(opp_corner),
|
corner_table_->Previous(opp_corner),
|
||||||
corner_table_->Vertex(corner_table_->Next(corner_a)));
|
corner_table_->Vertex(corner_table_->Next(corner_a)));
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 id="handlesymbols">HandleSymbolS()</h3>
|
<h3 id="handlesymbols">HandleSymbolS()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>HandleSymbolS(corner) {
|
||||||
HandleSymbolS(corner) { <b>Type</b>
|
|
||||||
corner_b = active_corner_stack.pop_back();
|
corner_b = active_corner_stack.pop_back();
|
||||||
it = topology_split_active_corners.find(symbol_id);
|
it = topology_split_active_corners.find(symbol_id);
|
||||||
if (it != topology_split_active_corners.end()) {
|
if (it != topology_split_active_corners.end()) {
|
||||||
@ -258,24 +252,22 @@ HandleSymbolS(corner) { <b>Type</b
|
|||||||
}
|
}
|
||||||
corner_table_->MakeVertexIsolated(vertex_n);
|
corner_table_->MakeVertexIsolated(vertex_n);
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 id="updatecornertableforsymbole">UpdateCornerTableForSymbolE()</h3>
|
<h3 id="updatecornertableforsymbole">UpdateCornerTableForSymbolE()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>UpdateCornerTableForSymbolE() {
|
||||||
UpdateCornerTableForSymbolE() { <b>Type</b>
|
|
||||||
corner_table_->MapCornerToVertex(corner, num_vertices++);
|
corner_table_->MapCornerToVertex(corner, num_vertices++);
|
||||||
corner_table_->MapCornerToVertex(corner + 1, num_vertices++);
|
corner_table_->MapCornerToVertex(corner + 1, num_vertices++);
|
||||||
corner_table_->MapCornerToVertex(corner + 2, num_vertices++);
|
corner_table_->MapCornerToVertex(corner + 2, num_vertices++);
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 id="updatecornertableforinteriorface">UpdateCornerTableForInteriorFace()</h3>
|
<h3 id="updatecornertableforinteriorface">UpdateCornerTableForInteriorFace()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>UpdateCornerTableForInteriorFace() {
|
||||||
UpdateCornerTableForInteriorFace() { <b>Type</b>
|
|
||||||
corner_b = corner_table_->Previous(corner);
|
corner_b = corner_table_->Previous(corner);
|
||||||
while (corner_table_->Opposite(corner_b) >= 0) {
|
while (corner_table_->Opposite(corner_b) >= 0) {
|
||||||
corner_b = corner_table_->Previous(corner_table_->Opposite(corner_b));
|
corner_b = corner_table_->Previous(corner_table_->Opposite(corner_b));
|
||||||
@ -292,14 +284,12 @@ UpdateCornerTableForInteriorFace() { <b>Type</b
|
|||||||
corner_table_->MapCornerToVertex(
|
corner_table_->MapCornerToVertex(
|
||||||
new_corner + 2, corner_table_->Vertex(corner_table_->Next(corner)));
|
new_corner + 2, corner_table_->Vertex(corner_table_->Next(corner)));
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 id="istopologysplit">IsTopologySplit()</h3>
|
<h3 id="istopologysplit">IsTopologySplit()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>IsTopologySplit(encoder_symbol_id, *out_face_edge,
|
||||||
IsTopologySplit(encoder_symbol_id, *out_face_edge, <b>Type</b>
|
|
||||||
|
|
||||||
*out_encoder_split_symbol_id) {
|
*out_encoder_split_symbol_id) {
|
||||||
if (topology_split_data_.size() == 0)
|
if (topology_split_data_.size() == 0)
|
||||||
return false;
|
return false;
|
||||||
@ -311,13 +301,12 @@ IsTopologySplit(encoder_symbol_id, *out_face_edge, <b>Type</b
|
|||||||
topology_split_data_.pop_back();
|
topology_split_data_.pop_back();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 id="decodeattributeconnectivitiesonface">DecodeAttributeConnectivitiesOnFace()</h3>
|
<h3 id="decodeattributeconnectivitiesonface">DecodeAttributeConnectivitiesOnFace()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>DecodeAttributeConnectivitiesOnFace(corner) {
|
||||||
DecodeAttributeConnectivitiesOnFace(corner) { <b>Type</b>
|
|
||||||
corners[3] = {corner, corner_table_->Next(corner),
|
corners[3] = {corner, corner_table_->Next(corner),
|
||||||
corner_table_->Previous(corner)}
|
corner_table_->Previous(corner)}
|
||||||
for (c = 0; c < 3; ++c) {
|
for (c = 0; c < 3; ++c) {
|
||||||
@ -336,15 +325,14 @@ DecodeAttributeConnectivitiesOnFace(corner) { <b>Type</b
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 id="setoppositecorners">SetOppositeCorners()</h3>
|
<h3 id="setoppositecorners">SetOppositeCorners()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>SetOppositeCorners(corner_0, corner_1) {
|
||||||
SetOppositeCorners(corner_0, corner_1) { <b>Type</b>
|
|
||||||
corner_table_->SetOppositeCorner(corner_0, corner_1);
|
corner_table_->SetOppositeCorner(corner_0, corner_1);
|
||||||
corner_table_->SetOppositeCorner(corner_1, corner_0);
|
corner_table_->SetOppositeCorner(corner_1, corner_0);
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,26 +2,27 @@
|
|||||||
|
|
||||||
### InitializeDecoder()
|
### InitializeDecoder()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
InitializeDecoder() { <b>Type</b>
|
InitializeDecoder() {
|
||||||
<b>edgebreaker_decoder_type</b> UI8
|
edgebreaker_decoder_type UI8
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeConnectivity()
|
### DecodeConnectivity()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
DecodeConnectivity() { <b>Type</b>
|
DecodeConnectivity() {
|
||||||
<b>num_new_verts</b> UI32
|
num_new_verts UI32
|
||||||
<b>num_encoded_vertices</b> UI32
|
num_encoded_vertices UI32
|
||||||
<b>num_faces</b> UI32
|
num_faces UI32
|
||||||
<b>num_attribute_data</b> I8
|
num_attribute_data I8
|
||||||
<b>num_encoded_symbols</b> UI32
|
num_encoded_symbols UI32
|
||||||
<b>num_encoded_split_symbols</b> UI32
|
num_encoded_split_symbols UI32
|
||||||
<b>encoded_connectivity_size</b> UI32
|
encoded_connectivity_size UI32
|
||||||
// file pointer must be set to current position + encoded_connectivity_size
|
// file pointer must be set to current position
|
||||||
|
// + encoded_connectivity_size
|
||||||
hole_and_split_bytes = DecodeHoleAndTopologySplitEvents()
|
hole_and_split_bytes = DecodeHoleAndTopologySplitEvents()
|
||||||
// file pointer must be set to old current position
|
// file pointer must be set to old current position
|
||||||
EdgeBreakerTraversalValence_Start()
|
EdgeBreakerTraversalValence_Start()
|
||||||
@ -47,14 +48,14 @@ DecodeConnectivity() { <b>Type</b
|
|||||||
// Preallocate vertex to value mapping
|
// Preallocate vertex to value mapping
|
||||||
AssignPointsToCorners()
|
AssignPointsToCorners()
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### AssignPointsToCorners()
|
### AssignPointsToCorners()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
AssignPointsToCorners() { <b>Type</b>
|
AssignPointsToCorners() {
|
||||||
decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
|
decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
|
||||||
if (attribute_data_.size() == 0) {
|
if (attribute_data_.size() == 0) {
|
||||||
for (f = 0; f < decoder_->mesh()->num_faces(); ++f) {
|
for (f = 0; f < decoder_->mesh()->num_faces(); ++f) {
|
||||||
@ -125,14 +126,14 @@ AssignPointsToCorners() { <b>Type</b
|
|||||||
}
|
}
|
||||||
decoder_->point_cloud()->set_num_points(point_to_corner_map.size());
|
decoder_->point_cloud()->set_num_points(point_to_corner_map.size());
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeConnectivity()
|
### DecodeConnectivity()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
DecodeConnectivity(num_symbols) { <b>Type</b>
|
DecodeConnectivity(num_symbols) {
|
||||||
for (i = 0; i < num_symbols; ++i) {
|
for (i = 0; i < num_symbols; ++i) {
|
||||||
symbol = TraversalValence_DecodeSymbol()
|
symbol = TraversalValence_DecodeSymbol()
|
||||||
corner = 3 * num_faces++
|
corner = 3 * num_faces++
|
||||||
@ -187,14 +188,14 @@ DecodeConnectivity(num_symbols) { <b>Type</b
|
|||||||
}
|
}
|
||||||
Return num_vertices;
|
Return num_vertices;
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### UpdateCornerTableForSymbolC()
|
### UpdateCornerTableForSymbolC()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
UpdateCornerTableForSymbolC(corner) { <b>Type</b>
|
UpdateCornerTableForSymbolC(corner) {
|
||||||
corner_a = active_corner_stack.back();
|
corner_a = active_corner_stack.back();
|
||||||
corner_b = corner_table_->Previous(corner_a);
|
corner_b = corner_table_->Previous(corner_a);
|
||||||
while (corner_table_->Opposite(corner_b) >= 0) {
|
while (corner_table_->Opposite(corner_b) >= 0) {
|
||||||
@ -210,15 +211,15 @@ UpdateCornerTableForSymbolC(corner) { <b>Type</b
|
|||||||
corner + 2, corner_table_->Vertex(corner_table_->Previous(corner_a)));
|
corner + 2, corner_table_->Vertex(corner_table_->Previous(corner_a)));
|
||||||
return vertex_x;
|
return vertex_x;
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### UpdateCornerTableForSymbolLR()
|
### UpdateCornerTableForSymbolLR()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
UpdateCornerTableForSymbolLR(corner, symbol) { <b>Type</b>
|
UpdateCornerTableForSymbolLR(corner, symbol) {
|
||||||
if (symbol == TOPOLOGY_R) {
|
if (symbol == TOPOLOGY_R) {
|
||||||
opp_corner = corner + 2;
|
opp_corner = corner + 2;
|
||||||
} else {
|
} else {
|
||||||
@ -233,14 +234,14 @@ UpdateCornerTableForSymbolLR(corner, symbol) { <b>Type</b
|
|||||||
corner_table_->Previous(opp_corner),
|
corner_table_->Previous(opp_corner),
|
||||||
corner_table_->Vertex(corner_table_->Next(corner_a)));
|
corner_table_->Vertex(corner_table_->Next(corner_a)));
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### HandleSymbolS()
|
### HandleSymbolS()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
HandleSymbolS(corner) { <b>Type</b>
|
HandleSymbolS(corner) {
|
||||||
corner_b = active_corner_stack.pop_back();
|
corner_b = active_corner_stack.pop_back();
|
||||||
it = topology_split_active_corners.find(symbol_id);
|
it = topology_split_active_corners.find(symbol_id);
|
||||||
if (it != topology_split_active_corners.end()) {
|
if (it != topology_split_active_corners.end()) {
|
||||||
@ -265,26 +266,26 @@ HandleSymbolS(corner) { <b>Type</b
|
|||||||
}
|
}
|
||||||
corner_table_->MakeVertexIsolated(vertex_n);
|
corner_table_->MakeVertexIsolated(vertex_n);
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### UpdateCornerTableForSymbolE()
|
### UpdateCornerTableForSymbolE()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
UpdateCornerTableForSymbolE() { <b>Type</b>
|
UpdateCornerTableForSymbolE() {
|
||||||
corner_table_->MapCornerToVertex(corner, num_vertices++);
|
corner_table_->MapCornerToVertex(corner, num_vertices++);
|
||||||
corner_table_->MapCornerToVertex(corner + 1, num_vertices++);
|
corner_table_->MapCornerToVertex(corner + 1, num_vertices++);
|
||||||
corner_table_->MapCornerToVertex(corner + 2, num_vertices++);
|
corner_table_->MapCornerToVertex(corner + 2, num_vertices++);
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### UpdateCornerTableForInteriorFace()
|
### UpdateCornerTableForInteriorFace()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
UpdateCornerTableForInteriorFace() { <b>Type</b>
|
UpdateCornerTableForInteriorFace() {
|
||||||
corner_b = corner_table_->Previous(corner);
|
corner_b = corner_table_->Previous(corner);
|
||||||
while (corner_table_->Opposite(corner_b) >= 0) {
|
while (corner_table_->Opposite(corner_b) >= 0) {
|
||||||
corner_b = corner_table_->Previous(corner_table_->Opposite(corner_b));
|
corner_b = corner_table_->Previous(corner_table_->Opposite(corner_b));
|
||||||
@ -301,15 +302,14 @@ UpdateCornerTableForInteriorFace() { <b>Type</b
|
|||||||
corner_table_->MapCornerToVertex(
|
corner_table_->MapCornerToVertex(
|
||||||
new_corner + 2, corner_table_->Vertex(corner_table_->Next(corner)));
|
new_corner + 2, corner_table_->Vertex(corner_table_->Next(corner)));
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### IsTopologySplit()
|
### IsTopologySplit()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
IsTopologySplit(encoder_symbol_id, *out_face_edge, <b>Type</b>
|
IsTopologySplit(encoder_symbol_id, *out_face_edge,
|
||||||
|
|
||||||
*out_encoder_split_symbol_id) {
|
*out_encoder_split_symbol_id) {
|
||||||
if (topology_split_data_.size() == 0)
|
if (topology_split_data_.size() == 0)
|
||||||
return false;
|
return false;
|
||||||
@ -321,14 +321,14 @@ IsTopologySplit(encoder_symbol_id, *out_face_edge, <b>Type</b
|
|||||||
topology_split_data_.pop_back();
|
topology_split_data_.pop_back();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeAttributeConnectivitiesOnFace()
|
### DecodeAttributeConnectivitiesOnFace()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
DecodeAttributeConnectivitiesOnFace(corner) { <b>Type</b>
|
DecodeAttributeConnectivitiesOnFace(corner) {
|
||||||
corners[3] = {corner, corner_table_->Next(corner),
|
corners[3] = {corner, corner_table_->Next(corner),
|
||||||
corner_table_->Previous(corner)}
|
corner_table_->Previous(corner)}
|
||||||
for (c = 0; c < 3; ++c) {
|
for (c = 0; c < 3; ++c) {
|
||||||
@ -347,16 +347,16 @@ DecodeAttributeConnectivitiesOnFace(corner) { <b>Type</b
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### SetOppositeCorners()
|
### SetOppositeCorners()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
SetOppositeCorners(corner_0, corner_1) { <b>Type</b>
|
SetOppositeCorners(corner_0, corner_1) {
|
||||||
corner_table_->SetOppositeCorner(corner_0, corner_1);
|
corner_table_->SetOppositeCorner(corner_0, corner_1);
|
||||||
corner_table_->SetOppositeCorner(corner_1, corner_0);
|
corner_table_->SetOppositeCorner(corner_1, corner_0);
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -2,10 +2,9 @@
|
|||||||
|
|
||||||
<h3 id="decodeconnectivitydata">DecodeConnectivityData()</h3>
|
<h3 id="decodeconnectivitydata">DecodeConnectivityData()</h3>
|
||||||
|
|
||||||
<div class="syntax">
|
<div class="draco-syntax highlighter-rouge"><pre class="highlight"><code>DecodeConnectivityData()
|
||||||
DecodeConnectivityData() <b>Type</b>
|
|
||||||
InitializeDecoder()
|
InitializeDecoder()
|
||||||
DecodeConnectivity()
|
DecodeConnectivity()
|
||||||
}
|
}
|
||||||
|
</code></pre>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
### DecodeConnectivityData()
|
### DecodeConnectivityData()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
DecodeConnectivityData() <b>Type</b>
|
DecodeConnectivityData()
|
||||||
InitializeDecoder()
|
InitializeDecoder()
|
||||||
DecodeConnectivity()
|
DecodeConnectivity()
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
@ -24,12 +24,12 @@ a
|
|||||||
text-decoration: underline
|
text-decoration: underline
|
||||||
|
|
||||||
pre
|
pre
|
||||||
font-family: $monofont
|
//font-family: $monofont
|
||||||
border: $gridweight solid $gridcolor
|
//border: $gridweight solid $gridcolor
|
||||||
//background-color: #f7f7f7
|
//background-color: #f7f7f7
|
||||||
padding: 1em
|
//padding: 1em
|
||||||
margin-left: 1em
|
//margin-left: 1em
|
||||||
overflow-x: auto
|
//overflow-x: auto
|
||||||
|
|
||||||
code
|
code
|
||||||
//color: #060
|
//color: #060
|
||||||
@ -80,12 +80,9 @@ figure.highlight
|
|||||||
padding-right: 1em
|
padding-right: 1em
|
||||||
border: $gridweight solid #ccc
|
border: $gridweight solid #ccc
|
||||||
|
|
||||||
div.syntax
|
div.draco-syntax pre
|
||||||
//background-color: $gridcolor
|
|
||||||
//background-image: linear-gradient(transparent 50%, rgba(255,255,255,.5) 50%)
|
|
||||||
//background-size: 40px 40px
|
|
||||||
background-color: #fff
|
background-color: #fff
|
||||||
background-image: linear-gradient(90deg, transparent 540px, #abced4 540px, #abced4 542px, transparent 542px), linear-gradient($gridcolor .1em, transparent .1em)
|
background-image: linear-gradient(90deg, transparent 580px, #abced4 580px, #abced4 582px, transparent 582px), linear-gradient($gridcolor .1em, transparent .1em)
|
||||||
background-size: 100% 1.3em
|
background-size: 100% 1.3em
|
||||||
border-left: $gridweight solid $gridcolor
|
border-left: $gridweight solid $gridcolor
|
||||||
border-right: $gridweight solid $gridcolor
|
border-right: $gridweight solid $gridcolor
|
||||||
|
10
docs/index.md
Normal file
10
docs/index.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
layout: spec
|
||||||
|
title: Draco 3D Graphics Compression
|
||||||
|
---
|
||||||
|
|
||||||
|
* [Draft Draco Bitstream Specification][spec]
|
||||||
|
* [README file for specification authors][readme]
|
||||||
|
|
||||||
|
[spec]: /docs/spec/
|
||||||
|
[readme]: /docs/spec/README
|
@ -1,5 +1,7 @@
|
|||||||
## Conventions
|
## Conventions
|
||||||
|
|
||||||
|
### General Conventions
|
||||||
|
|
||||||
* When bit reading is finished it will always pad the read to the current
|
* When bit reading is finished it will always pad the read to the current
|
||||||
byte.
|
byte.
|
||||||
|
|
||||||
@ -24,3 +26,52 @@
|
|||||||
|
|
||||||
* The hole and split data must be decoded before the EdgeBreaker symbols are
|
* The hole and split data must be decoded before the EdgeBreaker symbols are
|
||||||
decoded.
|
decoded.
|
||||||
|
|
||||||
|
|
||||||
|
### Method of describing bitstream syntax
|
||||||
|
|
||||||
|
**FIXME: This section is borrowed from AV1, and should be modified for the Draco
|
||||||
|
spec.**
|
||||||
|
|
||||||
|
The description style of the syntax is similar to the C++ programming language.
|
||||||
|
Syntax elements in the bitstream are represented in bold type. Each syntax
|
||||||
|
element is described by its name (using only lower case letters with
|
||||||
|
underscore characters) and a descriptor for its method of coded
|
||||||
|
representation. The decoding process behaves according to the value of the
|
||||||
|
syntax element and to the values of previously decoded syntax elements. When a
|
||||||
|
value of a syntax element is used in the syntax tables or the text, it appears
|
||||||
|
in regular (i.e. not bold) type. If the value of a syntax element is being
|
||||||
|
computed (e.g. being written with a default value instead of being coded in
|
||||||
|
the bitstream), it also appears in regular type.
|
||||||
|
|
||||||
|
In some cases the syntax tables may use the values of other variables derived
|
||||||
|
from syntax elements values. Such variables appear in the syntax tables, or
|
||||||
|
text, named by a mixture of lower case and upper case letter and without any
|
||||||
|
underscore characters. Variables starting with an upper case letter are
|
||||||
|
derived for the decoding of the current syntax structure and all depending
|
||||||
|
syntax structures. These variables may be used in the decoding process for
|
||||||
|
later syntax structures. Variables starting with a lower case letter are only
|
||||||
|
used within the process from which they are derived.
|
||||||
|
|
||||||
|
Constant values appear in all upper case letters with underscore characters.
|
||||||
|
|
||||||
|
Constant lookup tables appear in all lower case letters with underscore
|
||||||
|
characters.
|
||||||
|
|
||||||
|
Hexadecimal notation, indicated by prefixing the hexadecimal number by `0x`,
|
||||||
|
may be used when the number of bits is an integer multiple of 4. For example,
|
||||||
|
`0x1a` represents a bit string `0001 1010`.
|
||||||
|
|
||||||
|
Binary notation is indicated by prefixing the binary number by `0b`. For
|
||||||
|
example, `0b00011010` represents a bit string `0001 1010`. Binary numbers may
|
||||||
|
include underscore characters to enhance readability. If present, the
|
||||||
|
underscore characters appear every 4 binary digits starting from the LSB. For
|
||||||
|
example, `0b11010` may also be written as `0b1_1010`.
|
||||||
|
|
||||||
|
A value equal to 0 represents a FALSE condition in a test statement. The
|
||||||
|
value TRUE is represented by any value not equal to 0.
|
||||||
|
|
||||||
|
The following table lists examples of the syntax specification format. When
|
||||||
|
`syntax_element` appears (with bold face font), it specifies that this syntax
|
||||||
|
element is parsed from the bitstream.
|
||||||
|
|
||||||
|
266
docs/spec/README.md
Normal file
266
docs/spec/README.md
Normal file
@ -0,0 +1,266 @@
|
|||||||
|
---
|
||||||
|
layout: spec
|
||||||
|
title: "README: Draco Spec Authoring Information"
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
# Authoring Info, Draco 3D Bitstream Specification
|
||||||
|
{:.no_toc}
|
||||||
|
|
||||||
|
This document, once published, will define the Draco 3D Geometry Compression
|
||||||
|
bitstream format and decoding process.
|
||||||
|
|
||||||
|
**Contents**
|
||||||
|
|
||||||
|
* TOC
|
||||||
|
{:toc}
|
||||||
|
|
||||||
|
The document is built from plaintext section and subsection [Markdown] files
|
||||||
|
(more specifically, [kramdown] files) using the [Jekyll] static site building
|
||||||
|
tool. GitHub supports Jekyll natively.
|
||||||
|
|
||||||
|
The `docs/` directory of this project is meant to contain only documentation
|
||||||
|
and web content. The commands below should be issued from `docs/`. We do not
|
||||||
|
want to pollute the code tree with Ruby and Jekyll config information and
|
||||||
|
content.
|
||||||
|
|
||||||
|
The `docs/spec/` directory contains the files needed to work on this
|
||||||
|
specification document.
|
||||||
|
|
||||||
|
|
||||||
|
## Building Locally
|
||||||
|
|
||||||
|
Contributors will want to preview their edits locally before submitting pull
|
||||||
|
requests. Doing so requires a sane Ruby and rubygems environment. We use [rbenv]
|
||||||
|
and [bundler] to "groom" the project environment and avoid conflicts.
|
||||||
|
|
||||||
|
_**Important:** All commands are to be run as an ordinary, unprivileged user._
|
||||||
|
|
||||||
|
|
||||||
|
### Ruby and rbenv
|
||||||
|
|
||||||
|
This project currently depends on Ruby v2.3.0. Because your distro may lack this
|
||||||
|
version -- or installing it may conflict with your system's installed version --
|
||||||
|
first [install rbenv], then install Ruby v2.3.0 within it (again, in userland).
|
||||||
|
|
||||||
|
~~~~~
|
||||||
|
# list all available versions:
|
||||||
|
$ rbenv install -l
|
||||||
|
2.2.6
|
||||||
|
2.3.0-dev
|
||||||
|
2.3.0-preview1
|
||||||
|
2.3.0-preview2
|
||||||
|
2.3.0
|
||||||
|
|
||||||
|
# install a Ruby version:
|
||||||
|
$ rbenv install 2.3.0
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
### Bundler
|
||||||
|
|
||||||
|
Gem dependencies are managed by [bundler].
|
||||||
|
|
||||||
|
~~~~~
|
||||||
|
$ gem install bundler
|
||||||
|
|
||||||
|
# Filesystem location where gems are installed
|
||||||
|
$ gem env home
|
||||||
|
# => ~/.rbenv/versions/<ruby-version>/lib/ruby/gems/...
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
## Fork and Clone the Repo
|
||||||
|
|
||||||
|
First, use the **Fork** button on the repo's [homepage] to fork a copy to your
|
||||||
|
GitHub account.
|
||||||
|
|
||||||
|
Second, clone your fork locally:
|
||||||
|
|
||||||
|
~~~~~
|
||||||
|
git clone git@github.com:<username>/draco.git
|
||||||
|
cd draco
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
_**Note** that we **strongly** recommend [using SSH] with GitHub, not HTTPS._
|
||||||
|
|
||||||
|
Third, add a Git remote `upstream` that points to google/draco:
|
||||||
|
|
||||||
|
~~~~~
|
||||||
|
git remote add upstream git@github.com:google/draco.git
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
Your local repo with then have two remotes, `upstream` pointing at the
|
||||||
|
authoritative GitHub repo and `origin` pointing at your GitHub fork.
|
||||||
|
|
||||||
|
~~~~~
|
||||||
|
$ git remote
|
||||||
|
origin
|
||||||
|
upstream
|
||||||
|
|
||||||
|
$ git remote show origin
|
||||||
|
* remote origin
|
||||||
|
Fetch URL: git@github.com:<username>/draco.git
|
||||||
|
Push URL: git@github.com:<username>/draco.git
|
||||||
|
HEAD branch: master
|
||||||
|
Remote branch:
|
||||||
|
master tracked
|
||||||
|
Local branch configured for 'git pull':
|
||||||
|
master merges with remote master
|
||||||
|
Local ref configured for 'git push':
|
||||||
|
master pushes to master (up to date)
|
||||||
|
|
||||||
|
$ git remote show upstream
|
||||||
|
* remote upstream
|
||||||
|
Fetch URL: git@github.com:google/draco.git
|
||||||
|
Push URL: git@github.com:google/draco.git
|
||||||
|
HEAD branch: master
|
||||||
|
Remote branch:
|
||||||
|
master tracked
|
||||||
|
Local ref configured for 'git push':
|
||||||
|
master pushes to master (up to date)
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
[**See this page**][1] for a longer discussion of managing remotes and general
|
||||||
|
GitHub workflow.
|
||||||
|
|
||||||
|
**Important: The following commands should be issued from the `docs/`
|
||||||
|
directory.**
|
||||||
|
|
||||||
|
|
||||||
|
### Set Local Ruby Version (rbenv)
|
||||||
|
|
||||||
|
In the `docs/` directory of your local clone, do:
|
||||||
|
|
||||||
|
~~~~~
|
||||||
|
rbenv local 2.3.0
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
Regardless of any other Rubies installed on your system, the project environment
|
||||||
|
will now use v2.3.0 and gems appropriate for it.
|
||||||
|
|
||||||
|
|
||||||
|
### Install Gem Dependencies with Bundler
|
||||||
|
|
||||||
|
In the `docs/` directory of your local clone, run
|
||||||
|
|
||||||
|
~~~~~
|
||||||
|
bundle install
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
Bundler will set dependencies and install needed gems as listed in
|
||||||
|
`Gemfile.lock`.
|
||||||
|
|
||||||
|
_**Note** that you may need Ruby development headers installed on your system
|
||||||
|
for some gems to compile successfully._
|
||||||
|
|
||||||
|
|
||||||
|
### Build and Preview Locally with Jekyll
|
||||||
|
|
||||||
|
~~~~~
|
||||||
|
bundle exec jekyll serve
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
This will build the documentation tree and launch a local webserver at
|
||||||
|
`http://127.0.0.1:4000/docs/` (by default). Jekyll will also watch the
|
||||||
|
the filesystem for changes and rebuild the document as needed.
|
||||||
|
|
||||||
|
|
||||||
|
## **Markdown & Formatting Conventions**
|
||||||
|
|
||||||
|
The spec document is composed mostly of syntax tables, styled with CSS. Mark
|
||||||
|
them up as follows:
|
||||||
|
|
||||||
|
* Use the [fenced code block][fenced] kramdown syntax: A line beginning with
|
||||||
|
three or more tildes (`~`) starts the code block, another such line ends it.
|
||||||
|
|
||||||
|
* Use kramdown's [inline attribute syntax][inline] to apply the CSS class
|
||||||
|
`draco-syntax` to your code block by placing `{:.draco-syntax }` on the line
|
||||||
|
immediately after the code-block closing delimiter.
|
||||||
|
|
||||||
|
* Some syntax elements as annotated with their type and size in a right-hand
|
||||||
|
column. In your text editor, position these annotations at column 73.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
<pre><code>~~~~~
|
||||||
|
DecodeHeader() {
|
||||||
|
draco_string UI8[5]
|
||||||
|
major_version UI8
|
||||||
|
minor_version UI8
|
||||||
|
encoder_type UI8
|
||||||
|
encoder_method UI8
|
||||||
|
flags
|
||||||
|
}
|
||||||
|
~~~~~
|
||||||
|
{:.draco-syntax}</code></pre>
|
||||||
|
|
||||||
|
... **will render as:**
|
||||||
|
|
||||||
|
|
||||||
|
~~~~~
|
||||||
|
DecodeHeader() {
|
||||||
|
draco_string UI8[5]
|
||||||
|
major_version UI8
|
||||||
|
minor_version UI8
|
||||||
|
encoder_type UI8
|
||||||
|
encoder_method UI8
|
||||||
|
flags
|
||||||
|
}
|
||||||
|
~~~~~
|
||||||
|
{:.draco-syntax}
|
||||||
|
|
||||||
|
|
||||||
|
## General GitHub Workflow
|
||||||
|
|
||||||
|
Always do your work in a local branch.
|
||||||
|
|
||||||
|
~~~~~
|
||||||
|
git co -b my-branch-name
|
||||||
|
## work ##
|
||||||
|
git add <filenames or -A for all>
|
||||||
|
git ci -m "Reasonably clear commit message"
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
Push your branch to `origin` (your GitHub fork):
|
||||||
|
|
||||||
|
~~~~~
|
||||||
|
git push origin my-branch-name
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
Next, visit the `upstream` [homepage]. If you are logged-in, GitHub will be
|
||||||
|
aware of your recently pushed branch, and offer an in-page widget for submitting
|
||||||
|
a pull request for the project maintainers to consider.
|
||||||
|
|
||||||
|
Once your pull request is merged into upstream's master branch, you may
|
||||||
|
synchronize your clone (and remote `origin`) as follows:
|
||||||
|
|
||||||
|
~~~~~
|
||||||
|
git co master
|
||||||
|
git fetch upstream
|
||||||
|
git merge upstream/master
|
||||||
|
git push origin
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
Your old working branch is no longer needed, so do some housekeeping:
|
||||||
|
|
||||||
|
~~~~~
|
||||||
|
git br -d my-branch-name
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
[Markdown]: https://daringfireball.net/projects/markdown/
|
||||||
|
[kramdown]: https://kramdown.gettalong.org/
|
||||||
|
[Jekyll]: https://jekyllrb.com/
|
||||||
|
[rbenv]: https://github.com/rbenv/rbenv
|
||||||
|
[bundler]: http://bundler.io/
|
||||||
|
[install rbenv]: https://github.com/rbenv/rbenv#installation
|
||||||
|
[homepage]: https://github.com/google/draco
|
||||||
|
[using SSH]: https://help.github.com/articles/connecting-to-github-with-ssh/
|
||||||
|
[1]: https://2buntu.com/articles/1459/keeping-your-forked-repo-synced-with-the-upstream-source/
|
||||||
|
[fenced]: https://kramdown.gettalong.org/syntax.html#fenced-code-blocks
|
||||||
|
[inline]: https://kramdown.gettalong.org/syntax.html#block-ials
|
||||||
|
|
@ -18,3 +18,4 @@ DecodeAttributesDecoderData(buffer) {
|
|||||||
point_attribute_ids_[i] = att_id;
|
point_attribute_ids_[i] = att_id;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -18,6 +18,7 @@ DecodeVarint<IT>() {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### ConvertSymbolToSignedInt()
|
### ConvertSymbolToSignedInt()
|
||||||
@ -33,10 +34,13 @@ ConvertSymbolToSignedInt() {
|
|||||||
return signed_val
|
return signed_val
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
Sequential Decoder
|
Sequential Decoder
|
||||||
|
|
||||||
|
FIXME: ^^^ Heading level?
|
||||||
|
|
||||||
### decode_connectivity()
|
### decode_connectivity()
|
||||||
|
|
||||||
~~~~~
|
~~~~~
|
||||||
@ -59,3 +63,4 @@ decode_connectivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -8,6 +8,7 @@ Opposite(corner) {
|
|||||||
return opposite_corners_[corner];
|
return opposite_corners_[corner];
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### Next()
|
### Next()
|
||||||
@ -17,6 +18,7 @@ Next(corner) {
|
|||||||
return LocalIndex(++corner) ? corner : corner - 3;
|
return LocalIndex(++corner) ? corner : corner - 3;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### Previous()
|
### Previous()
|
||||||
@ -26,6 +28,7 @@ Previous(corner) {
|
|||||||
return LocalIndex(corner) ? corner - 1 : corner + 2;
|
return LocalIndex(corner) ? corner - 1 : corner + 2;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### Vertex()
|
### Vertex()
|
||||||
@ -35,6 +38,7 @@ Vertex(corner) {
|
|||||||
faces_[Face(corner)][LocalIndex(corner)];
|
faces_[Face(corner)][LocalIndex(corner)];
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### Face()
|
### Face()
|
||||||
@ -44,6 +48,7 @@ Face(corner) {
|
|||||||
return corner / 3;
|
return corner / 3;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### LocalIndex()
|
### LocalIndex()
|
||||||
@ -53,6 +58,7 @@ LocalIndex(corner) {
|
|||||||
return corner % 3;
|
return corner % 3;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### num_vertices()
|
### num_vertices()
|
||||||
@ -62,6 +68,7 @@ num_vertices() {
|
|||||||
return vertex_corners_.size();
|
return vertex_corners_.size();
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### num_corners()
|
### num_corners()
|
||||||
@ -71,6 +78,7 @@ num_corners() {
|
|||||||
return faces_.size() * 3;
|
return faces_.size() * 3;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### num_faces()
|
### num_faces()
|
||||||
@ -80,6 +88,7 @@ num_faces() {
|
|||||||
return faces_.size();
|
return faces_.size();
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### bool IsOnBoundary()
|
### bool IsOnBoundary()
|
||||||
@ -92,7 +101,7 @@ bool IsOnBoundary(vert) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### SwingRight()
|
### SwingRight()
|
||||||
@ -102,6 +111,7 @@ SwingRight(corner) {
|
|||||||
return Previous(Opposite(Previous(corner)));
|
return Previous(Opposite(Previous(corner)));
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### SwingLeft()
|
### SwingLeft()
|
||||||
@ -111,6 +121,7 @@ SwingLeft(corner) {
|
|||||||
return Next(Opposite(Next(corner)));
|
return Next(Opposite(Next(corner)));
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### GetLeftCorner()
|
### GetLeftCorner()
|
||||||
@ -122,6 +133,7 @@ GetLeftCorner(corner_id) {
|
|||||||
return Opposite(Previous(corner_id));
|
return Opposite(Previous(corner_id));
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### GetRightCorner()
|
### GetRightCorner()
|
||||||
@ -133,6 +145,7 @@ GetRightCorner(corner_id) {
|
|||||||
return Opposite(Next(corner_id));
|
return Opposite(Next(corner_id));
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### SetOppositeCorner()
|
### SetOppositeCorner()
|
||||||
@ -142,7 +155,7 @@ SetOppositeCorner(corner_id, pp_corner_id) {
|
|||||||
opposite_corners_[corner_id] = opp_corner_id;
|
opposite_corners_[corner_id] = opp_corner_id;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### MapCornerToVertex()
|
### MapCornerToVertex()
|
||||||
@ -156,6 +169,7 @@ MapCornerToVertex(corner_id, vert_id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### UpdateVertexToCornerMap()
|
### UpdateVertexToCornerMap()
|
||||||
@ -176,7 +190,7 @@ UpdateVertexToCornerMap(vert) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### LeftMostCorner()
|
### LeftMostCorner()
|
||||||
@ -186,6 +200,7 @@ LeftMostCorner(v) {
|
|||||||
return vertex_corners_[v];
|
return vertex_corners_[v];
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### MakeVertexIsolated()
|
### MakeVertexIsolated()
|
||||||
@ -195,3 +210,4 @@ MakeVertexIsolated(vert) {
|
|||||||
vertex_corners_[vert] = kInvalidCornerIndex;
|
vertex_corners_[vert] = kInvalidCornerIndex;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -11,6 +11,7 @@ IsFaceVisited(corner_id) {
|
|||||||
return is_face_visited_[corner_id / 3];
|
return is_face_visited_[corner_id / 3];
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### MarkFaceVisited()
|
### MarkFaceVisited()
|
||||||
@ -20,6 +21,7 @@ MarkFaceVisited(face_id) {
|
|||||||
is_face_visited_[face_id] = true;
|
is_face_visited_[face_id] = true;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### IsVertexVisited()
|
### IsVertexVisited()
|
||||||
@ -29,6 +31,7 @@ IsVertexVisited(vert_id) {
|
|||||||
return is_vertex_visited_[vert_id];
|
return is_vertex_visited_[vert_id];
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### MarkVertexVisited()
|
### MarkVertexVisited()
|
||||||
@ -38,3 +41,4 @@ MarkVertexVisited(vert_id) {
|
|||||||
is_vertex_visited_[vert_id] = true;
|
is_vertex_visited_[vert_id] = true;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -2,35 +2,35 @@
|
|||||||
|
|
||||||
### Decode()
|
### Decode()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
Decode() { <b>Type</b>
|
Decode() {
|
||||||
DecodeHeader()
|
DecodeHeader()
|
||||||
DecodeConnectivityData()
|
DecodeConnectivityData()
|
||||||
DecodeAttributeData()}
|
DecodeAttributeData()}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax}
|
||||||
|
|
||||||
|
|
||||||
### DecodeHeader()
|
### DecodeHeader()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
DecodeHeader() { <b>Type</b>
|
DecodeHeader() {
|
||||||
<b>draco_string</b> UI8[5]
|
draco_string UI8[5]
|
||||||
<b>major_version</b> UI8
|
major_version UI8
|
||||||
<b>minor_version</b> UI8
|
minor_version UI8
|
||||||
<b>encoder_type</b> UI8
|
encoder_type UI8
|
||||||
<b>encoder_method</b> UI8
|
encoder_method UI8
|
||||||
flags
|
flags
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax}
|
||||||
|
|
||||||
|
|
||||||
### DecodeAttributeData()
|
### DecodeAttributeData()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
DecodeAttributeData() { <b>Type</b>
|
DecodeAttributeData() {
|
||||||
<b>num_attributes_decoders</b> UI8
|
num_attributes_decoders UI8
|
||||||
for (i = 0; i < num_attributes_decoders; ++i) {
|
for (i = 0; i < num_attributes_decoders; ++i) {
|
||||||
CreateAttributesDecoder(i);
|
CreateAttributesDecoder(i);
|
||||||
}
|
}
|
||||||
@ -42,4 +42,5 @@ DecodeAttributeData() { <b>Type</b
|
|||||||
}
|
}
|
||||||
DecodeAllAttributes()
|
DecodeAllAttributes()
|
||||||
OnAttributesDecoded()
|
OnAttributesDecoded()
|
||||||
</div>
|
~~~~~
|
||||||
|
{:.draco-syntax}
|
||||||
|
@ -2,26 +2,27 @@
|
|||||||
|
|
||||||
### InitializeDecoder()
|
### InitializeDecoder()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
InitializeDecoder() { <b>Type</b>
|
InitializeDecoder() {
|
||||||
<b>edgebreaker_decoder_type</b> UI8
|
edgebreaker_decoder_type UI8
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeConnectivity()
|
### DecodeConnectivity()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
DecodeConnectivity() { <b>Type</b>
|
DecodeConnectivity() {
|
||||||
<b>num_new_verts</b> UI32
|
num_new_verts UI32
|
||||||
<b>num_encoded_vertices</b> UI32
|
num_encoded_vertices UI32
|
||||||
<b>num_faces</b> UI32
|
num_faces UI32
|
||||||
<b>num_attribute_data</b> I8
|
num_attribute_data I8
|
||||||
<b>num_encoded_symbols</b> UI32
|
num_encoded_symbols UI32
|
||||||
<b>num_encoded_split_symbols</b> UI32
|
num_encoded_split_symbols UI32
|
||||||
<b>encoded_connectivity_size</b> UI32
|
encoded_connectivity_size UI32
|
||||||
// file pointer must be set to current position + encoded_connectivity_size
|
// file pointer must be set to current position
|
||||||
|
// + encoded_connectivity_size
|
||||||
hole_and_split_bytes = DecodeHoleAndTopologySplitEvents()
|
hole_and_split_bytes = DecodeHoleAndTopologySplitEvents()
|
||||||
// file pointer must be set to old current position
|
// file pointer must be set to old current position
|
||||||
EdgeBreakerTraversalValence_Start()
|
EdgeBreakerTraversalValence_Start()
|
||||||
@ -47,14 +48,14 @@ DecodeConnectivity() { <b>Type</b
|
|||||||
// Preallocate vertex to value mapping
|
// Preallocate vertex to value mapping
|
||||||
AssignPointsToCorners()
|
AssignPointsToCorners()
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### AssignPointsToCorners()
|
### AssignPointsToCorners()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
AssignPointsToCorners() { <b>Type</b>
|
AssignPointsToCorners() {
|
||||||
decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
|
decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
|
||||||
if (attribute_data_.size() == 0) {
|
if (attribute_data_.size() == 0) {
|
||||||
for (f = 0; f < decoder_->mesh()->num_faces(); ++f) {
|
for (f = 0; f < decoder_->mesh()->num_faces(); ++f) {
|
||||||
@ -125,14 +126,14 @@ AssignPointsToCorners() { <b>Type</b
|
|||||||
}
|
}
|
||||||
decoder_->point_cloud()->set_num_points(point_to_corner_map.size());
|
decoder_->point_cloud()->set_num_points(point_to_corner_map.size());
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeConnectivity()
|
### DecodeConnectivity()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
DecodeConnectivity(num_symbols) { <b>Type</b>
|
DecodeConnectivity(num_symbols) {
|
||||||
for (i = 0; i < num_symbols; ++i) {
|
for (i = 0; i < num_symbols; ++i) {
|
||||||
symbol = TraversalValence_DecodeSymbol()
|
symbol = TraversalValence_DecodeSymbol()
|
||||||
corner = 3 * num_faces++
|
corner = 3 * num_faces++
|
||||||
@ -187,14 +188,14 @@ DecodeConnectivity(num_symbols) { <b>Type</b
|
|||||||
}
|
}
|
||||||
Return num_vertices;
|
Return num_vertices;
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### UpdateCornerTableForSymbolC()
|
### UpdateCornerTableForSymbolC()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
UpdateCornerTableForSymbolC(corner) { <b>Type</b>
|
UpdateCornerTableForSymbolC(corner) {
|
||||||
corner_a = active_corner_stack.back();
|
corner_a = active_corner_stack.back();
|
||||||
corner_b = corner_table_->Previous(corner_a);
|
corner_b = corner_table_->Previous(corner_a);
|
||||||
while (corner_table_->Opposite(corner_b) >= 0) {
|
while (corner_table_->Opposite(corner_b) >= 0) {
|
||||||
@ -210,15 +211,15 @@ UpdateCornerTableForSymbolC(corner) { <b>Type</b
|
|||||||
corner + 2, corner_table_->Vertex(corner_table_->Previous(corner_a)));
|
corner + 2, corner_table_->Vertex(corner_table_->Previous(corner_a)));
|
||||||
return vertex_x;
|
return vertex_x;
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### UpdateCornerTableForSymbolLR()
|
### UpdateCornerTableForSymbolLR()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
UpdateCornerTableForSymbolLR(corner, symbol) { <b>Type</b>
|
UpdateCornerTableForSymbolLR(corner, symbol) {
|
||||||
if (symbol == TOPOLOGY_R) {
|
if (symbol == TOPOLOGY_R) {
|
||||||
opp_corner = corner + 2;
|
opp_corner = corner + 2;
|
||||||
} else {
|
} else {
|
||||||
@ -233,14 +234,14 @@ UpdateCornerTableForSymbolLR(corner, symbol) { <b>Type</b
|
|||||||
corner_table_->Previous(opp_corner),
|
corner_table_->Previous(opp_corner),
|
||||||
corner_table_->Vertex(corner_table_->Next(corner_a)));
|
corner_table_->Vertex(corner_table_->Next(corner_a)));
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### HandleSymbolS()
|
### HandleSymbolS()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
HandleSymbolS(corner) { <b>Type</b>
|
HandleSymbolS(corner) {
|
||||||
corner_b = active_corner_stack.pop_back();
|
corner_b = active_corner_stack.pop_back();
|
||||||
it = topology_split_active_corners.find(symbol_id);
|
it = topology_split_active_corners.find(symbol_id);
|
||||||
if (it != topology_split_active_corners.end()) {
|
if (it != topology_split_active_corners.end()) {
|
||||||
@ -265,26 +266,26 @@ HandleSymbolS(corner) { <b>Type</b
|
|||||||
}
|
}
|
||||||
corner_table_->MakeVertexIsolated(vertex_n);
|
corner_table_->MakeVertexIsolated(vertex_n);
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### UpdateCornerTableForSymbolE()
|
### UpdateCornerTableForSymbolE()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
UpdateCornerTableForSymbolE() { <b>Type</b>
|
UpdateCornerTableForSymbolE() {
|
||||||
corner_table_->MapCornerToVertex(corner, num_vertices++);
|
corner_table_->MapCornerToVertex(corner, num_vertices++);
|
||||||
corner_table_->MapCornerToVertex(corner + 1, num_vertices++);
|
corner_table_->MapCornerToVertex(corner + 1, num_vertices++);
|
||||||
corner_table_->MapCornerToVertex(corner + 2, num_vertices++);
|
corner_table_->MapCornerToVertex(corner + 2, num_vertices++);
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### UpdateCornerTableForInteriorFace()
|
### UpdateCornerTableForInteriorFace()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
UpdateCornerTableForInteriorFace() { <b>Type</b>
|
UpdateCornerTableForInteriorFace() {
|
||||||
corner_b = corner_table_->Previous(corner);
|
corner_b = corner_table_->Previous(corner);
|
||||||
while (corner_table_->Opposite(corner_b) >= 0) {
|
while (corner_table_->Opposite(corner_b) >= 0) {
|
||||||
corner_b = corner_table_->Previous(corner_table_->Opposite(corner_b));
|
corner_b = corner_table_->Previous(corner_table_->Opposite(corner_b));
|
||||||
@ -301,15 +302,14 @@ UpdateCornerTableForInteriorFace() { <b>Type</b
|
|||||||
corner_table_->MapCornerToVertex(
|
corner_table_->MapCornerToVertex(
|
||||||
new_corner + 2, corner_table_->Vertex(corner_table_->Next(corner)));
|
new_corner + 2, corner_table_->Vertex(corner_table_->Next(corner)));
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### IsTopologySplit()
|
### IsTopologySplit()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
IsTopologySplit(encoder_symbol_id, *out_face_edge, <b>Type</b>
|
IsTopologySplit(encoder_symbol_id, *out_face_edge,
|
||||||
|
|
||||||
*out_encoder_split_symbol_id) {
|
*out_encoder_split_symbol_id) {
|
||||||
if (topology_split_data_.size() == 0)
|
if (topology_split_data_.size() == 0)
|
||||||
return false;
|
return false;
|
||||||
@ -321,14 +321,14 @@ IsTopologySplit(encoder_symbol_id, *out_face_edge, <b>Type</b
|
|||||||
topology_split_data_.pop_back();
|
topology_split_data_.pop_back();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeAttributeConnectivitiesOnFace()
|
### DecodeAttributeConnectivitiesOnFace()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
DecodeAttributeConnectivitiesOnFace(corner) { <b>Type</b>
|
DecodeAttributeConnectivitiesOnFace(corner) {
|
||||||
corners[3] = {corner, corner_table_->Next(corner),
|
corners[3] = {corner, corner_table_->Next(corner),
|
||||||
corner_table_->Previous(corner)}
|
corner_table_->Previous(corner)}
|
||||||
for (c = 0; c < 3; ++c) {
|
for (c = 0; c < 3; ++c) {
|
||||||
@ -347,16 +347,16 @@ DecodeAttributeConnectivitiesOnFace(corner) { <b>Type</b
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### SetOppositeCorners()
|
### SetOppositeCorners()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
SetOppositeCorners(corner_0, corner_1) { <b>Type</b>
|
SetOppositeCorners(corner_0, corner_1) {
|
||||||
corner_table_->SetOppositeCorner(corner_0, corner_1);
|
corner_table_->SetOppositeCorner(corner_0, corner_1);
|
||||||
corner_table_->SetOppositeCorner(corner_1, corner_0);
|
corner_table_->SetOppositeCorner(corner_1, corner_0);
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
@ -1,47 +1,45 @@
|
|||||||
|
|
||||||
## EdgeBreaker Hole and Topology Split Events
|
## EdgeBreaker Hole and Topology Split Events
|
||||||
|
|
||||||
|
|
||||||
### DecodeHoleAndTopologySplitEvents()
|
### DecodeHoleAndTopologySplitEvents()
|
||||||
|
|
||||||
FIXME: Escaping angle brackets
|
~~~~~
|
||||||
|
DecodeHoleAndTopologySplitEvents() {
|
||||||
<div class="syntax">
|
num_topologoy_splits UI32
|
||||||
DecodeHoleAndTopologySplitEvents() { <b>Type</b>
|
|
||||||
<b>num_topologoy_splits</b> UI32
|
|
||||||
source_symbol_id = 0
|
source_symbol_id = 0
|
||||||
for (i = 0; i < num_topologoy_splits; ++i) {
|
for (i = 0; i < num_topologoy_splits; ++i) {
|
||||||
DecodeVarint\<UI32\>(&delta)
|
DecodeVarint<UI32>(&delta)
|
||||||
split_data[i].source_symbol_id = delta + source_symbol_id
|
split_data[i].source_symbol_id = delta + source_symbol_id
|
||||||
DecodeVarint\<UI32\>(&delta)
|
DecodeVarint<UI32>(&delta)
|
||||||
split_data[i].split_symbol_id = source_symbol_id - delta
|
split_data[i].split_symbol_id = source_symbol_id - delta
|
||||||
}
|
}
|
||||||
for (i = 0; i < num_topologoy_splits; ++i) {
|
for (i = 0; i < num_topologoy_splits; ++i) {
|
||||||
<b>split_data[i].split_edge</b> bits1
|
split_data[i].split_edge bits1
|
||||||
<b>split_data[i].source_edge</b> bits1
|
split_data[i].source_edge bits1
|
||||||
}
|
}
|
||||||
<b>num_hole_events</b> UI32
|
num_hole_events UI32
|
||||||
symbol_id = 0
|
symbol_id = 0
|
||||||
for (i = 0; i < num_hole_events; ++i) {
|
for (i = 0; i < num_hole_events; ++i) {
|
||||||
DecodeVarint\<UI32\>(&delta)
|
DecodeVarint<UI32>(&delta)
|
||||||
hole_data[i].symbol_id = delta + symbol_id
|
hole_data[i].symbol_id = delta + symbol_id
|
||||||
}
|
}
|
||||||
return bytes_decoded;
|
return bytes_decoded;
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
### CreateAttributesDecoder
|
### CreateAttributesDecoder
|
||||||
|
|
||||||
FIXME: Escaping angle brackets
|
~~~~~
|
||||||
|
CreateAttributesDecoder() {
|
||||||
<div class="syntax">
|
att_data_id I8
|
||||||
CreateAttributesDecoder() { <b>Type</b>
|
decoder_type UI8
|
||||||
<b>att_data_id</b> I8
|
|
||||||
<b>decoder_type</b> UI8
|
|
||||||
if (att_data_id >= 0) {
|
if (att_data_id >= 0) {
|
||||||
attribute_data_[att_data_id].decoder_id = att_decoder_id;
|
attribute_data_[att_data_id].decoder_id = att_decoder_id;
|
||||||
}
|
}
|
||||||
<b>traversal_method_encoded</b> UI8
|
traversal_method_encoded UI8
|
||||||
if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
|
if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
|
||||||
if (att_data_id < 0) {
|
if (att_data_id < 0) {
|
||||||
encoding_data = &pos_encoding_data_;
|
encoding_data = &pos_encoding_data_;
|
||||||
@ -50,11 +48,11 @@ CreateAttributesDecoder() { <b>Type</b
|
|||||||
attribute_data_[att_data_id].is_connectivity_used = false;
|
attribute_data_[att_data_id].is_connectivity_used = false;
|
||||||
}
|
}
|
||||||
if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
|
if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
|
||||||
typedef EdgeBreakerTraverser\<AttProcessor, AttObserver\> AttTraverser;
|
typedef EdgeBreakerTraverser<AttProcessor, AttObserver> AttTraverser;
|
||||||
sequencer = CreateVertexTraversalSequencer\<AttTraverser\>(encoding_data);
|
sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
|
||||||
} else if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
|
} else if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
|
||||||
typedef PredictionDegreeTraverser\<AttProcessor, AttObserver\> AttTraverser;
|
typedef PredictionDegreeTraverser<AttProcessor, AttObserver> AttTraverser;
|
||||||
sequencer = CreateVertexTraversalSequencer\<AttTraverser\>(encoding_data);
|
sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO
|
// TODO
|
||||||
@ -62,6 +60,6 @@ CreateAttributesDecoder() { <b>Type</b
|
|||||||
att_controller(new SequentialAttributeDecodersController(std::move(sequencer)))
|
att_controller(new SequentialAttributeDecodersController(std::move(sequencer)))
|
||||||
decoder_->SetAttributesDecoder(att_decoder_id, std::move(att_controller));
|
decoder_->SetAttributesDecoder(att_decoder_id, std::move(att_controller));
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
### EdgebreakerTraversal_Start()
|
### EdgebreakerTraversal_Start()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
EdgebreakerTraversal_Start() { <b>Type</b>
|
EdgebreakerTraversal_Start() {
|
||||||
<b>size</b> UI64
|
size UI64
|
||||||
<b>symbol_buffer_</b> size * UI8
|
symbol_buffer_ size * UI8
|
||||||
<b>size</b> UI64
|
size UI64
|
||||||
<b>start_face_buffer_</b> size * UI8
|
start_face_buffer_ size * UI8
|
||||||
if (num_attribute_data_ > 0) {
|
if (num_attribute_data_ > 0) {
|
||||||
attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
|
attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
|
||||||
new BinaryDecoder[num_attribute_data_]);
|
new BinaryDecoder[num_attribute_data_]);
|
||||||
@ -17,8 +17,8 @@ EdgebreakerTraversal_Start() { <b>Type</b
|
|||||||
// RansBitDecoder_StartDecoding
|
// RansBitDecoder_StartDecoding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### Traversal_DecodeSymbol()
|
### Traversal_DecodeSymbol()
|
||||||
@ -33,6 +33,7 @@ Traversal_DecodeSymbol() {
|
|||||||
return symbol
|
return symbol
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeAttributeSeam()
|
### DecodeAttributeSeam()
|
||||||
@ -42,3 +43,4 @@ DecodeAttributeSeam(int attribute) {
|
|||||||
return attribute_connectivity_decoders_[attribute].DecodeNextBit();
|
return attribute_connectivity_decoders_[attribute].DecodeNextBit();
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -24,6 +24,7 @@ EdgeBreakerTraversalValence_Start(num_vertices, num_attribute_data) {
|
|||||||
return out_buffer;
|
return out_buffer;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -41,6 +42,7 @@ TraversalValence_DecodeSymbol() {
|
|||||||
return last_symbol_
|
return last_symbol_
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -76,7 +78,7 @@ TraversalValence_NewActiveCornerReached(corner) {
|
|||||||
active_context_ = (valence - min_valence_);
|
active_context_ = (valence - min_valence_);
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### TraversalValence_MergeVertices()
|
### TraversalValence_MergeVertices()
|
||||||
@ -86,3 +88,4 @@ TraversalValence_MergeVertices(dest, source) {
|
|||||||
vertex_valences_[dest] += vertex_valences_[source];
|
vertex_valences_[dest] += vertex_valences_[source];
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -68,3 +68,4 @@ TraverseFromCorner(corner_id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -8,6 +8,7 @@ bool IsCornerOnSeam(corner) {
|
|||||||
return is_vertex_on_seam_[corner_table_->Vertex(corner)];
|
return is_vertex_on_seam_[corner_table_->Vertex(corner)];
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### AddSeamEdge()
|
### AddSeamEdge()
|
||||||
@ -22,6 +23,7 @@ AddSeamEdge(c) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### MarkSeam()
|
### MarkSeam()
|
||||||
@ -34,6 +36,7 @@ MarkSeam(c) {
|
|||||||
] = true;
|
] = true;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### RecomputeVertices()
|
### RecomputeVertices()
|
||||||
@ -72,3 +75,4 @@ RecomputeVertices() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -15,3 +15,4 @@ OnNewVertexVisited(vertex, corner) {
|
|||||||
encoding_data_->num_values++;
|
encoding_data_->num_values++;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
### DecodeConnectivityData()
|
### DecodeConnectivityData()
|
||||||
|
|
||||||
<div class="syntax">
|
~~~~~
|
||||||
DecodeConnectivityData() <b>Type</b>
|
DecodeConnectivityData()
|
||||||
InitializeDecoder()
|
InitializeDecoder()
|
||||||
DecodeConnectivity()
|
DecodeConnectivity()
|
||||||
}
|
}
|
||||||
|
~~~~~
|
||||||
</div>
|
{:.draco-syntax }
|
||||||
|
@ -30,10 +30,14 @@ Decode(...) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
MeshPredictionSchemeParallelogramShared
|
MeshPredictionSchemeParallelogramShared
|
||||||
|
|
||||||
|
FIXME: ^^^ Heading level?
|
||||||
|
|
||||||
|
|
||||||
### ComputeParallelogramPrediction()
|
### ComputeParallelogramPrediction()
|
||||||
|
|
||||||
~~~~~
|
~~~~~
|
||||||
@ -56,3 +60,4 @@ ComputeParallelogramPrediction(...) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -17,6 +17,7 @@ GenerateSequenceInternal() {
|
|||||||
traverser_.OnTraversalEnd();
|
traverser_.OnTraversalEnd();
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### ProcessCorner()
|
### ProcessCorner()
|
||||||
@ -26,6 +27,7 @@ ProcessCorner(corner_id) {
|
|||||||
traverser_.TraverseFromCorner(corner_id);
|
traverser_.TraverseFromCorner(corner_id);
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### UpdatePointToAttributeIndexMapping()
|
### UpdatePointToAttributeIndexMapping()
|
||||||
@ -49,10 +51,13 @@ UpdatePointToAttributeIndexMapping(PointAttribute *attribute) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
PointsSequencer
|
PointsSequencer
|
||||||
|
|
||||||
|
FIXME: ^^^ Heading level?
|
||||||
|
|
||||||
### AddPointId()
|
### AddPointId()
|
||||||
|
|
||||||
~~~~~
|
~~~~~
|
||||||
@ -60,3 +65,4 @@ AddPointId(point_id) {
|
|||||||
out_point_ids_->push_back(point_id);
|
out_point_ids_->push_back(point_id);
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -12,3 +12,4 @@ ComputeOriginalValue(const DataTypeT *predicted_vals,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -9,6 +9,7 @@ DecodeTransformData(buffer) {
|
|||||||
max_value_ DT
|
max_value_ DT
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### ComputeOriginalValue()
|
### ComputeOriginalValue()
|
||||||
@ -28,6 +29,7 @@ ComputeOriginalValue(const DataTypeT *predicted_vals,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### ClampPredictedValue()
|
### ClampPredictedValue()
|
||||||
@ -41,3 +43,4 @@ ClampPredictedValue(const DataTypeT *predicted_val) {
|
|||||||
return &clamped_value_[0];
|
return &clamped_value_[0];
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -11,6 +11,7 @@ RansBitDecoder_StartDecoding(DecoderBuffer *source_buffer) {
|
|||||||
ans_read_init(&ans_decoder_, buffer_, size)
|
ans_read_init(&ans_decoder_, buffer_, size)
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeNextBit()
|
### DecodeNextBit()
|
||||||
@ -21,3 +22,4 @@ DecodeNextBit() {
|
|||||||
return bit > 0;
|
return bit > 0;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -23,6 +23,7 @@ ans_read_init(struct AnsDecoder *const ans, const uint8_t *const buf,
|
|||||||
ans->state += l_base;
|
ans->state += l_base;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### int rabs_desc_read()
|
### int rabs_desc_read()
|
||||||
@ -46,7 +47,7 @@ int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### rans_read_init()
|
### rans_read_init()
|
||||||
@ -71,6 +72,7 @@ rans_read_init(UI8 *buf, int offset) {
|
|||||||
ans_.state += l_rans_base;
|
ans_.state += l_rans_base;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### rans_build_look_up_table()
|
### rans_build_look_up_table()
|
||||||
@ -89,7 +91,7 @@ rans_build_look_up_table() {
|
|||||||
act_prob = cum_prob
|
act_prob = cum_prob
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### rans_read()
|
### rans_read()
|
||||||
@ -106,6 +108,7 @@ rans_read() {
|
|||||||
return sym.val;
|
return sym.val;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### fetch_sym()
|
### fetch_sym()
|
||||||
@ -118,3 +121,4 @@ fetch_sym() {
|
|||||||
out->cum_prob = probability_table_[symbol].cum_prob;
|
out->cum_prob = probability_table_[symbol].cum_prob;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -6,6 +6,7 @@ Initialize(...) {
|
|||||||
// Init some members
|
// Init some members
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeValues()
|
### DecodeValues()
|
||||||
@ -23,4 +24,5 @@ DecodeValues(const std::vector<PointIndex> &point_ids) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ DecodeAttributesDecoderData(buffer) {
|
|||||||
sequential_decoders_[i]->Initialize(decoder(), GetAttributeId(i))
|
sequential_decoders_[i]->Initialize(decoder(), GetAttributeId(i))
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeAttributes()
|
### DecodeAttributes()
|
||||||
@ -30,7 +31,7 @@ DecodeAttributes(buffer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### CreateSequentialDecoder()
|
### CreateSequentialDecoder()
|
||||||
@ -49,4 +50,5 @@ CreateSequentialDecoder(type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ Initialize(...) {
|
|||||||
SequentialAttributeDecoder_Initialize()
|
SequentialAttributeDecoder_Initialize()
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeValues()
|
### DecodeValues()
|
||||||
@ -25,6 +26,7 @@ DecodeValues(point_ids) {
|
|||||||
DequantizeValues(num_values)
|
DequantizeValues(num_values)
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeIntegerValues()
|
### DecodeIntegerValues()
|
||||||
@ -49,4 +51,5 @@ DecodeIntegerValues(point_ids) {
|
|||||||
// MeshPredictionSchemeParallelogram_Decode()
|
// MeshPredictionSchemeParallelogram_Decode()
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ Initialize(...) {
|
|||||||
SequentialIntegerAttributeDecoder_Initialize()
|
SequentialIntegerAttributeDecoder_Initialize()
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeIntegerValues()
|
### DecodeIntegerValues()
|
||||||
@ -22,6 +23,7 @@ DecodeIntegerValues(point_ids) {
|
|||||||
SequentialIntegerAttributeDecoder::DecodeIntegerValues()
|
SequentialIntegerAttributeDecoder::DecodeIntegerValues()
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DequantizeValues()
|
### DequantizeValues()
|
||||||
@ -44,3 +46,4 @@ DequantizeValues(num_values) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
@ -13,6 +13,7 @@ DecodeSymbols(num_symbols, out_buffer, out_values) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeTaggedSymbols()
|
### DecodeTaggedSymbols()
|
||||||
@ -22,7 +23,7 @@ DecodeTaggedSymbols() {
|
|||||||
FIXME
|
FIXME
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeRawSymbols()
|
### DecodeRawSymbols()
|
||||||
@ -34,7 +35,7 @@ DecodeRawSymbols() {
|
|||||||
return symbols
|
return symbols
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeRawSymbolsInternal()
|
### DecodeRawSymbolsInternal()
|
||||||
@ -50,6 +51,7 @@ DecodeRawSymbolsInternal(max_bit_length, out_values) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### CreateRansSymbolDecoder()
|
### CreateRansSymbolDecoder()
|
||||||
@ -82,6 +84,7 @@ CreateRansSymbolDecoder(max_bit_length) {
|
|||||||
rans_build_look_up_table()
|
rans_build_look_up_table()
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### RansSymbolDecoder_StartDecoding()
|
### RansSymbolDecoder_StartDecoding()
|
||||||
@ -93,7 +96,7 @@ RansSymbolDecoder_StartDecoding() {
|
|||||||
rans_read_init(buffer, bytes_encoded)
|
rans_read_init(buffer, bytes_encoded)
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### RansSymbolDecoder_DecodeSymbol()
|
### RansSymbolDecoder_DecodeSymbol()
|
||||||
@ -103,3 +106,4 @@ RansSymbolDecoder_DecodeSymbol() {
|
|||||||
ans_.rans_read()
|
ans_.rans_read()
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
|
{:.draco-syntax }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user