diff --git a/docs/_site/assets/css/spec-style.css b/docs/_site/assets/css/spec-style.css index 513a264..16d916f 100644 --- a/docs/_site/assets/css/spec-style.css +++ b/docs/_site/assets/css/spec-style.css @@ -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} diff --git a/docs/_site/spec/00.00.03.last.modified.html b/docs/_site/spec/00.00.03.last.modified.html index c73c61d..e39e03d 100644 --- a/docs/_site/spec/00.00.03.last.modified.html +++ b/docs/_site/spec/00.00.03.last.modified.html @@ -1,2 +1,2 @@ -

Last modified: 2017-07-10 14:30:06 -0700

+

Last modified: 2017-07-12 15:15:50 -0700

diff --git a/docs/_site/spec/04.00.00.conventions.html b/docs/_site/spec/04.00.00.conventions.html index 80fc2b5..0248e19 100644 --- a/docs/_site/spec/04.00.00.conventions.html +++ b/docs/_site/spec/04.00.00.conventions.html @@ -1,5 +1,7 @@

Conventions

+

General Conventions

+ + +

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.

+ diff --git a/docs/_site/spec/04.00.00.conventions.md b/docs/_site/spec/04.00.00.conventions.md index 767de7c..762653f 100644 --- a/docs/_site/spec/04.00.00.conventions.md +++ b/docs/_site/spec/04.00.00.conventions.md @@ -1,5 +1,7 @@ ## Conventions +### General Conventions + * When bit reading is finished it will always pad the read to the current byte. @@ -24,3 +26,52 @@ * The hole and split data must be decoded before the EdgeBreaker symbols are 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. + diff --git a/docs/_site/spec/draco.decoder.html b/docs/_site/spec/draco.decoder.html index 114ff0c..d70d8b5 100644 --- a/docs/_site/spec/draco.decoder.html +++ b/docs/_site/spec/draco.decoder.html @@ -2,33 +2,30 @@

Decode()

-
-Decode() { Type +
Decode() {
   DecodeHeader()
   DecodeConnectivityData()
   DecodeAttributeData()}
-
+

DecodeHeader()

-
-DecodeHeader() { Type - draco_string UI8[5] - major_version UI8 - minor_version UI8 - encoder_type UI8 - encoder_method UI8 +
DecodeHeader() {
+  draco_string                                                          UI8[5]
+  major_version                                                         UI8
+  minor_version                                                         UI8
+  encoder_type                                                          UI8
+  encoder_method                                                        UI8
   flags
 }
-
+

DecodeAttributeData()

-
-DecodeAttributeData() { Type - num_attributes_decoders UI8 +
DecodeAttributeData() {
+  num_attributes_decoders                                               UI8
   for (i = 0; i < num_attributes_decoders; ++i) {
     CreateAttributesDecoder(i);
   }
@@ -40,4 +37,5 @@ DecodeAttributeData() {                                               Type
diff --git a/docs/_site/spec/draco.decoder.md b/docs/_site/spec/draco.decoder.md index 99c8096..7cb3cc5 100644 --- a/docs/_site/spec/draco.decoder.md +++ b/docs/_site/spec/draco.decoder.md @@ -2,35 +2,35 @@ ### Decode() -
-Decode() { Type +~~~~~ +Decode() { DecodeHeader() DecodeConnectivityData() DecodeAttributeData()} - -
+~~~~~ +{:.draco-syntax} ### DecodeHeader() -
-DecodeHeader() { Type - draco_string UI8[5] - major_version UI8 - minor_version UI8 - encoder_type UI8 - encoder_method UI8 +~~~~~ +DecodeHeader() { + draco_string UI8[5] + major_version UI8 + minor_version UI8 + encoder_type UI8 + encoder_method UI8 flags } - -
+~~~~~ +{:.draco-syntax} ### DecodeAttributeData() -
-DecodeAttributeData() { Type - num_attributes_decoders UI8 +~~~~~ +DecodeAttributeData() { + num_attributes_decoders UI8 for (i = 0; i < num_attributes_decoders; ++i) { CreateAttributesDecoder(i); } @@ -42,4 +42,5 @@ DecodeAttributeData() { Type +~~~~~ +{:.draco-syntax} diff --git a/docs/_site/spec/edgebreaker.decoder.html b/docs/_site/spec/edgebreaker.decoder.html index 6dd5e50..ec8e5ee 100644 --- a/docs/_site/spec/edgebreaker.decoder.html +++ b/docs/_site/spec/edgebreaker.decoder.html @@ -2,25 +2,24 @@

InitializeDecoder()

-
-InitializeDecoder() { Type - edgebreaker_decoder_type UI8 +
InitializeDecoder() {
+  edgebreaker_decoder_type                                              UI8
 }
-
+

DecodeConnectivity()

-
-DecodeConnectivity() { Type - num_new_verts UI32 - num_encoded_vertices UI32 - num_faces UI32 - num_attribute_data I8 - num_encoded_symbols UI32 - num_encoded_split_symbols UI32 - encoded_connectivity_size UI32 - // file pointer must be set to current position + encoded_connectivity_size +
DecodeConnectivity() {
+  num_new_verts                                                         UI32
+  num_encoded_vertices                                                  UI32
+  num_faces                                                             UI32
+  num_attribute_data                                                    I8
+  num_encoded_symbols                                                   UI32
+  num_encoded_split_symbols                                             UI32
+  encoded_connectivity_size                                             UI32
+  // file pointer must be set to current position
+  // + encoded_connectivity_size
   hole_and_split_bytes = DecodeHoleAndTopologySplitEvents()
   // file pointer must be set to old current position
   EdgeBreakerTraversalValence_Start()
@@ -46,13 +45,12 @@ DecodeConnectivity() {                                                Type

AssignPointsToCorners()

-
-AssignPointsToCorners() { Type +
AssignPointsToCorners() {
   decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
   if (attribute_data_.size() == 0) {
     for (f = 0; f < decoder_->mesh()->num_faces(); ++f) {
@@ -123,13 +121,12 @@ AssignPointsToCorners() {                                             Type

DecodeConnectivity()

-
-DecodeConnectivity(num_symbols) { Type +
DecodeConnectivity(num_symbols) {
   for (i = 0; i < num_symbols; ++i) {
     symbol = TraversalValence_DecodeSymbol()
     corner = 3 * num_faces++
@@ -184,13 +181,12 @@ DecodeConnectivity(num_symbols) {                                     Type

UpdateCornerTableForSymbolC()

-
-UpdateCornerTableForSymbolC(corner) { Type +
UpdateCornerTableForSymbolC(corner) {
   corner_a = active_corner_stack.back();
   corner_b = corner_table_->Previous(corner_a);
   while (corner_table_->Opposite(corner_b) >= 0) {
@@ -206,13 +202,12 @@ UpdateCornerTableForSymbolC(corner) {                                 Type

UpdateCornerTableForSymbolLR()

-
-UpdateCornerTableForSymbolLR(corner, symbol) { Type +
UpdateCornerTableForSymbolLR(corner, symbol) {
   if (symbol == TOPOLOGY_R) {
     opp_corner = corner + 2;
   } else {
@@ -227,13 +222,12 @@ UpdateCornerTableForSymbolLR(corner, symbol) {                        Type

HandleSymbolS()

-
-HandleSymbolS(corner) { Type +
HandleSymbolS(corner) {
   corner_b = active_corner_stack.pop_back();
   it = topology_split_active_corners.find(symbol_id);
   if (it != topology_split_active_corners.end()) {
@@ -258,24 +252,22 @@ HandleSymbolS(corner) {                                               Type

UpdateCornerTableForSymbolE()

-
-UpdateCornerTableForSymbolE() { Type +
UpdateCornerTableForSymbolE() {
   corner_table_->MapCornerToVertex(corner, num_vertices++);
   corner_table_->MapCornerToVertex(corner + 1, num_vertices++);
   corner_table_->MapCornerToVertex(corner + 2, num_vertices++);
 }
-
+

UpdateCornerTableForInteriorFace()

-
-UpdateCornerTableForInteriorFace() { Type +
UpdateCornerTableForInteriorFace() {
   corner_b = corner_table_->Previous(corner);
   while (corner_table_->Opposite(corner_b) >= 0) {
     corner_b = corner_table_->Previous(corner_table_->Opposite(corner_b));
@@ -292,14 +284,12 @@ UpdateCornerTableForInteriorFace() {                                  Type

IsTopologySplit()

-
-IsTopologySplit(encoder_symbol_id, *out_face_edge, Type - +
IsTopologySplit(encoder_symbol_id, *out_face_edge,
                          *out_encoder_split_symbol_id) {
   if (topology_split_data_.size() == 0)
     return false;
@@ -311,13 +301,12 @@ IsTopologySplit(encoder_symbol_id, *out_face_edge,                    Type

DecodeAttributeConnectivitiesOnFace()

-
-DecodeAttributeConnectivitiesOnFace(corner) { Type +
DecodeAttributeConnectivitiesOnFace(corner) {
   corners[3] = {corner, corner_table_->Next(corner),
                        corner_table_->Previous(corner)}
   for (c = 0; c < 3; ++c) {
@@ -336,15 +325,14 @@ DecodeAttributeConnectivitiesOnFace(corner) {                         Type

SetOppositeCorners()

-
-SetOppositeCorners(corner_0, corner_1) { Type +
SetOppositeCorners(corner_0, corner_1) {
   corner_table_->SetOppositeCorner(corner_0, corner_1);
   corner_table_->SetOppositeCorner(corner_1, corner_0);
 }
-
+
diff --git a/docs/_site/spec/edgebreaker.decoder.md b/docs/_site/spec/edgebreaker.decoder.md index 3536ec0..11baa85 100644 --- a/docs/_site/spec/edgebreaker.decoder.md +++ b/docs/_site/spec/edgebreaker.decoder.md @@ -2,26 +2,27 @@ ### InitializeDecoder() -
-InitializeDecoder() { Type - edgebreaker_decoder_type UI8 +~~~~~ +InitializeDecoder() { + edgebreaker_decoder_type UI8 } - -
+~~~~~ +{:.draco-syntax } ### DecodeConnectivity() -
-DecodeConnectivity() { Type - num_new_verts UI32 - num_encoded_vertices UI32 - num_faces UI32 - num_attribute_data I8 - num_encoded_symbols UI32 - num_encoded_split_symbols UI32 - encoded_connectivity_size UI32 - // file pointer must be set to current position + encoded_connectivity_size +~~~~~ +DecodeConnectivity() { + num_new_verts UI32 + num_encoded_vertices UI32 + num_faces UI32 + num_attribute_data I8 + num_encoded_symbols UI32 + num_encoded_split_symbols UI32 + encoded_connectivity_size UI32 + // file pointer must be set to current position + // + encoded_connectivity_size hole_and_split_bytes = DecodeHoleAndTopologySplitEvents() // file pointer must be set to old current position EdgeBreakerTraversalValence_Start() @@ -47,14 +48,14 @@ DecodeConnectivity() { Type +~~~~~ +{:.draco-syntax } ### AssignPointsToCorners() -
-AssignPointsToCorners() { Type +~~~~~ +AssignPointsToCorners() { decoder_->mesh()->SetNumFaces(corner_table_->num_faces()); if (attribute_data_.size() == 0) { for (f = 0; f < decoder_->mesh()->num_faces(); ++f) { @@ -125,14 +126,14 @@ AssignPointsToCorners() { Typepoint_cloud()->set_num_points(point_to_corner_map.size()); } - -
+~~~~~ +{:.draco-syntax } ### DecodeConnectivity() -
-DecodeConnectivity(num_symbols) { Type +~~~~~ +DecodeConnectivity(num_symbols) { for (i = 0; i < num_symbols; ++i) { symbol = TraversalValence_DecodeSymbol() corner = 3 * num_faces++ @@ -187,14 +188,14 @@ DecodeConnectivity(num_symbols) { Type +~~~~~ +{:.draco-syntax } ### UpdateCornerTableForSymbolC() -
-UpdateCornerTableForSymbolC(corner) { Type +~~~~~ +UpdateCornerTableForSymbolC(corner) { corner_a = active_corner_stack.back(); corner_b = corner_table_->Previous(corner_a); while (corner_table_->Opposite(corner_b) >= 0) { @@ -210,15 +211,15 @@ UpdateCornerTableForSymbolC(corner) { TypeVertex(corner_table_->Previous(corner_a))); return vertex_x; } - -
+~~~~~ +{:.draco-syntax } ### UpdateCornerTableForSymbolLR() -
-UpdateCornerTableForSymbolLR(corner, symbol) { Type +~~~~~ +UpdateCornerTableForSymbolLR(corner, symbol) { if (symbol == TOPOLOGY_R) { opp_corner = corner + 2; } else { @@ -233,14 +234,14 @@ UpdateCornerTableForSymbolLR(corner, symbol) { TypePrevious(opp_corner), corner_table_->Vertex(corner_table_->Next(corner_a))); } - -
+~~~~~ +{:.draco-syntax } ### HandleSymbolS() -
-HandleSymbolS(corner) { Type +~~~~~ +HandleSymbolS(corner) { corner_b = active_corner_stack.pop_back(); it = topology_split_active_corners.find(symbol_id); if (it != topology_split_active_corners.end()) { @@ -265,26 +266,26 @@ HandleSymbolS(corner) { TypeMakeVertexIsolated(vertex_n); } - -
+~~~~~ +{:.draco-syntax } ### UpdateCornerTableForSymbolE() -
-UpdateCornerTableForSymbolE() { Type +~~~~~ +UpdateCornerTableForSymbolE() { corner_table_->MapCornerToVertex(corner, num_vertices++); corner_table_->MapCornerToVertex(corner + 1, num_vertices++); corner_table_->MapCornerToVertex(corner + 2, num_vertices++); } - -
+~~~~~ +{:.draco-syntax } ### UpdateCornerTableForInteriorFace() -
-UpdateCornerTableForInteriorFace() { Type +~~~~~ +UpdateCornerTableForInteriorFace() { corner_b = corner_table_->Previous(corner); while (corner_table_->Opposite(corner_b) >= 0) { corner_b = corner_table_->Previous(corner_table_->Opposite(corner_b)); @@ -301,15 +302,14 @@ UpdateCornerTableForInteriorFace() { TypeMapCornerToVertex( new_corner + 2, corner_table_->Vertex(corner_table_->Next(corner))); } - -
+~~~~~ +{:.draco-syntax } ### IsTopologySplit() -
-IsTopologySplit(encoder_symbol_id, *out_face_edge, Type - +~~~~~ +IsTopologySplit(encoder_symbol_id, *out_face_edge, *out_encoder_split_symbol_id) { if (topology_split_data_.size() == 0) return false; @@ -321,14 +321,14 @@ IsTopologySplit(encoder_symbol_id, *out_face_edge, Type +~~~~~ +{:.draco-syntax } ### DecodeAttributeConnectivitiesOnFace() -
-DecodeAttributeConnectivitiesOnFace(corner) { Type +~~~~~ +DecodeAttributeConnectivitiesOnFace(corner) { corners[3] = {corner, corner_table_->Next(corner), corner_table_->Previous(corner)} for (c = 0; c < 3; ++c) { @@ -347,16 +347,16 @@ DecodeAttributeConnectivitiesOnFace(corner) { Type +~~~~~ +{:.draco-syntax } ### SetOppositeCorners() -
-SetOppositeCorners(corner_0, corner_1) { Type +~~~~~ +SetOppositeCorners(corner_0, corner_1) { corner_table_->SetOppositeCorner(corner_0, corner_1); corner_table_->SetOppositeCorner(corner_1, corner_0); } - -
+~~~~~ +{:.draco-syntax } diff --git a/docs/_site/spec/index.html b/docs/_site/spec/index.html index 7013943..76b6bd1 100644 --- a/docs/_site/spec/index.html +++ b/docs/_site/spec/index.html @@ -32,7 +32,7 @@ [author]
[author]

-

Last modified: 2017-07-10 14:30:06 -0700

+

Last modified: 2017-07-12 15:15:50 -0700

Abstract

@@ -45,7 +45,11 @@ Draco 3D Data Compression scheme.

  • Scope
  • Terms and Definitions
  • Symbols (and abbreviated terms)
  • -
  • Conventions
  • +
  • Conventions +
  • Draco Decoder
    • Decode()
    • DecodeHeader()
    • @@ -266,6 +270,8 @@ relate to the semantics of a particular syntax element are defined in section

      Conventions

      +

      General Conventions

      +
      • When bit reading is finished it will always pad the read to the current @@ -307,37 +313,81 @@ 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.

      +

      Draco Decoder

      Decode()

      -
      -Decode() { Type +
      Decode() {
         DecodeHeader()
         DecodeConnectivityData()
         DecodeAttributeData()}
      -
      +

      DecodeHeader()

      -
      -DecodeHeader() { Type - draco_string UI8[5] - major_version UI8 - minor_version UI8 - encoder_type UI8 - encoder_method UI8 +
      DecodeHeader() {
      +  draco_string                                                          UI8[5]
      +  major_version                                                         UI8
      +  minor_version                                                         UI8
      +  encoder_type                                                          UI8
      +  encoder_method                                                        UI8
         flags
       }
      -
      +

      DecodeAttributeData()

      -
      -DecodeAttributeData() { Type - num_attributes_decoders UI8 +
      DecodeAttributeData() {
      +  num_attributes_decoders                                               UI8
         for (i = 0; i < num_attributes_decoders; ++i) {
           CreateAttributesDecoder(i);
         }
      @@ -349,43 +399,42 @@ DecodeAttributeData() {                                               Type

      Mesh Decoder

      DecodeConnectivityData()

      -
      -DecodeConnectivityData() Type +
      DecodeConnectivityData()
         InitializeDecoder()
         DecodeConnectivity()
       }
      -
      +

      EdgeBreaker Decoder

      InitializeDecoder()

      -
      -InitializeDecoder() { Type - edgebreaker_decoder_type UI8 +
      InitializeDecoder() {
      +  edgebreaker_decoder_type                                              UI8
       }
      -
      +

      DecodeConnectivity()

      -
      -DecodeConnectivity() { Type - num_new_verts UI32 - num_encoded_vertices UI32 - num_faces UI32 - num_attribute_data I8 - num_encoded_symbols UI32 - num_encoded_split_symbols UI32 - encoded_connectivity_size UI32 - // file pointer must be set to current position + encoded_connectivity_size +
      DecodeConnectivity() {
      +  num_new_verts                                                         UI32
      +  num_encoded_vertices                                                  UI32
      +  num_faces                                                             UI32
      +  num_attribute_data                                                    I8
      +  num_encoded_symbols                                                   UI32
      +  num_encoded_split_symbols                                             UI32
      +  encoded_connectivity_size                                             UI32
      +  // file pointer must be set to current position
      +  // + encoded_connectivity_size
         hole_and_split_bytes = DecodeHoleAndTopologySplitEvents()
         // file pointer must be set to old current position
         EdgeBreakerTraversalValence_Start()
      @@ -411,13 +460,12 @@ DecodeConnectivity() {                                                Type

      AssignPointsToCorners()

      -
      -AssignPointsToCorners() { Type +
      AssignPointsToCorners() {
         decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
         if (attribute_data_.size() == 0) {
           for (f = 0; f < decoder_->mesh()->num_faces(); ++f) {
      @@ -488,13 +536,12 @@ AssignPointsToCorners() {                                             Type

      DecodeConnectivity()

      -
      -DecodeConnectivity(num_symbols) { Type +
      DecodeConnectivity(num_symbols) {
         for (i = 0; i < num_symbols; ++i) {
           symbol = TraversalValence_DecodeSymbol()
           corner = 3 * num_faces++
      @@ -549,13 +596,12 @@ DecodeConnectivity(num_symbols) {                                     Type

      UpdateCornerTableForSymbolC()

      -
      -UpdateCornerTableForSymbolC(corner) { Type +
      UpdateCornerTableForSymbolC(corner) {
         corner_a = active_corner_stack.back();
         corner_b = corner_table_->Previous(corner_a);
         while (corner_table_->Opposite(corner_b) >= 0) {
      @@ -571,13 +617,12 @@ UpdateCornerTableForSymbolC(corner) {                                 Type

      UpdateCornerTableForSymbolLR()

      -
      -UpdateCornerTableForSymbolLR(corner, symbol) { Type +
      UpdateCornerTableForSymbolLR(corner, symbol) {
         if (symbol == TOPOLOGY_R) {
           opp_corner = corner + 2;
         } else {
      @@ -592,13 +637,12 @@ UpdateCornerTableForSymbolLR(corner, symbol) {                        Type

      HandleSymbolS()

      -
      -HandleSymbolS(corner) { Type +
      HandleSymbolS(corner) {
         corner_b = active_corner_stack.pop_back();
         it = topology_split_active_corners.find(symbol_id);
         if (it != topology_split_active_corners.end()) {
      @@ -623,24 +667,22 @@ HandleSymbolS(corner) {                                               Type

      UpdateCornerTableForSymbolE()

      -
      -UpdateCornerTableForSymbolE() { Type +
      UpdateCornerTableForSymbolE() {
         corner_table_->MapCornerToVertex(corner, num_vertices++);
         corner_table_->MapCornerToVertex(corner + 1, num_vertices++);
         corner_table_->MapCornerToVertex(corner + 2, num_vertices++);
       }
      -
      +

      UpdateCornerTableForInteriorFace()

      -
      -UpdateCornerTableForInteriorFace() { Type +
      UpdateCornerTableForInteriorFace() {
         corner_b = corner_table_->Previous(corner);
         while (corner_table_->Opposite(corner_b) >= 0) {
           corner_b = corner_table_->Previous(corner_table_->Opposite(corner_b));
      @@ -657,14 +699,12 @@ UpdateCornerTableForInteriorFace() {                                  Type

      IsTopologySplit()

      -
      -IsTopologySplit(encoder_symbol_id, *out_face_edge, Type - +
      IsTopologySplit(encoder_symbol_id, *out_face_edge,
                                *out_encoder_split_symbol_id) {
         if (topology_split_data_.size() == 0)
           return false;
      @@ -676,13 +716,12 @@ IsTopologySplit(encoder_symbol_id, *out_face_edge,                    Type

      DecodeAttributeConnectivitiesOnFace()

      -
      -DecodeAttributeConnectivitiesOnFace(corner) { Type +
      DecodeAttributeConnectivitiesOnFace(corner) {
         corners[3] = {corner, corner_table_->Next(corner),
                              corner_table_->Previous(corner)}
         for (c = 0; c < 3; ++c) {
      @@ -701,75 +740,68 @@ DecodeAttributeConnectivitiesOnFace(corner) {                         Type

      SetOppositeCorners()

      -
      -SetOppositeCorners(corner_0, corner_1) { Type +
      SetOppositeCorners(corner_0, corner_1) {
         corner_table_->SetOppositeCorner(corner_0, corner_1);
         corner_table_->SetOppositeCorner(corner_1, corner_0);
       }
      -
      +

      EdgeBreaker Hole and Topology Split Events

      DecodeHoleAndTopologySplitEvents()

      -

      FIXME: Escaping angle brackets

      - -
      -DecodeHoleAndTopologySplitEvents() { Type - num_topologoy_splits UI32 +
      DecodeHoleAndTopologySplitEvents() {
      +  num_topologoy_splits                                                  UI32
         source_symbol_id = 0
         for (i = 0; i < num_topologoy_splits; ++i) {
      -    DecodeVarint\<UI32\>(&delta)
      +    DecodeVarint<UI32>(&delta)
           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
         }
         for (i = 0; i < num_topologoy_splits; ++i) {
      -    split_data[i].split_edge                                          bits1
      -    split_data[i].source_edge                                         bits1
      +    split_data[i].split_edge                                            bits1
      +    split_data[i].source_edge                                           bits1
         }
      -  num_hole_events                                                     UI32
      +  num_hole_events                                                       UI32
         symbol_id = 0
         for (i = 0; i < num_hole_events; ++i) {
      -    DecodeVarint\<UI32\>(&delta)
      +    DecodeVarint<UI32>(&delta)
           hole_data[i].symbol_id = delta + symbol_id
         }
           return bytes_decoded;
       }
      -
      +

      CreateAttributesDecoder

      -

      FIXME: Escaping angle brackets

      - -
      -CreateAttributesDecoder() { Type - att_data_id I8 - decoder_type UI8 +
      CreateAttributesDecoder() {
      +  att_data_id                                                           I8
      +  decoder_type                                                          UI8
         if (att_data_id >= 0) {
           attribute_data_[att_data_id].decoder_id = att_decoder_id;
         }
      -  traversal_method_encoded                                            UI8
      +  traversal_method_encoded                                              UI8
         if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
           if (att_data_id < 0) {
      -      encoding_data = &pos_encoding_data_;
      +      encoding_data = &pos_encoding_data_;
           } else {
             encoding_data = &attribute_data_[att_data_id].encoding_data;
             attribute_data_[att_data_id].is_connectivity_used = false;
           }
           if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
      -      typedef EdgeBreakerTraverser\<AttProcessor, AttObserver\> AttTraverser;
      -      sequencer = CreateVertexTraversalSequencer\<AttTraverser\>(encoding_data);
      +      typedef EdgeBreakerTraverser<AttProcessor, AttObserver> AttTraverser;
      +      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
           } else if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
      -      typedef PredictionDegreeTraverser\<AttProcessor, AttObserver\> AttTraverser;
      -      sequencer = CreateVertexTraversalSequencer\<AttTraverser\>(encoding_data);
      +      typedef PredictionDegreeTraverser<AttProcessor, AttObserver> AttTraverser;
      +      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
           }
         } else {
           // TODO
      @@ -777,19 +809,18 @@ CreateAttributesDecoder() {                                           Type

      Edgebreaker Traversal Decoder

      EdgebreakerTraversal_Start()

      -
      -EdgebreakerTraversal_Start() { Type - size UI64 - symbol_buffer_ size * UI8 - size UI64 - start_face_buffer_ size * UI8 +
      EdgebreakerTraversal_Start() {
      +  size                                                                  UI64
      +  symbol_buffer_                                                        size * UI8
      +  size                                                                  UI64
      +  start_face_buffer_                                                    size * UI8
         if (num_attribute_data_ > 0) {
           attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
                 new BinaryDecoder[num_attribute_data_]);
      @@ -798,15 +829,15 @@ EdgebreakerTraversal_Start() {                                        Type

      Traversal_DecodeSymbol()

      -
      Traversal_DecodeSymbol() {
      -  symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);                   bits1
      +
      Traversal_DecodeSymbol() {
      +  symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);              bits1
         if (symbol != TOPOLOGY_C) {
      -    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);          bits2
      +    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);     bits2
           symbol |= (symbol_suffix << 1);
         }
         return symbol
      @@ -816,7 +847,7 @@ EdgebreakerTraversal_Start() {                                        TypeDecodeAttributeSeam()
       
      -
      DecodeAttributeSeam(int attribute) {
      +
      DecodeAttributeSeam(int attribute) {
         return attribute_connectivity_decoders_[attribute].DecodeNextBit();
       }
       
      @@ -826,10 +857,10 @@ EdgebreakerTraversal_Start() { TypeEdgeBreakerTraversalValence_Start() -
      EdgeBreakerTraversalValence_Start(num_vertices, num_attribute_data) {
      +
      EdgeBreakerTraversalValence_Start(num_vertices, num_attribute_data) {
         out_buffer = EdgebreakerTraversal_Start()
      -  num_split_symbols                                                          I32
      -  mode == 0                                                                  I8
      +  num_split_symbols                                                     I32
      +  mode == 0                                                             I8
         num_vertices_ += num_split_symbols
         vertex_valences_ init to 0
         vertex_valences_.resize(num_vertices_, 0);
      @@ -850,10 +881,10 @@ EdgebreakerTraversal_Start() {                                        TypeTraversalValence_DecodeSymbol()
       
      -
      TraversalValence_DecodeSymbol() {
      +
      TraversalValence_DecodeSymbol() {
         if (active_context_ != -1) {
           symbol_id  = context_symbols_[active_context_]
      -                                                      [--context_counters_[active_context_]]
      +                                 [--context_counters_[active_context_]]
           last_symbol_ = edge_breaker_symbol_to_topology_id[symbol_id]
         } else {
           last_symbol_ = Traversal_DecodeSymbol()
      @@ -865,7 +896,7 @@ EdgebreakerTraversal_Start() {                                        TypeTraversalValence_NewActiveCornerReached()
       
      -
      TraversalValence_NewActiveCornerReached(corner) {
      +
      TraversalValence_NewActiveCornerReached(corner) {
         switch (last_symbol_) {
           case TOPOLOGY_C:
           case TOPOLOGY_S:
      @@ -898,7 +929,7 @@ EdgebreakerTraversal_Start() {                                        TypeTraversalValence_MergeVertices()
       
      -
      TraversalValence_MergeVertices(dest, source) {
      +
      TraversalValence_MergeVertices(dest, source) {
         vertex_valences_[dest] += vertex_valences_[source];
       }
       
      @@ -908,15 +939,15 @@ EdgebreakerTraversal_Start() { TypeDecodeAttributesDecoderData() -
      DecodeAttributesDecoderData(buffer) {
      -  num_attributes                                                             I32
      +
      DecodeAttributesDecoderData(buffer) {
      +  num_attributes                                                        I32
         point_attribute_ids_.resize(num_attributes);
         for (i = 0; i < num_attributes; ++i) {
      -    att_type                                                                 UI8
      -    data_type                                                                UI8
      -    components_count                                                         UI8
      -    normalized                                                               UI8
      -    custom_id                                                                UI16
      +    att_type                                                            UI8
      +    data_type                                                           UI8
      +    components_count                                                    UI8
      +    normalized                                                          UI8
      +    custom_id                                                           UI16
           Initialize GeometryAttribute ga
           att_id = pc->AddAttribute(new PointAttribute(ga));
           point_attribute_ids_[i] = att_id;
      @@ -928,11 +959,11 @@ EdgebreakerTraversal_Start() {                                        TypeDecodeAttributesDecoderData()
       
      -
      DecodeAttributesDecoderData(buffer) {
      +
      DecodeAttributesDecoderData(buffer) {
         AttributesDecoder_DecodeAttributesDecoderData(buffer)
         sequential_decoders_.resize(num_attributes());
         for (i = 0; i < num_attributes(); ++i) {
      -    decoder_type                                                             UI8
      +    decoder_type                                                        UI8
           sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
           sequential_decoders_[i]->Initialize(decoder(), GetAttributeId(i))
       }
      @@ -941,7 +972,7 @@ EdgebreakerTraversal_Start() {                                        TypeDecodeAttributes()
       
      -
      DecodeAttributes(buffer) {
      +
      DecodeAttributes(buffer) {
         sequencer_->GenerateSequence(&point_ids_)
         for (i = 0; i < num_attributes(); ++i) {
           pa = decoder()->point_cloud()->attribute(GetAttributeId(i));
      @@ -957,7 +988,7 @@ EdgebreakerTraversal_Start() {                                        TypeCreateSequentialDecoder()
       
      -
      CreateSequentialDecoder(type) {
      +
      CreateSequentialDecoder(type) {
         switch (type) {
           case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
             return new SequentialAttributeDecoder()
      @@ -974,7 +1005,7 @@ EdgebreakerTraversal_Start() {                                        TypeSequential Attribute Decoder
       
      -
      Initialize(...) {
      +
      Initialize(...) {
         // Init some members
       }
       
      @@ -982,13 +1013,13 @@ EdgebreakerTraversal_Start() { TypeDecodeValues() -
      DecodeValues(const std::vector<PointIndex> &point_ids) {
      +
      DecodeValues(const std::vector<PointIndex> &point_ids) {
         num_values = point_ids.size();
         entry_size = attribute_->byte_stride();
         std::unique_ptr<uint8_t[]> value_data_ptr(new uint8_t[entry_size]);
         out_byte_pos = 0;
         for (i = 0; i < num_values; ++i) {
      -   value_data                                                         UI8 * entry_size
      +   value_data                                                           UI8 * entry_size
           attribute_->buffer()->Write(out_byte_pos, value_data, entry_size);
           out_byte_pos += entry_size;
         }
      @@ -998,7 +1029,7 @@ EdgebreakerTraversal_Start() {                                        TypeSequential Integer Attribute Decoder
       
      -
      Initialize(...) {
      +
      Initialize(...) {
         SequentialAttributeDecoder_Initialize()
       }
       
      @@ -1006,10 +1037,10 @@ EdgebreakerTraversal_Start() { TypeDecodeValues() -
      DecodeValues(point_ids) {
      -  prediction_scheme_method                                                   I8
      +
      DecodeValues(point_ids) {
      +  prediction_scheme_method                                              I8
         if (prediction_scheme_method != PREDICTION_NONE) {
      -    prediction_transform_type                                                I8
      +    prediction_transform_type                                           I8
           prediction_scheme_ = CreateIntPredictionScheme(...)
         }
         if (prediction_scheme_) {
      @@ -1024,8 +1055,8 @@ EdgebreakerTraversal_Start() {                                        TypeDecodeIntegerValues()
       
      -
      DecodeIntegerValues(point_ids) {
      -  compressed                                                                 UI8
      +
      DecodeIntegerValues(point_ids) {
      +  compressed                                                            UI8
         if (compressed) {
           DecodeSymbols(..., values_.data())
         } else {
      @@ -1039,7 +1070,7 @@ EdgebreakerTraversal_Start() {                                        Type
      @@ -1047,7 +1078,7 @@ EdgebreakerTraversal_Start() { TypeSequential Quantization Attribute Decoder -
      Initialize(...) {
      +
      Initialize(...) {
         SequentialIntegerAttributeDecoder_Initialize()
       }
       
      @@ -1055,14 +1086,14 @@ EdgebreakerTraversal_Start() { TypeDecodeIntegerValues() -
      DecodeIntegerValues(point_ids) {
      +
      DecodeIntegerValues(point_ids) {
         // DecodeQuantizedDataInfo()
         num_components = attribute()->components_count();
         for (i = 0; i < num_components; ++i) {
      -    min_value_[i]                                                            F32
      +    min_value_[i]                                                       F32
         }
      -  max_value_dif_                                                             F32
      -  quantization_bits_                                                         UI8
      +  max_value_dif_                                                        F32
      +  quantization_bits_                                                    UI8
         SequentialIntegerAttributeDecoder::DecodeIntegerValues()
       }
       
      @@ -1070,7 +1101,7 @@ EdgebreakerTraversal_Start() { TypeDequantizeValues() -
      DequantizeValues(num_values) {
      +
      DequantizeValues(num_values) {
         max_quantized_value = (1 << (quantization_bits_)) - 1;
         num_components = attribute()->components_count();
         entry_size = sizeof(float) * num_components;
      @@ -1093,9 +1124,9 @@ EdgebreakerTraversal_Start() {                                        TypeComputeOriginalValue()
       
      -
      ComputeOriginalValue(const DataTypeT *predicted_vals,
      -                                   const CorrTypeT *corr_vals,
      -                                   DataTypeT *out_original_vals, int val_id) {
      +
      ComputeOriginalValue(const DataTypeT *predicted_vals,
      +                     const CorrTypeT *corr_vals,
      +                     DataTypeT *out_original_vals, int val_id) {
         for (i = 0; i < num_components_; ++i) {
           out_original_vals[i] = predicted_vals[i] + corr_vals[val_id + i];
         }
      @@ -1107,18 +1138,18 @@ EdgebreakerTraversal_Start() {                                        TypeDecodeTransformData()
       
      -
      DecodeTransformData(buffer) {
      -  min_value_                                                                 DT
      -  max_value_                                                                 DT
      +
      DecodeTransformData(buffer) {
      +  min_value_                                                            DT
      +  max_value_                                                            DT
       }
       

      ComputeOriginalValue()

      -
      ComputeOriginalValue(const DataTypeT *predicted_vals,
      -                                   const CorrTypeT *corr_vals,
      -                                   DataTypeT *out_original_vals, int val_id) {
      +
      ComputeOriginalValue(const DataTypeT *predicted_vals,
      +                     const CorrTypeT *corr_vals,
      +                     DataTypeT *out_original_vals, int val_id) {
         clamped_vals = ClampPredictedValue(predicted_vals);
         ComputeOriginalValue(clamped_vals, corr_vals, out_original_vals, val_id)
         // PredictionSchemeTransform_ComputeOriginalValue()
      @@ -1134,7 +1165,7 @@ EdgebreakerTraversal_Start() {                                        TypeClampPredictedValue()
       
      -
      ClampPredictedValue(const DataTypeT *predicted_val) {
      +
      ClampPredictedValue(const DataTypeT *predicted_val) {
         for (i = 0; i < this->num_components(); ++i) {
           clamped_value_[i] = min(predicted_val[i], max_value_)
           clamped_value_[i] = max(predicted_val[i], min_value_)
      @@ -1148,11 +1179,11 @@ EdgebreakerTraversal_Start() {                                        TypeDecode()
       
      -
      Decode(...) {
      +
      Decode(...) {
         this->transform().InitializeDecoding(num_components);
         // restore the first value
         this->transform().ComputeOriginalValue(pred_vals.get(),
      -                                       in_corr, out_data, 0);
      +                                         in_corr, out_data, 0);
         // PredictionSchemeWrapTransform_ComputeOriginalValue()
         corner_map_size = this->mesh_data().data_to_corner_map()->size();
         for (p = 1; p < corner_map_size; ++p) {
      @@ -1178,9 +1209,11 @@ EdgebreakerTraversal_Start() {                                        TypeMeshPredictionSchemeParallelogramShared

      +

      FIXME: ^^^ Heading level?

      +

      ComputeParallelogramPrediction()

      -
      ComputeParallelogramPrediction(...) {
      +
      ComputeParallelogramPrediction(...) {
         oci = table->Opposite(ci);
         vert_opp = vertex_to_data_map[table->Vertex(ci)];
         vert_next = vertex_to_data_map[table->Vertex(table->Next(ci))];
      @@ -1205,7 +1238,7 @@ EdgebreakerTraversal_Start() {                                        TypeIsFaceVisited()
       
      -
      IsFaceVisited(corner_id) {
      +
      IsFaceVisited(corner_id) {
         if (corner_id < 0)
           return true
         return is_face_visited_[corner_id / 3];
      @@ -1215,7 +1248,7 @@ EdgebreakerTraversal_Start() {                                        TypeMarkFaceVisited()
       
      -
      MarkFaceVisited(face_id) {
      +
      MarkFaceVisited(face_id) {
         is_face_visited_[face_id] = true;
       }
       
      @@ -1223,7 +1256,7 @@ EdgebreakerTraversal_Start() { TypeIsVertexVisited() -
      IsVertexVisited(vert_id) {
      +
      IsVertexVisited(vert_id) {
         return is_vertex_visited_[vert_id];
       }
       
      @@ -1231,7 +1264,7 @@ EdgebreakerTraversal_Start() { TypeMarkVertexVisited() -
      MarkVertexVisited(vert_id) {
      +
      MarkVertexVisited(vert_id) {
         is_vertex_visited_[vert_id] = true;
       }
       
      @@ -1241,7 +1274,7 @@ EdgebreakerTraversal_Start() { TypeOnNewVertexVisited() -
      OnNewVertexVisited(vertex, corner) {
      +
      OnNewVertexVisited(vertex, corner) {
         point_id = mesh_->face(corner / 3)[corner % 3];
         sequencer_->AddPointId(point_id);
         // Keep track of visited corners.
      @@ -1258,7 +1291,7 @@ EdgebreakerTraversal_Start() {                                        TypeTraverseFromCorner()
       
      -
      TraverseFromCorner(corner_id) {
      +
      TraverseFromCorner(corner_id) {
         if (processor_.IsFaceVisited(corner_id))
           return
         corner_traversal_stack_.clear();
      @@ -1328,7 +1361,7 @@ EdgebreakerTraversal_Start() {                                        TypeGenerateSequenceInternal()
       
      -
      GenerateSequenceInternal() {
      +
      GenerateSequenceInternal() {
         traverser_.OnTraversalStart();
          If (corner_order_) {
           // TODO
      @@ -1345,7 +1378,7 @@ EdgebreakerTraversal_Start() {                                        TypeProcessCorner()
       
      -
      ProcessCorner(corner_id) {
      +
      ProcessCorner(corner_id) {
         traverser_.TraverseFromCorner(corner_id);
       }
       
      @@ -1353,7 +1386,7 @@ EdgebreakerTraversal_Start() { TypeUpdatePointToAttributeIndexMapping() -
      UpdatePointToAttributeIndexMapping(PointAttribute *attribute) {
      +
      UpdatePointToAttributeIndexMapping(PointAttribute *attribute) {
         corner_table = traverser_.corner_table();
         attribute->SetExplicitMapping(mesh_->num_points());
         num_faces = mesh_->num_faces();
      @@ -1375,9 +1408,11 @@ EdgebreakerTraversal_Start() {                                        TypePointsSequencer

      +

      FIXME: ^^^ Heading level?

      +

      AddPointId()

      -
      AddPointId(point_id) {
      +
      AddPointId(point_id) {
         out_point_ids_->push_back(point_id);
       }
       
      @@ -1387,7 +1422,7 @@ EdgebreakerTraversal_Start() { TypeOpposite() -
      Opposite(corner) {
      +
      Opposite(corner) {
         return opposite_corners_[corner];
       }
       
      @@ -1395,7 +1430,7 @@ EdgebreakerTraversal_Start() { TypeNext() -
      Next(corner) {
      +
      Next(corner) {
         return LocalIndex(++corner) ? corner : corner - 3;
       }
       
      @@ -1403,7 +1438,7 @@ EdgebreakerTraversal_Start() { TypePrevious() -
      Previous(corner) {
      +
      Previous(corner) {
         return LocalIndex(corner) ? corner - 1 : corner + 2;
       }
       
      @@ -1411,7 +1446,7 @@ EdgebreakerTraversal_Start() { TypeVertex() -
      Vertex(corner) {
      +
      Vertex(corner) {
         faces_[Face(corner)][LocalIndex(corner)];
       }
       
      @@ -1419,7 +1454,7 @@ EdgebreakerTraversal_Start() { TypeFace() -
      Face(corner) {
      +
      Face(corner) {
         return corner / 3;
       }
       
      @@ -1427,7 +1462,7 @@ EdgebreakerTraversal_Start() { TypeLocalIndex() -
      LocalIndex(corner) {
      +
      LocalIndex(corner) {
         return corner % 3;
       }
       
      @@ -1435,7 +1470,7 @@ EdgebreakerTraversal_Start() { Typenum_vertices() -
      num_vertices() {
      +
      num_vertices() {
         return vertex_corners_.size();
       }
       
      @@ -1443,7 +1478,7 @@ EdgebreakerTraversal_Start() { Typenum_corners() -
      num_corners() {
      +
      num_corners() {
         return faces_.size() * 3;
       }
       
      @@ -1451,7 +1486,7 @@ EdgebreakerTraversal_Start() { Typenum_faces() -
      num_faces() {
      +
      num_faces() {
         return faces_.size();
       }
       
      @@ -1459,7 +1494,7 @@ EdgebreakerTraversal_Start() { Typebool IsOnBoundary() -
      bool IsOnBoundary(vert) {
      +
      bool IsOnBoundary(vert) {
         corner = LeftMostCorner(vert);
         if (SwingLeft(corner) < 0)
           return true;
      @@ -1470,7 +1505,7 @@ EdgebreakerTraversal_Start() {                                        TypeSwingRight()
       
      -
      SwingRight(corner) {
      +
      SwingRight(corner) {
         return Previous(Opposite(Previous(corner)));
       }
       
      @@ -1478,7 +1513,7 @@ EdgebreakerTraversal_Start() { TypeSwingLeft() -
      SwingLeft(corner) {
      +
      SwingLeft(corner) {
         return Next(Opposite(Next(corner)));
       }
       
      @@ -1486,7 +1521,7 @@ EdgebreakerTraversal_Start() { TypeGetLeftCorner() -
      GetLeftCorner(corner_id) {
      +
      GetLeftCorner(corner_id) {
         if (corner_id < 0)
            return kInvalidCornerIndex;
         return Opposite(Previous(corner_id));
      @@ -1496,7 +1531,7 @@ EdgebreakerTraversal_Start() {                                        TypeGetRightCorner()
       
      -
      GetRightCorner(corner_id) {
      +
      GetRightCorner(corner_id) {
         if (corner_id < 0)
            return kInvalidCornerIndex;
         return Opposite(Next(corner_id));
      @@ -1506,7 +1541,7 @@ EdgebreakerTraversal_Start() {                                        TypeSetOppositeCorner()
       
      -
      SetOppositeCorner(corner_id, pp_corner_id) {
      +
      SetOppositeCorner(corner_id, pp_corner_id) {
         opposite_corners_[corner_id] = opp_corner_id;
       }
       
      @@ -1514,7 +1549,7 @@ EdgebreakerTraversal_Start() { TypeMapCornerToVertex() -
      MapCornerToVertex(corner_id, vert_id) {
      +
      MapCornerToVertex(corner_id, vert_id) {
         face = Face(corner_id);
         faces_[face][LocalIndex(corner_id)] = vert_id;
         if (vert_id >= 0) {
      @@ -1526,7 +1561,7 @@ EdgebreakerTraversal_Start() {                                        TypeUpdateVertexToCornerMap()
       
      -
      UpdateVertexToCornerMap(vert) {
      +
      UpdateVertexToCornerMap(vert) {
         first_c = vertex_corners_[vert];
         if (first_c < 0)
           return;
      @@ -1545,7 +1580,7 @@ EdgebreakerTraversal_Start() {                                        TypeLeftMostCorner()
       
      -
      LeftMostCorner(v) {
      +
      LeftMostCorner(v) {
         return vertex_corners_[v];
       }
       
      @@ -1553,7 +1588,7 @@ EdgebreakerTraversal_Start() { TypeMakeVertexIsolated() -
      MakeVertexIsolated(vert) {
      +
      MakeVertexIsolated(vert) {
         vertex_corners_[vert] = kInvalidCornerIndex;
       }
       
      @@ -1563,7 +1598,7 @@ EdgebreakerTraversal_Start() { Typebool IsCornerOnSeam() -
      bool IsCornerOnSeam(corner) {
      +
      bool IsCornerOnSeam(corner) {
         return is_vertex_on_seam_[corner_table_->Vertex(corner)];
       }
       
      @@ -1571,7 +1606,7 @@ EdgebreakerTraversal_Start() { TypeAddSeamEdge() -
      AddSeamEdge(c) {
      +
      AddSeamEdge(c) {
         MarkSeam(c)
         opp_corner = corner_table_->Opposite(c);
         if (opp_corner >= 0) {
      @@ -1584,7 +1619,7 @@ EdgebreakerTraversal_Start() {                                        TypeMarkSeam()
       
      -
      MarkSeam(c) {
      +
      MarkSeam(c) {
         is_edge_on_seam_[c] = true;
         is_vertex_on_seam_[corner_table_->Vertex(corner_table_->Next(c))] = true;
         is_vertex_on_seam_[corner_table_->Vertex(corner_table_->Previous(c))
      @@ -1595,7 +1630,7 @@ EdgebreakerTraversal_Start() {                                        TypeRecomputeVertices()
       
      -
      RecomputeVertices() {
      +
      RecomputeVertices() {
         // in code RecomputeVerticesInternal<false>(nullptr, nullptr)
         num_new_vertices = 0;
         for (v = 0; v < corner_table_->num_vertices(); ++v) {
      @@ -1634,8 +1669,8 @@ EdgebreakerTraversal_Start() {                                        TypeDecodeSymbols()
       
      -
      DecodeSymbols(num_symbols, out_buffer, out_values) {
      -  scheme                                                                     UI8
      +
      DecodeSymbols(num_symbols, out_buffer, out_values) {
      +  scheme                                                                UI8
         If (scheme == 0) {
           DecodeTaggedSymbols<>(num_symbols, src_buffer, out_values)
         } else if (scheme == 1) {
      @@ -1647,7 +1682,7 @@ EdgebreakerTraversal_Start() {                                        TypeDecodeTaggedSymbols()
       
      -
      DecodeTaggedSymbols() {
      +
      DecodeTaggedSymbols() {
         FIXME
       }
       
      @@ -1655,8 +1690,8 @@ EdgebreakerTraversal_Start() { TypeDecodeRawSymbols() -
      DecodeRawSymbols() {
      -  max_bit_length                                                             UI8
      +
      DecodeRawSymbols() {
      +  max_bit_length                                                        UI8
         DecodeRawSymbolsInternal(max_bit_length, out_values)
         return symbols
       }
      @@ -1665,7 +1700,7 @@ EdgebreakerTraversal_Start() {                                        TypeDecodeRawSymbolsInternal()
       
      -
      DecodeRawSymbolsInternal(max_bit_length, out_values) {
      +
      DecodeRawSymbolsInternal(max_bit_length, out_values) {
         decoder = CreateRansSymbolDecoder(max_bit_length)
         decoder.StartDecoding()
         // RansSymbolDecoder_StartDecoding
      @@ -1679,15 +1714,15 @@ EdgebreakerTraversal_Start() {                                        TypeCreateRansSymbolDecoder()
       
      -
      CreateRansSymbolDecoder(max_bit_length) {
      +
      CreateRansSymbolDecoder(max_bit_length) {
         rans_precision_bits  = (3 * max_bit_length) / 2;
         rans_precision_bits = min(rans_precision_bits, 20)
         rans_precision_bits = max(rans_precision_bits, 12)
         rans_precision = 1 << rans_precision_bits_;
         l_rans_base = rans_precision * 4;
      -  num_symbols_                                                               UI32
      +  num_symbols_                                                          UI32
         for (i = 0; i < num_symbols_; ++i) {
      -    prob_data                                                                UI8
      +    prob_data                                                           UI8
           if ((prob_data & 3) == 3) {
             offset = prob_data >> 2
             for (j = 0; j < offset + 1; ++j) {
      @@ -1697,7 +1732,7 @@ EdgebreakerTraversal_Start() {                                        TypeTypeRansSymbolDecoder_StartDecoding()
       
      -
      RansSymbolDecoder_StartDecoding() {
      -  bytes_encoded                                                              UI64
      -  buffer                                                                     bytes_encoded * UI8
      +
      RansSymbolDecoder_StartDecoding() {
      +  bytes_encoded                                                         UI64
      +  buffer                                                                bytes_encoded * UI8
         rans_read_init(buffer, bytes_encoded)
       }
       
      @@ -1720,7 +1755,7 @@ EdgebreakerTraversal_Start() { TypeRansSymbolDecoder_DecodeSymbol() -
      RansSymbolDecoder_DecodeSymbol() {
      +
      RansSymbolDecoder_DecodeSymbol() {
         ans_.rans_read()
       }
       
      @@ -1730,7 +1765,7 @@ EdgebreakerTraversal_Start() { Typeans_read_init() -
      ans_read_init(struct AnsDecoder *const ans, const uint8_t *const buf,
      +
      ans_read_init(struct AnsDecoder *const ans, const uint8_t *const buf,
                              int offset) {
         x = buf[offset - 1] >> 6
         If (x == 0) {
      @@ -1753,7 +1788,7 @@ EdgebreakerTraversal_Start() {                                        Typeint rabs_desc_read()
       
      -
      int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
      +
      int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
         AnsP8 p = ans_p8_precision - p0;
         if (ans->state < l_base) {
           ans->state = ans->state * io_base + ans->buf[--ans->buf_offset];
      @@ -1775,7 +1810,7 @@ EdgebreakerTraversal_Start() {                                        Typerans_read_init()
       
      -
      rans_read_init(UI8 *buf, int offset) {
      +
      rans_read_init(UI8 *buf, int offset) {
         ans_.buf = buf;
         x = buf[offset - 1] >> 6
         If (x == 0) {
      @@ -1798,7 +1833,7 @@ EdgebreakerTraversal_Start() {                                        Typerans_build_look_up_table()
       
      -
      rans_build_look_up_table() {
      +
      rans_build_look_up_table() {
         cum_prob = 0
         act_prob = 0
         for (i = 0; i < num_symbols; ++i) {
      @@ -1815,7 +1850,7 @@ EdgebreakerTraversal_Start() {                                        Typerans_read()
       
      -
      rans_read() {
      +
      rans_read() {
         while (ans_.state < l_rans_base) {
           ans_.state = ans_.state * io_base + ans_.buf[--ans_.buf_offset];
         }
      @@ -1830,7 +1865,7 @@ EdgebreakerTraversal_Start() {                                        Typefetch_sym()
       
      -
      fetch_sym() {
      +
      fetch_sym() {
         symbol = lut_table[rem]
         out->val = symbol
         out->prob = probability_table_[symbol].prob;
      @@ -1843,10 +1878,10 @@ EdgebreakerTraversal_Start() {                                        TypeRansBitDecoder_StartDecoding()
       
      -
      RansBitDecoder_StartDecoding(DecoderBuffer *source_buffer) {
      -  prob_zero_                                                                 UI8
      -  size                                                                       UI32
      -  buffer_                                                                    size * UI8
      +
      RansBitDecoder_StartDecoding(DecoderBuffer *source_buffer) {
      +  prob_zero_                                                            UI8
      +  size                                                                  UI32
      +  buffer_                                                               size * UI8
         ans_read_init(&ans_decoder_, buffer_, size)
       }
       
      @@ -1854,7 +1889,7 @@ EdgebreakerTraversal_Start() { TypeDecodeNextBit() -
      DecodeNextBit() {
      +
      DecodeNextBit() {
         uint8_t bit = rabs_desc_read(&ans_decoder_, prob_zero_);
         return bit > 0;
       }
      @@ -1865,9 +1900,9 @@ EdgebreakerTraversal_Start() {                                        TypeDecodeVarint
       
      -
      DecodeVarint<IT>() {
      +
      DecodeVarint<IT>() {
         If (std::is_unsigned<IT>::value) {
      -    in                                                                       UI8
      +    in                                                                  UI8
           If (in & (1 << 7)) {
             out = DecodeVarint<IT>()
             out = (out << 7) | (in & ((1 << 7) - 1))
      @@ -1883,7 +1918,7 @@ EdgebreakerTraversal_Start() {                                        TypeConvertSymbolToSignedInt()
       
      -
      ConvertSymbolToSignedInt() {
      +
      ConvertSymbolToSignedInt() {
         abs_val = val >> 1
         If (val & 1 == 0) {
           return abs_val
      @@ -1897,22 +1932,24 @@ EdgebreakerTraversal_Start() {                                        TypeSequential Decoder

      +

      FIXME: ^^^ Heading level?

      +

      decode_connectivity()

      -
      decode_connectivity() {
      -  num_faces                                                       I32
      -  num_points                                                      I32
      -  connectivity _method                                            UI8
      +
      decode_connectivity() {
      +  num_faces                                                             I32
      +  num_points                                                            I32
      +  connectivity _method                                                  UI8
         If (connectivity _method == 0) {
           // TODO
         } else {
           loop num_faces {
             If (num_points < 256) {
      -        face[]                                                    UI8
      +        face[]                                                          UI8
             } else if (num_points < (1 << 16)) {
      -        face[]                                                    UI16
      +        face[]                                                          UI16
             } else {
      -        face[]                                                    UI32
      +        face[]                                                          UI32
             }
           }
         }
      diff --git a/docs/_site/spec/mesh.decoder.html b/docs/_site/spec/mesh.decoder.html
      index d4d0d2a..ae39264 100644
      --- a/docs/_site/spec/mesh.decoder.html
      +++ b/docs/_site/spec/mesh.decoder.html
      @@ -2,10 +2,9 @@
       
       

      DecodeConnectivityData()

      -
      -DecodeConnectivityData() Type +
      DecodeConnectivityData()
         InitializeDecoder()
         DecodeConnectivity()
       }
      -
      +
      diff --git a/docs/_site/spec/mesh.decoder.md b/docs/_site/spec/mesh.decoder.md index c283bea..47d57bf 100644 --- a/docs/_site/spec/mesh.decoder.md +++ b/docs/_site/spec/mesh.decoder.md @@ -2,10 +2,10 @@ ### DecodeConnectivityData() -
      -DecodeConnectivityData() Type +~~~~~ +DecodeConnectivityData() InitializeDecoder() DecodeConnectivity() } - -
      +~~~~~ +{:.draco-syntax } diff --git a/docs/assets/css/spec-style.sass b/docs/assets/css/spec-style.sass index b7b71c6..7fbd02c 100644 --- a/docs/assets/css/spec-style.sass +++ b/docs/assets/css/spec-style.sass @@ -24,12 +24,12 @@ a text-decoration: underline pre - font-family: $monofont - border: $gridweight solid $gridcolor + //font-family: $monofont + //border: $gridweight solid $gridcolor //background-color: #f7f7f7 - padding: 1em - margin-left: 1em - overflow-x: auto + //padding: 1em + //margin-left: 1em + //overflow-x: auto code //color: #060 @@ -80,12 +80,9 @@ figure.highlight padding-right: 1em border: $gridweight solid #ccc -div.syntax - //background-color: $gridcolor - //background-image: linear-gradient(transparent 50%, rgba(255,255,255,.5) 50%) - //background-size: 40px 40px +div.draco-syntax pre 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 border-left: $gridweight solid $gridcolor border-right: $gridweight solid $gridcolor diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..fcf894c --- /dev/null +++ b/docs/index.md @@ -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 \ No newline at end of file diff --git a/docs/spec/04.00.00.conventions.md b/docs/spec/04.00.00.conventions.md index 767de7c..762653f 100644 --- a/docs/spec/04.00.00.conventions.md +++ b/docs/spec/04.00.00.conventions.md @@ -1,5 +1,7 @@ ## Conventions +### General Conventions + * When bit reading is finished it will always pad the read to the current byte. @@ -24,3 +26,52 @@ * The hole and split data must be decoded before the EdgeBreaker symbols are 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. + diff --git a/docs/spec/README.md b/docs/spec/README.md new file mode 100644 index 0000000..3927aad --- /dev/null +++ b/docs/spec/README.md @@ -0,0 +1,266 @@ +--- +layout: spec +title: "README: Draco Spec Authoring Information" +--- + + +![Draco logo graphic](../artwork/draco3d-horiz-320x79.png) + + +# 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//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:/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:/draco.git + Push URL: git@github.com:/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:** + +
      ~~~~~
      +DecodeHeader() {
      +  draco_string                                                          UI8[5]
      +  major_version                                                         UI8
      +  minor_version                                                         UI8
      +  encoder_type                                                          UI8
      +  encoder_method                                                        UI8
      +  flags
      +}
      +~~~~~
      +{:.draco-syntax}
      + +... **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 +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 + diff --git a/docs/spec/attributes.decoder.md b/docs/spec/attributes.decoder.md index af4512a..32eaa36 100644 --- a/docs/spec/attributes.decoder.md +++ b/docs/spec/attributes.decoder.md @@ -5,16 +5,17 @@ ~~~~~ DecodeAttributesDecoderData(buffer) { - num_attributes I32 + num_attributes I32 point_attribute_ids_.resize(num_attributes); for (i = 0; i < num_attributes; ++i) { - att_type UI8 - data_type UI8 - components_count UI8 - normalized UI8 - custom_id UI16 + att_type UI8 + data_type UI8 + components_count UI8 + normalized UI8 + custom_id UI16 Initialize GeometryAttribute ga att_id = pc->AddAttribute(new PointAttribute(ga)); point_attribute_ids_[i] = att_id; } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/core.functions.md b/docs/spec/core.functions.md index b86d93c..955a033 100644 --- a/docs/spec/core.functions.md +++ b/docs/spec/core.functions.md @@ -6,7 +6,7 @@ ~~~~~ DecodeVarint() { If (std::is_unsigned::value) { - in UI8 + in UI8 If (in & (1 << 7)) { out = DecodeVarint() out = (out << 7) | (in & ((1 << 7) - 1)) @@ -18,6 +18,7 @@ DecodeVarint() { return out; } ~~~~~ +{:.draco-syntax } ### ConvertSymbolToSignedInt() @@ -33,29 +34,33 @@ ConvertSymbolToSignedInt() { return signed_val } ~~~~~ +{:.draco-syntax } Sequential Decoder +FIXME: ^^^ Heading level? + ### decode_connectivity() ~~~~~ decode_connectivity() { - num_faces I32 - num_points I32 - connectivity _method UI8 + num_faces I32 + num_points I32 + connectivity _method UI8 If (connectivity _method == 0) { // TODO } else { loop num_faces { If (num_points < 256) { - face[] UI8 + face[] UI8 } else if (num_points < (1 << 16)) { - face[] UI16 + face[] UI16 } else { - face[] UI32 + face[] UI32 } } } } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/corner.table.md b/docs/spec/corner.table.md index 4f37171..afbb395 100644 --- a/docs/spec/corner.table.md +++ b/docs/spec/corner.table.md @@ -8,6 +8,7 @@ Opposite(corner) { return opposite_corners_[corner]; } ~~~~~ +{:.draco-syntax } ### Next() @@ -17,6 +18,7 @@ Next(corner) { return LocalIndex(++corner) ? corner : corner - 3; } ~~~~~ +{:.draco-syntax } ### Previous() @@ -26,6 +28,7 @@ Previous(corner) { return LocalIndex(corner) ? corner - 1 : corner + 2; } ~~~~~ +{:.draco-syntax } ### Vertex() @@ -35,6 +38,7 @@ Vertex(corner) { faces_[Face(corner)][LocalIndex(corner)]; } ~~~~~ +{:.draco-syntax } ### Face() @@ -44,6 +48,7 @@ Face(corner) { return corner / 3; } ~~~~~ +{:.draco-syntax } ### LocalIndex() @@ -53,6 +58,7 @@ LocalIndex(corner) { return corner % 3; } ~~~~~ +{:.draco-syntax } ### num_vertices() @@ -62,6 +68,7 @@ num_vertices() { return vertex_corners_.size(); } ~~~~~ +{:.draco-syntax } ### num_corners() @@ -71,6 +78,7 @@ num_corners() { return faces_.size() * 3; } ~~~~~ +{:.draco-syntax } ### num_faces() @@ -80,6 +88,7 @@ num_faces() { return faces_.size(); } ~~~~~ +{:.draco-syntax } ### bool IsOnBoundary() @@ -92,7 +101,7 @@ bool IsOnBoundary(vert) { return false; } ~~~~~ - +{:.draco-syntax } ### SwingRight() @@ -102,6 +111,7 @@ SwingRight(corner) { return Previous(Opposite(Previous(corner))); } ~~~~~ +{:.draco-syntax } ### SwingLeft() @@ -111,6 +121,7 @@ SwingLeft(corner) { return Next(Opposite(Next(corner))); } ~~~~~ +{:.draco-syntax } ### GetLeftCorner() @@ -122,6 +133,7 @@ GetLeftCorner(corner_id) { return Opposite(Previous(corner_id)); } ~~~~~ +{:.draco-syntax } ### GetRightCorner() @@ -133,6 +145,7 @@ GetRightCorner(corner_id) { return Opposite(Next(corner_id)); } ~~~~~ +{:.draco-syntax } ### SetOppositeCorner() @@ -142,7 +155,7 @@ SetOppositeCorner(corner_id, pp_corner_id) { opposite_corners_[corner_id] = opp_corner_id; } ~~~~~ - +{:.draco-syntax } ### MapCornerToVertex() @@ -156,6 +169,7 @@ MapCornerToVertex(corner_id, vert_id) { } } ~~~~~ +{:.draco-syntax } ### UpdateVertexToCornerMap() @@ -176,7 +190,7 @@ UpdateVertexToCornerMap(vert) { } } ~~~~~ - +{:.draco-syntax } ### LeftMostCorner() @@ -186,6 +200,7 @@ LeftMostCorner(v) { return vertex_corners_[v]; } ~~~~~ +{:.draco-syntax } ### MakeVertexIsolated() @@ -195,3 +210,4 @@ MakeVertexIsolated(vert) { vertex_corners_[vert] = kInvalidCornerIndex; } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/cornertable.traversal.processor.md b/docs/spec/cornertable.traversal.processor.md index 05b8390..098d795 100644 --- a/docs/spec/cornertable.traversal.processor.md +++ b/docs/spec/cornertable.traversal.processor.md @@ -11,6 +11,7 @@ IsFaceVisited(corner_id) { return is_face_visited_[corner_id / 3]; } ~~~~~ +{:.draco-syntax } ### MarkFaceVisited() @@ -20,6 +21,7 @@ MarkFaceVisited(face_id) { is_face_visited_[face_id] = true; } ~~~~~ +{:.draco-syntax } ### IsVertexVisited() @@ -29,6 +31,7 @@ IsVertexVisited(vert_id) { return is_vertex_visited_[vert_id]; } ~~~~~ +{:.draco-syntax } ### MarkVertexVisited() @@ -38,3 +41,4 @@ MarkVertexVisited(vert_id) { is_vertex_visited_[vert_id] = true; } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/draco.decoder.md b/docs/spec/draco.decoder.md index 99c8096..7cb3cc5 100644 --- a/docs/spec/draco.decoder.md +++ b/docs/spec/draco.decoder.md @@ -2,35 +2,35 @@ ### Decode() -
      -Decode() { Type +~~~~~ +Decode() { DecodeHeader() DecodeConnectivityData() DecodeAttributeData()} - -
      +~~~~~ +{:.draco-syntax} ### DecodeHeader() -
      -DecodeHeader() { Type - draco_string UI8[5] - major_version UI8 - minor_version UI8 - encoder_type UI8 - encoder_method UI8 +~~~~~ +DecodeHeader() { + draco_string UI8[5] + major_version UI8 + minor_version UI8 + encoder_type UI8 + encoder_method UI8 flags } - -
      +~~~~~ +{:.draco-syntax} ### DecodeAttributeData() -
      -DecodeAttributeData() { Type - num_attributes_decoders UI8 +~~~~~ +DecodeAttributeData() { + num_attributes_decoders UI8 for (i = 0; i < num_attributes_decoders; ++i) { CreateAttributesDecoder(i); } @@ -42,4 +42,5 @@ DecodeAttributeData() { Type +~~~~~ +{:.draco-syntax} diff --git a/docs/spec/edgebreaker.decoder.md b/docs/spec/edgebreaker.decoder.md index 3536ec0..11baa85 100644 --- a/docs/spec/edgebreaker.decoder.md +++ b/docs/spec/edgebreaker.decoder.md @@ -2,26 +2,27 @@ ### InitializeDecoder() -
      -InitializeDecoder() { Type - edgebreaker_decoder_type UI8 +~~~~~ +InitializeDecoder() { + edgebreaker_decoder_type UI8 } - -
      +~~~~~ +{:.draco-syntax } ### DecodeConnectivity() -
      -DecodeConnectivity() { Type - num_new_verts UI32 - num_encoded_vertices UI32 - num_faces UI32 - num_attribute_data I8 - num_encoded_symbols UI32 - num_encoded_split_symbols UI32 - encoded_connectivity_size UI32 - // file pointer must be set to current position + encoded_connectivity_size +~~~~~ +DecodeConnectivity() { + num_new_verts UI32 + num_encoded_vertices UI32 + num_faces UI32 + num_attribute_data I8 + num_encoded_symbols UI32 + num_encoded_split_symbols UI32 + encoded_connectivity_size UI32 + // file pointer must be set to current position + // + encoded_connectivity_size hole_and_split_bytes = DecodeHoleAndTopologySplitEvents() // file pointer must be set to old current position EdgeBreakerTraversalValence_Start() @@ -47,14 +48,14 @@ DecodeConnectivity() { Type +~~~~~ +{:.draco-syntax } ### AssignPointsToCorners() -
      -AssignPointsToCorners() { Type +~~~~~ +AssignPointsToCorners() { decoder_->mesh()->SetNumFaces(corner_table_->num_faces()); if (attribute_data_.size() == 0) { for (f = 0; f < decoder_->mesh()->num_faces(); ++f) { @@ -125,14 +126,14 @@ AssignPointsToCorners() { Typepoint_cloud()->set_num_points(point_to_corner_map.size()); } - -
      +~~~~~ +{:.draco-syntax } ### DecodeConnectivity() -
      -DecodeConnectivity(num_symbols) { Type +~~~~~ +DecodeConnectivity(num_symbols) { for (i = 0; i < num_symbols; ++i) { symbol = TraversalValence_DecodeSymbol() corner = 3 * num_faces++ @@ -187,14 +188,14 @@ DecodeConnectivity(num_symbols) { Type +~~~~~ +{:.draco-syntax } ### UpdateCornerTableForSymbolC() -
      -UpdateCornerTableForSymbolC(corner) { Type +~~~~~ +UpdateCornerTableForSymbolC(corner) { corner_a = active_corner_stack.back(); corner_b = corner_table_->Previous(corner_a); while (corner_table_->Opposite(corner_b) >= 0) { @@ -210,15 +211,15 @@ UpdateCornerTableForSymbolC(corner) { TypeVertex(corner_table_->Previous(corner_a))); return vertex_x; } - -
      +~~~~~ +{:.draco-syntax } ### UpdateCornerTableForSymbolLR() -
      -UpdateCornerTableForSymbolLR(corner, symbol) { Type +~~~~~ +UpdateCornerTableForSymbolLR(corner, symbol) { if (symbol == TOPOLOGY_R) { opp_corner = corner + 2; } else { @@ -233,14 +234,14 @@ UpdateCornerTableForSymbolLR(corner, symbol) { TypePrevious(opp_corner), corner_table_->Vertex(corner_table_->Next(corner_a))); } - -
      +~~~~~ +{:.draco-syntax } ### HandleSymbolS() -
      -HandleSymbolS(corner) { Type +~~~~~ +HandleSymbolS(corner) { corner_b = active_corner_stack.pop_back(); it = topology_split_active_corners.find(symbol_id); if (it != topology_split_active_corners.end()) { @@ -265,26 +266,26 @@ HandleSymbolS(corner) { TypeMakeVertexIsolated(vertex_n); } - -
      +~~~~~ +{:.draco-syntax } ### UpdateCornerTableForSymbolE() -
      -UpdateCornerTableForSymbolE() { Type +~~~~~ +UpdateCornerTableForSymbolE() { corner_table_->MapCornerToVertex(corner, num_vertices++); corner_table_->MapCornerToVertex(corner + 1, num_vertices++); corner_table_->MapCornerToVertex(corner + 2, num_vertices++); } - -
      +~~~~~ +{:.draco-syntax } ### UpdateCornerTableForInteriorFace() -
      -UpdateCornerTableForInteriorFace() { Type +~~~~~ +UpdateCornerTableForInteriorFace() { corner_b = corner_table_->Previous(corner); while (corner_table_->Opposite(corner_b) >= 0) { corner_b = corner_table_->Previous(corner_table_->Opposite(corner_b)); @@ -301,15 +302,14 @@ UpdateCornerTableForInteriorFace() { TypeMapCornerToVertex( new_corner + 2, corner_table_->Vertex(corner_table_->Next(corner))); } - -
      +~~~~~ +{:.draco-syntax } ### IsTopologySplit() -
      -IsTopologySplit(encoder_symbol_id, *out_face_edge, Type - +~~~~~ +IsTopologySplit(encoder_symbol_id, *out_face_edge, *out_encoder_split_symbol_id) { if (topology_split_data_.size() == 0) return false; @@ -321,14 +321,14 @@ IsTopologySplit(encoder_symbol_id, *out_face_edge, Type +~~~~~ +{:.draco-syntax } ### DecodeAttributeConnectivitiesOnFace() -
      -DecodeAttributeConnectivitiesOnFace(corner) { Type +~~~~~ +DecodeAttributeConnectivitiesOnFace(corner) { corners[3] = {corner, corner_table_->Next(corner), corner_table_->Previous(corner)} for (c = 0; c < 3; ++c) { @@ -347,16 +347,16 @@ DecodeAttributeConnectivitiesOnFace(corner) { Type +~~~~~ +{:.draco-syntax } ### SetOppositeCorners() -
      -SetOppositeCorners(corner_0, corner_1) { Type +~~~~~ +SetOppositeCorners(corner_0, corner_1) { corner_table_->SetOppositeCorner(corner_0, corner_1); corner_table_->SetOppositeCorner(corner_1, corner_0); } - -
      +~~~~~ +{:.draco-syntax } diff --git a/docs/spec/edgebreaker.hole.and.topology.md b/docs/spec/edgebreaker.hole.and.topology.md index 32f4fe1..5e3ae03 100644 --- a/docs/spec/edgebreaker.hole.and.topology.md +++ b/docs/spec/edgebreaker.hole.and.topology.md @@ -1,47 +1,45 @@ ## EdgeBreaker Hole and Topology Split Events + ### DecodeHoleAndTopologySplitEvents() -FIXME: Escaping angle brackets - -
      -DecodeHoleAndTopologySplitEvents() { Type - num_topologoy_splits UI32 +~~~~~ +DecodeHoleAndTopologySplitEvents() { + num_topologoy_splits UI32 source_symbol_id = 0 for (i = 0; i < num_topologoy_splits; ++i) { - DecodeVarint\(&delta) + DecodeVarint(&delta) split_data[i].source_symbol_id = delta + source_symbol_id - DecodeVarint\(&delta) + DecodeVarint(&delta) split_data[i].split_symbol_id = source_symbol_id - delta } for (i = 0; i < num_topologoy_splits; ++i) { - split_data[i].split_edge bits1 - split_data[i].source_edge bits1 + split_data[i].split_edge bits1 + split_data[i].source_edge bits1 } - num_hole_events UI32 + num_hole_events UI32 symbol_id = 0 for (i = 0; i < num_hole_events; ++i) { - DecodeVarint\(&delta) + DecodeVarint(&delta) hole_data[i].symbol_id = delta + symbol_id } return bytes_decoded; } +~~~~~ +{:.draco-syntax } -
      ### CreateAttributesDecoder -FIXME: Escaping angle brackets - -
      -CreateAttributesDecoder() { Type - att_data_id I8 - decoder_type UI8 +~~~~~ +CreateAttributesDecoder() { + att_data_id I8 + decoder_type UI8 if (att_data_id >= 0) { attribute_data_[att_data_id].decoder_id = att_decoder_id; } - traversal_method_encoded UI8 + traversal_method_encoded UI8 if (decoder_type == MESH_VERTEX_ATTRIBUTE) { if (att_data_id < 0) { encoding_data = &pos_encoding_data_; @@ -50,11 +48,11 @@ CreateAttributesDecoder() { Type AttTraverser; - sequencer = CreateVertexTraversalSequencer\(encoding_data); + typedef EdgeBreakerTraverser AttTraverser; + sequencer = CreateVertexTraversalSequencer(encoding_data); } else if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) { - typedef PredictionDegreeTraverser\ AttTraverser; - sequencer = CreateVertexTraversalSequencer\(encoding_data); + typedef PredictionDegreeTraverser AttTraverser; + sequencer = CreateVertexTraversalSequencer(encoding_data); } } else { // TODO @@ -62,6 +60,6 @@ CreateAttributesDecoder() { TypeSetAttributesDecoder(att_decoder_id, std::move(att_controller)); } - -
      +~~~~~ +{:.draco-syntax } diff --git a/docs/spec/edgebreaker.traversal.decoder.md b/docs/spec/edgebreaker.traversal.decoder.md index d1ee28e..87658b6 100644 --- a/docs/spec/edgebreaker.traversal.decoder.md +++ b/docs/spec/edgebreaker.traversal.decoder.md @@ -3,12 +3,12 @@ ### EdgebreakerTraversal_Start() -
      -EdgebreakerTraversal_Start() { Type - size UI64 - symbol_buffer_ size * UI8 - size UI64 - start_face_buffer_ size * UI8 +~~~~~ +EdgebreakerTraversal_Start() { + size UI64 + symbol_buffer_ size * UI8 + size UI64 + start_face_buffer_ size * UI8 if (num_attribute_data_ > 0) { attribute_connectivity_decoders_ = std::unique_ptr( new BinaryDecoder[num_attribute_data_]); @@ -17,22 +17,23 @@ EdgebreakerTraversal_Start() { Type +~~~~~ +{:.draco-syntax } ### Traversal_DecodeSymbol() ~~~~~ Traversal_DecodeSymbol() { - symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol); bits1 + symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol); bits1 if (symbol != TOPOLOGY_C) { - symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix); bits2 + symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix); bits2 symbol |= (symbol_suffix << 1); } return symbol } ~~~~~ +{:.draco-syntax } ### DecodeAttributeSeam() @@ -42,3 +43,4 @@ DecodeAttributeSeam(int attribute) { return attribute_connectivity_decoders_[attribute].DecodeNextBit(); } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/edgebreaker.traversal.valence.decoder.md b/docs/spec/edgebreaker.traversal.valence.decoder.md index a0d77f8..444ed94 100644 --- a/docs/spec/edgebreaker.traversal.valence.decoder.md +++ b/docs/spec/edgebreaker.traversal.valence.decoder.md @@ -6,8 +6,8 @@ ~~~~~ EdgeBreakerTraversalValence_Start(num_vertices, num_attribute_data) { out_buffer = EdgebreakerTraversal_Start() - num_split_symbols I32 - mode == 0 I8 + num_split_symbols I32 + mode == 0 I8 num_vertices_ += num_split_symbols vertex_valences_ init to 0 vertex_valences_.resize(num_vertices_, 0); @@ -24,6 +24,7 @@ EdgeBreakerTraversalValence_Start(num_vertices, num_attribute_data) { return out_buffer; } ~~~~~ +{:.draco-syntax } @@ -33,7 +34,7 @@ EdgeBreakerTraversalValence_Start(num_vertices, num_attribute_data) { TraversalValence_DecodeSymbol() { if (active_context_ != -1) { symbol_id = context_symbols_[active_context_] - [--context_counters_[active_context_]] + [--context_counters_[active_context_]] last_symbol_ = edge_breaker_symbol_to_topology_id[symbol_id] } else { last_symbol_ = Traversal_DecodeSymbol() @@ -41,6 +42,7 @@ TraversalValence_DecodeSymbol() { return last_symbol_ } ~~~~~ +{:.draco-syntax } @@ -76,7 +78,7 @@ TraversalValence_NewActiveCornerReached(corner) { active_context_ = (valence - min_valence_); } ~~~~~ - +{:.draco-syntax } ### TraversalValence_MergeVertices() @@ -86,3 +88,4 @@ TraversalValence_MergeVertices(dest, source) { vertex_valences_[dest] += vertex_valences_[source]; } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/edgebreaker.traverser.md b/docs/spec/edgebreaker.traverser.md index 3cf8f68..7ded44c 100644 --- a/docs/spec/edgebreaker.traverser.md +++ b/docs/spec/edgebreaker.traverser.md @@ -68,3 +68,4 @@ TraverseFromCorner(corner_id) { } } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/mesh.attribute.corner.table.md b/docs/spec/mesh.attribute.corner.table.md index 3e0b7af..bdb87da 100644 --- a/docs/spec/mesh.attribute.corner.table.md +++ b/docs/spec/mesh.attribute.corner.table.md @@ -8,6 +8,7 @@ bool IsCornerOnSeam(corner) { return is_vertex_on_seam_[corner_table_->Vertex(corner)]; } ~~~~~ +{:.draco-syntax } ### AddSeamEdge() @@ -22,6 +23,7 @@ AddSeamEdge(c) { } } ~~~~~ +{:.draco-syntax } ### MarkSeam() @@ -34,6 +36,7 @@ MarkSeam(c) { ] = true; } ~~~~~ +{:.draco-syntax } ### RecomputeVertices() @@ -72,3 +75,4 @@ RecomputeVertices() { } } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/mesh.attribute.indices.encoding.observer.md b/docs/spec/mesh.attribute.indices.encoding.observer.md index 6260cbe..538c014 100644 --- a/docs/spec/mesh.attribute.indices.encoding.observer.md +++ b/docs/spec/mesh.attribute.indices.encoding.observer.md @@ -15,3 +15,4 @@ OnNewVertexVisited(vertex, corner) { encoding_data_->num_values++; } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/mesh.decoder.md b/docs/spec/mesh.decoder.md index c283bea..47d57bf 100644 --- a/docs/spec/mesh.decoder.md +++ b/docs/spec/mesh.decoder.md @@ -2,10 +2,10 @@ ### DecodeConnectivityData() -
      -DecodeConnectivityData() Type +~~~~~ +DecodeConnectivityData() InitializeDecoder() DecodeConnectivity() } - -
      +~~~~~ +{:.draco-syntax } diff --git a/docs/spec/mesh.prediction.scheme.parallelogram.md b/docs/spec/mesh.prediction.scheme.parallelogram.md index 9abf023..bdf0783 100644 --- a/docs/spec/mesh.prediction.scheme.parallelogram.md +++ b/docs/spec/mesh.prediction.scheme.parallelogram.md @@ -8,7 +8,7 @@ Decode(...) { this->transform().InitializeDecoding(num_components); // restore the first value this->transform().ComputeOriginalValue(pred_vals.get(), - in_corr, out_data, 0); + in_corr, out_data, 0); // PredictionSchemeWrapTransform_ComputeOriginalValue() corner_map_size = this->mesh_data().data_to_corner_map()->size(); for (p = 1; p < corner_map_size; ++p) { @@ -30,10 +30,14 @@ Decode(...) { } } ~~~~~ +{:.draco-syntax } MeshPredictionSchemeParallelogramShared +FIXME: ^^^ Heading level? + + ### ComputeParallelogramPrediction() ~~~~~ @@ -56,3 +60,4 @@ ComputeParallelogramPrediction(...) { return false; } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/mesh.traversal.sequencer.md b/docs/spec/mesh.traversal.sequencer.md index 4e56f9f..a0c3864 100644 --- a/docs/spec/mesh.traversal.sequencer.md +++ b/docs/spec/mesh.traversal.sequencer.md @@ -17,6 +17,7 @@ GenerateSequenceInternal() { traverser_.OnTraversalEnd(); } ~~~~~ +{:.draco-syntax } ### ProcessCorner() @@ -26,6 +27,7 @@ ProcessCorner(corner_id) { traverser_.TraverseFromCorner(corner_id); } ~~~~~ +{:.draco-syntax } ### UpdatePointToAttributeIndexMapping() @@ -49,10 +51,13 @@ UpdatePointToAttributeIndexMapping(PointAttribute *attribute) { } } ~~~~~ +{:.draco-syntax } PointsSequencer +FIXME: ^^^ Heading level? + ### AddPointId() ~~~~~ @@ -60,3 +65,4 @@ AddPointId(point_id) { out_point_ids_->push_back(point_id); } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/prediction.scheme.transform.md b/docs/spec/prediction.scheme.transform.md index 1745e27..6057f14 100644 --- a/docs/spec/prediction.scheme.transform.md +++ b/docs/spec/prediction.scheme.transform.md @@ -5,10 +5,11 @@ ~~~~~ ComputeOriginalValue(const DataTypeT *predicted_vals, - const CorrTypeT *corr_vals, - DataTypeT *out_original_vals, int val_id) { + const CorrTypeT *corr_vals, + DataTypeT *out_original_vals, int val_id) { for (i = 0; i < num_components_; ++i) { out_original_vals[i] = predicted_vals[i] + corr_vals[val_id + i]; } } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/prediction.scheme.wrap.transform.md b/docs/spec/prediction.scheme.wrap.transform.md index e742adb..10888a9 100644 --- a/docs/spec/prediction.scheme.wrap.transform.md +++ b/docs/spec/prediction.scheme.wrap.transform.md @@ -5,18 +5,19 @@ ~~~~~ DecodeTransformData(buffer) { - min_value_ DT - max_value_ DT + min_value_ DT + max_value_ DT } ~~~~~ +{:.draco-syntax } ### ComputeOriginalValue() ~~~~~ ComputeOriginalValue(const DataTypeT *predicted_vals, - const CorrTypeT *corr_vals, - DataTypeT *out_original_vals, int val_id) { + const CorrTypeT *corr_vals, + DataTypeT *out_original_vals, int val_id) { clamped_vals = ClampPredictedValue(predicted_vals); ComputeOriginalValue(clamped_vals, corr_vals, out_original_vals, val_id) // PredictionSchemeTransform_ComputeOriginalValue() @@ -28,6 +29,7 @@ ComputeOriginalValue(const DataTypeT *predicted_vals, } } ~~~~~ +{:.draco-syntax } ### ClampPredictedValue() @@ -41,3 +43,4 @@ ClampPredictedValue(const DataTypeT *predicted_val) { return &clamped_value_[0]; } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/rans.bit.decoder.md b/docs/spec/rans.bit.decoder.md index 17bb373..595c21e 100644 --- a/docs/spec/rans.bit.decoder.md +++ b/docs/spec/rans.bit.decoder.md @@ -5,12 +5,13 @@ ~~~~~ RansBitDecoder_StartDecoding(DecoderBuffer *source_buffer) { - prob_zero_ UI8 - size UI32 - buffer_ size * UI8 + prob_zero_ UI8 + size UI32 + buffer_ size * UI8 ans_read_init(&ans_decoder_, buffer_, size) } ~~~~~ +{:.draco-syntax } ### DecodeNextBit() @@ -21,3 +22,4 @@ DecodeNextBit() { return bit > 0; } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/rans.decoding.md b/docs/spec/rans.decoding.md index 358d506..c5cb358 100644 --- a/docs/spec/rans.decoding.md +++ b/docs/spec/rans.decoding.md @@ -23,6 +23,7 @@ ans_read_init(struct AnsDecoder *const ans, const uint8_t *const buf, ans->state += l_base; } ~~~~~ +{:.draco-syntax } ### int rabs_desc_read() @@ -46,7 +47,7 @@ int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) { return val; } ~~~~~ - +{:.draco-syntax } ### rans_read_init() @@ -71,6 +72,7 @@ rans_read_init(UI8 *buf, int offset) { ans_.state += l_rans_base; } ~~~~~ +{:.draco-syntax } ### rans_build_look_up_table() @@ -89,7 +91,7 @@ rans_build_look_up_table() { act_prob = cum_prob } ~~~~~ - +{:.draco-syntax } ### rans_read() @@ -106,6 +108,7 @@ rans_read() { return sym.val; } ~~~~~ +{:.draco-syntax } ### fetch_sym() @@ -118,3 +121,4 @@ fetch_sym() { out->cum_prob = probability_table_[symbol].cum_prob; } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/sequential.attribute.decoder.md b/docs/spec/sequential.attribute.decoder.md index 1461087..2a09f44 100644 --- a/docs/spec/sequential.attribute.decoder.md +++ b/docs/spec/sequential.attribute.decoder.md @@ -6,6 +6,7 @@ Initialize(...) { // Init some members } ~~~~~ +{:.draco-syntax } ### DecodeValues() @@ -17,10 +18,11 @@ DecodeValues(const std::vector &point_ids) { std::unique_ptr value_data_ptr(new uint8_t[entry_size]); out_byte_pos = 0; for (i = 0; i < num_values; ++i) { - value_data UI8 * entry_size + value_data UI8 * entry_size attribute_->buffer()->Write(out_byte_pos, value_data, entry_size); out_byte_pos += entry_size; } } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/sequential.attributes.decoders.controller.md b/docs/spec/sequential.attributes.decoders.controller.md index fc7115f..6edffba 100644 --- a/docs/spec/sequential.attributes.decoders.controller.md +++ b/docs/spec/sequential.attributes.decoders.controller.md @@ -8,11 +8,12 @@ DecodeAttributesDecoderData(buffer) { AttributesDecoder_DecodeAttributesDecoderData(buffer) sequential_decoders_.resize(num_attributes()); for (i = 0; i < num_attributes(); ++i) { - decoder_type UI8 + decoder_type UI8 sequential_decoders_[i] = CreateSequentialDecoder(decoder_type); sequential_decoders_[i]->Initialize(decoder(), GetAttributeId(i)) } ~~~~~ +{:.draco-syntax } ### DecodeAttributes() @@ -30,7 +31,7 @@ DecodeAttributes(buffer) { } } ~~~~~ - +{:.draco-syntax } ### CreateSequentialDecoder() @@ -49,4 +50,5 @@ CreateSequentialDecoder(type) { } } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/sequential.integer.attribute.decoder.md b/docs/spec/sequential.integer.attribute.decoder.md index 211007d..ac663d1 100644 --- a/docs/spec/sequential.integer.attribute.decoder.md +++ b/docs/spec/sequential.integer.attribute.decoder.md @@ -6,15 +6,16 @@ Initialize(...) { SequentialAttributeDecoder_Initialize() } ~~~~~ +{:.draco-syntax } ### DecodeValues() ~~~~~ DecodeValues(point_ids) { - prediction_scheme_method I8 + prediction_scheme_method I8 if (prediction_scheme_method != PREDICTION_NONE) { - prediction_transform_type I8 + prediction_transform_type I8 prediction_scheme_ = CreateIntPredictionScheme(...) } if (prediction_scheme_) { @@ -25,13 +26,14 @@ DecodeValues(point_ids) { DequantizeValues(num_values) } ~~~~~ +{:.draco-syntax } ### DecodeIntegerValues() ~~~~~ DecodeIntegerValues(point_ids) { - compressed UI8 + compressed UI8 if (compressed) { DecodeSymbols(..., values_.data()) } else { @@ -45,8 +47,9 @@ DecodeIntegerValues(point_ids) { // DecodeTransformData(buffer) if (!values_.empty()) { prediction_scheme_->Decode(values_.data(), &values_[0], - values_.size(), num_components, point_ids.data()) + values_.size(), num_components, point_ids.data()) // MeshPredictionSchemeParallelogram_Decode() } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/sequential.quantization.attribute.decoder.md b/docs/spec/sequential.quantization.attribute.decoder.md index 0653cdc..692cf9b 100644 --- a/docs/spec/sequential.quantization.attribute.decoder.md +++ b/docs/spec/sequential.quantization.attribute.decoder.md @@ -6,6 +6,7 @@ Initialize(...) { SequentialIntegerAttributeDecoder_Initialize() } ~~~~~ +{:.draco-syntax } ### DecodeIntegerValues() @@ -15,13 +16,14 @@ DecodeIntegerValues(point_ids) { // DecodeQuantizedDataInfo() num_components = attribute()->components_count(); for (i = 0; i < num_components; ++i) { - min_value_[i] F32 + min_value_[i] F32 } - max_value_dif_ F32 - quantization_bits_ UI8 + max_value_dif_ F32 + quantization_bits_ UI8 SequentialIntegerAttributeDecoder::DecodeIntegerValues() } ~~~~~ +{:.draco-syntax } ### DequantizeValues() @@ -44,3 +46,4 @@ DequantizeValues(num_values) { } } ~~~~~ +{:.draco-syntax } diff --git a/docs/spec/symbol.decoding.md b/docs/spec/symbol.decoding.md index 2c71d1c..084187d 100644 --- a/docs/spec/symbol.decoding.md +++ b/docs/spec/symbol.decoding.md @@ -5,7 +5,7 @@ ~~~~~ DecodeSymbols(num_symbols, out_buffer, out_values) { - scheme UI8 + scheme UI8 If (scheme == 0) { DecodeTaggedSymbols<>(num_symbols, src_buffer, out_values) } else if (scheme == 1) { @@ -13,6 +13,7 @@ DecodeSymbols(num_symbols, out_buffer, out_values) { } } ~~~~~ +{:.draco-syntax } ### DecodeTaggedSymbols() @@ -22,19 +23,19 @@ DecodeTaggedSymbols() { FIXME } ~~~~~ - +{:.draco-syntax } ### DecodeRawSymbols() ~~~~~ DecodeRawSymbols() { - max_bit_length UI8 + max_bit_length UI8 DecodeRawSymbolsInternal(max_bit_length, out_values) return symbols } ~~~~~ - +{:.draco-syntax } ### DecodeRawSymbolsInternal() @@ -50,6 +51,7 @@ DecodeRawSymbolsInternal(max_bit_length, out_values) { } } ~~~~~ +{:.draco-syntax } ### CreateRansSymbolDecoder() @@ -61,9 +63,9 @@ CreateRansSymbolDecoder(max_bit_length) { rans_precision_bits = max(rans_precision_bits, 12) rans_precision = 1 << rans_precision_bits_; l_rans_base = rans_precision * 4; - num_symbols_ UI32 + num_symbols_ UI32 for (i = 0; i < num_symbols_; ++i) { - prob_data UI8 + prob_data UI8 if ((prob_data & 3) == 3) { offset = prob_data >> 2 for (j = 0; j < offset + 1; ++j) { @@ -73,7 +75,7 @@ CreateRansSymbolDecoder(max_bit_length) { } else { prob = prob_data >> 2 for (j = 0; j < token; ++j) { - eb UI8 + eb UI8 prob = prob | (eb << (8 * (j + 1) - 2) } probability_table_[i] = prob; @@ -82,18 +84,19 @@ CreateRansSymbolDecoder(max_bit_length) { rans_build_look_up_table() } ~~~~~ +{:.draco-syntax } ### RansSymbolDecoder_StartDecoding() ~~~~~ RansSymbolDecoder_StartDecoding() { - bytes_encoded UI64 - buffer bytes_encoded * UI8 + bytes_encoded UI64 + buffer bytes_encoded * UI8 rans_read_init(buffer, bytes_encoded) } ~~~~~ - +{:.draco-syntax } ### RansSymbolDecoder_DecodeSymbol() @@ -103,3 +106,4 @@ RansSymbolDecoder_DecodeSymbol() { ans_.rans_read() } ~~~~~ +{:.draco-syntax }