fixed spelling mistakes in comments (#104)

This commit is contained in:
Will Brennan 2017-05-05 18:47:59 +01:00 committed by Ondrej Stava
parent 67600aa521
commit ecdd29e44b
45 changed files with 73 additions and 73 deletions

View File

@ -123,7 +123,7 @@ bool MeshPredictionSchemeConstrainedMultiParallelogram<
std::vector<DataTypeT> predicted_value; std::vector<DataTypeT> predicted_value;
}; };
// Bit-field used for computing permutations of exlcluded edges // Bit-field used for computing permutations of excluded edges
// (parallelograms). // (parallelograms).
bool exluded_parallelograms[kMaxNumParallelograms]; bool exluded_parallelograms[kMaxNumParallelograms];

View File

@ -23,7 +23,7 @@ namespace draco {
// Parallelogram prediction predicts an attribute value V from three vertices // Parallelogram prediction predicts an attribute value V from three vertices
// on the opposite face to the predicted vertex. The values on the three // on the opposite face to the predicted vertex. The values on the three
// vertices are used to construct a parallelogram V' = O - A - B, where O is the // vertices are used to construct a parallelogram V' = O - A - B, where O is the
// value on the oppoiste vertex, and A, B are values on the shared vertices: // value on the opposite vertex, and A, B are values on the shared vertices:
// V // V
// / \ // / \
// / \ // / \

View File

@ -29,7 +29,7 @@ typedef RAnsBitDecoder BinaryDecoder;
typedef RAnsBitEncoder BinaryEncoder; typedef RAnsBitEncoder BinaryEncoder;
// Prediction scheme designed for predicting texture coordinates from known // Prediction scheme designed for predicting texture coordinates from known
// spatial position of vertices. For good parameterizations, the ratios between // spatial position of vertices. For good parametrization, the ratios between
// triangle edge lengths should be about the same in both the spatial and UV // triangle edge lengths should be about the same in both the spatial and UV
// coordinate spaces, which makes the positions a good predictor for the UV // coordinate spaces, which makes the positions a good predictor for the UV
// coordinates. // coordinates.
@ -243,7 +243,7 @@ void MeshPredictionSchemeTexCoords<DataTypeT, TransformT, MeshDataT>::
const Vector3f prev_pos = GetPositionForEntryId(prev_data_id); const Vector3f prev_pos = GetPositionForEntryId(prev_data_id);
// Use the positions of the above triangle to predict the texture coordinate // Use the positions of the above triangle to predict the texture coordinate
// on the tip corner C. // on the tip corner C.
// Convert the triangle into a new coordinate system defined by orthoganal // Convert the triangle into a new coordinate system defined by orthogonal
// bases vectors S, T, where S is vector prev_pos - next_pos and T is an // bases vectors S, T, where S is vector prev_pos - next_pos and T is an
// perpendicular vector to S in the same plane as vector the // perpendicular vector to S in the same plane as vector the
// tip_pos - next_pos. // tip_pos - next_pos.

View File

@ -37,7 +37,7 @@ CreatePredictionSchemeForDecoder(PredictionSchemeMethod method, int att_id,
// Cast the decoder to mesh decoder. This is not necessarily safe if there // Cast the decoder to mesh decoder. This is not necessarily safe if there
// is some other decoder decides to use TRIANGULAR_MESH as the return type, // is some other decoder decides to use TRIANGULAR_MESH as the return type,
// but unfortunately there is not nice work around for this without using // but unfortunately there is not nice work around for this without using
// RTTI (double dispatch and similar conecepts will not work because of the // RTTI (double dispatch and similar concepts will not work because of the
// template nature of the prediction schemes). // template nature of the prediction schemes).
const MeshDecoder *const mesh_decoder = const MeshDecoder *const mesh_decoder =
static_cast<const MeshDecoder *>(decoder); static_cast<const MeshDecoder *>(decoder);

View File

@ -47,7 +47,7 @@ CreatePredictionSchemeForEncoder(PredictionSchemeMethod method, int att_id,
// Cast the encoder to mesh encoder. This is not necessarily safe if there // Cast the encoder to mesh encoder. This is not necessarily safe if there
// is some other encoder decides to use TRIANGULAR_MESH as the return type, // is some other encoder decides to use TRIANGULAR_MESH as the return type,
// but unfortunately there is not nice work around for this without using // but unfortunately there is not nice work around for this without using
// RTTI (double dispatch and similar conecepts will not work because of the // RTTI (double dispatch and similar concepts will not work because of the
// template nature of the prediction schemes). // template nature of the prediction schemes).
const MeshEncoder *const mesh_encoder = const MeshEncoder *const mesh_encoder =
static_cast<const MeshEncoder *>(encoder); static_cast<const MeshEncoder *>(encoder);

View File

@ -26,9 +26,9 @@ namespace draco {
// The transform works on octahedral coordinates for normals. The square is // The transform works on octahedral coordinates for normals. The square is
// subdivided into four inner triangles (diamond) and four outer triangles. The // subdivided into four inner triangles (diamond) and four outer triangles. The
// inner trianlges are associated with the upper part of the octahedron and the // inner triangles are associated with the upper part of the octahedron and the
// outer triangles are associated with the lower part. // outer triangles are associated with the lower part.
// Given a preditiction value P and the actual value Q that should be encoded, // Given a prediction value P and the actual value Q that should be encoded,
// this transform first checks if P is outside the diamond. If so, the outer // this transform first checks if P is outside the diamond. If so, the outer
// triangles are flipped towards the inside and vice versa. Then it checks if p // triangles are flipped towards the inside and vice versa. Then it checks if p
// is in the bottom left quadrant. If it is not, it rotates p and q accordingly. // is in the bottom left quadrant. If it is not, it rotates p and q accordingly.
@ -36,7 +36,7 @@ namespace draco {
// values. The inversion tends to result in shorter correction vectors and the // values. The inversion tends to result in shorter correction vectors and the
// rotation makes it so that all long correction values are positive, reducing // rotation makes it so that all long correction values are positive, reducing
// the possible value range of the correction values and increasing the // the possible value range of the correction values and increasing the
// occurence of positive large correction values, which helps the entropy // occurrences of positive large correction values, which helps the entropy
// encoder. This is possible since P is also known by the decoder, see also // encoder. This is possible since P is also known by the decoder, see also
// ComputeCorrection and ComputeOriginalValue functions. // ComputeCorrection and ComputeOriginalValue functions.
// Note that the tile is not periodic, which implies that the outer edges can // Note that the tile is not periodic, which implies that the outer edges can

View File

@ -26,9 +26,9 @@ namespace draco {
// The transform works on octahedral coordinates for normals. The square is // The transform works on octahedral coordinates for normals. The square is
// subdivided into four inner triangles (diamond) and four outer triangles. The // subdivided into four inner triangles (diamond) and four outer triangles. The
// inner trianlges are associated with the upper part of the octahedron and the // inner triangles are associated with the upper part of the octahedron and the
// outer triangles are associated with the lower part. // outer triangles are associated with the lower part.
// Given a preditiction value P and the actual value Q that should be encoded, // Given a prediction value P and the actual value Q that should be encoded,
// this transform first checks if P is outside the diamond. If so, the outer // this transform first checks if P is outside the diamond. If so, the outer
// triangles are flipped towards the inside and vice versa. The actual // triangles are flipped towards the inside and vice versa. The actual
// correction value is then based on the mapped P and Q values. This tends to // correction value is then based on the mapped P and Q values. This tends to

View File

@ -37,7 +37,7 @@ class PredictionSchemeTransform {
return PREDICTION_TRANSFORM_DELTA; return PREDICTION_TRANSFORM_DELTA;
} }
// Performs any custom initialization of the trasnform for the encoder. // Performs any custom initialization of the transform for the encoder.
// |size| = total number of values in |orig_data| (i.e., number of entries * // |size| = total number of values in |orig_data| (i.e., number of entries *
// number of components). // number of components).
void InitializeEncoding(const DataTypeT * /* orig_data */, int /* size */, void InitializeEncoding(const DataTypeT * /* orig_data */, int /* size */,

View File

@ -21,7 +21,7 @@
namespace draco { namespace draco {
// Class encapsuling options used by PointCloudEncoder and its derived classes. // Class encapsulating options used by PointCloudEncoder and its derived classes.
// The encoder can be controller through three different options: // The encoder can be controller through three different options:
// 1. Global options // 1. Global options
// 2. Per attribute options - i.e., options specific to a given attribute. // 2. Per attribute options - i.e., options specific to a given attribute.
@ -34,7 +34,7 @@ class EncoderOptions {
public: public:
static EncoderOptions CreateDefaultOptions(); static EncoderOptions CreateDefaultOptions();
// Sets the global options that serve to control the overal behavior of an // Sets the global options that serve to control the overall behavior of an
// encoder as well as a fallback for attribute options if they are not set. // encoder as well as a fallback for attribute options if they are not set.
void SetGlobalOptions(const Options &o); void SetGlobalOptions(const Options &o);
Options *GetGlobalOptions() { return &global_options_; } Options *GetGlobalOptions() { return &global_options_; }

View File

@ -34,7 +34,7 @@ bool EncodeMeshToBuffer(const Mesh &m, const EncoderOptions &options,
EncoderBuffer *out_buffer); EncoderBuffer *out_buffer);
// Creates default encoding options that contain a valid set of features that // Creates default encoding options that contain a valid set of features that
// the encoder can use. Otherwise all options are left unitialized which results // the encoder can use. Otherwise all options are left uninitialized which results
// in a lossless compression. // in a lossless compression.
EncoderOptions CreateDefaultEncoderOptions(); EncoderOptions CreateDefaultEncoderOptions();
@ -93,7 +93,7 @@ void SetEncodingMethod(EncoderOptions *options, int encoding_method);
// Sets the desired prediction method for a given attribute. By default, // Sets the desired prediction method for a given attribute. By default,
// prediction scheme is selected automatically by the encoder using other // prediction scheme is selected automatically by the encoder using other
// provided options (such as speed) and input geometry type (mesh, point cloud). // provided options (such as speed) and input geometry type (mesh, point cloud).
// This function should be called only when a specific prediction is prefered // This function should be called only when a specific prediction is preferred
// (e.g., when it is known that the encoder would select a less optimal // (e.g., when it is known that the encoder would select a less optimal
// prediction for the given input data). // prediction for the given input data).
// //

View File

@ -619,7 +619,7 @@ int MeshEdgeBreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity(
// \ / \b/ \ / // \ / \b/ \ /
// *-------*-------* // *-------*-------*
// //
// TODO(ostava): The ciruclation below should be replaced by functions // TODO(ostava): The circulation below should be replaced by functions
// that can be reused elsewhere. // that can be reused elsewhere.
CornerIndex corner_b = corner_table_->Previous(corner); CornerIndex corner_b = corner_table_->Previous(corner);
while (corner_table_->Opposite(corner_b) >= 0) { while (corner_table_->Opposite(corner_b) >= 0) {
@ -660,7 +660,7 @@ int MeshEdgeBreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity(
} }
} }
if (num_faces != corner_table_->num_faces()) if (num_faces != corner_table_->num_faces())
return -1; // Unexcpected number of decoded faces. return -1; // Unexpected number of decoded faces.
vertex_id_map_.resize(num_vertices); vertex_id_map_.resize(num_vertices);
return num_vertices; return num_vertices;
} }
@ -847,7 +847,7 @@ bool MeshEdgeBreakerDecoderImpl<TraversalDecoder>::AssignPointsToCorners() {
// Do a deduplication pass over the corners on the processed vertex. // Do a deduplication pass over the corners on the processed vertex.
// At this point each corner corresponds to one point id and our goal is to // At this point each corner corresponds to one point id and our goal is to
// merge similar points into a single point id. // merge similar points into a single point id.
// We do one one pass in a clocwise direction over the corners and we add // We do one one pass in a clockwise direction over the corners and we add
// a new point id whenever one of the attributes change. // a new point id whenever one of the attributes change.
c = deduplication_first_corner; c = deduplication_first_corner;
// Create a new point. // Create a new point.

View File

@ -76,7 +76,7 @@ class MeshEdgeBreakerDecoderImpl : public MeshEdgeBreakerDecoderImplInterface {
// Returns the number of vertices created by the decoder or -1 on error. // Returns the number of vertices created by the decoder or -1 on error.
int DecodeConnectivity(int num_symbols); int DecodeConnectivity(int num_symbols);
// Returns true if the current symbol was part of a topolgy split event. This // Returns true if the current symbol was part of a topology split event. This
// means that the current face was connected to the left edge of a face // means that the current face was connected to the left edge of a face
// encoded with the TOPOLOGY_S symbol. |out_symbol_edge| can be used to // encoded with the TOPOLOGY_S symbol. |out_symbol_edge| can be used to
// identify which edge of the source symbol was connected to the TOPOLOGY_S // identify which edge of the source symbol was connected to the TOPOLOGY_S

View File

@ -188,7 +188,7 @@ bool MeshEdgeBreakerEncoderImpl<TraversalEncoder>::GenerateAttributesEncoder(
new SequentialAttributeEncodersController(std::move(sequencer), att_id)); new SequentialAttributeEncodersController(std::move(sequencer), att_id));
// Update the mapping between the encoder id and the attribute data id. // Update the mapping between the encoder id and the attribute data id.
// This will be used by the decoder to select the approperiate attribute // This will be used by the decoder to select the appropriate attribute
// decoder and the correct connectivity. // decoder and the correct connectivity.
attribute_encoder_to_data_id_map_.push_back(att_data_id); attribute_encoder_to_data_id_map_.push_back(att_data_id);
GetEncoder()->AddAttributesEncoder(std::move(att_controller)); GetEncoder()->AddAttributesEncoder(std::move(att_controller));

View File

@ -97,13 +97,13 @@ enum EdgeFaceName : uint8_t { LEFT_FACE_EDGE = 0, RIGHT_FACE_EDGE = 1 };
// Struct used for storing data about a source face that connects to an // Struct used for storing data about a source face that connects to an
// already traversed face that was either the initial face or a face encoded // already traversed face that was either the initial face or a face encoded
// with either toplogy S (split) symbol. Such connection can be only caused by // with either topology S (split) symbol. Such connection can be only caused by
// topology changes on the traversed surface (if its genus != 0, i.e. when the // topology changes on the traversed surface (if its genus != 0, i.e. when the
// surface has topological handles or holes). // surface has topological handles or holes).
// For each occurence of such event we always encode the split symbol id, source // For each occurrence of such event we always encode the split symbol id, source
// symbol id and source edge id (left, or right). There will be always exectly // symbol id and source edge id (left, or right). There will be always exactly
// two occurences of this event for every topological handle on the traversed // two occurrences of this event for every topological handle on the traversed
// mesh and one occurence for a hole. // mesh and one occurrence for a hole.
struct TopologySplitEventData { struct TopologySplitEventData {
int32_t split_symbol_id; int32_t split_symbol_id;
int32_t source_symbol_id; int32_t source_symbol_id;

View File

@ -22,7 +22,7 @@ namespace draco {
// Encoder that tries to predict the edgebreaker traversal symbols based on the // Encoder that tries to predict the edgebreaker traversal symbols based on the
// vertex valences of the unencoded portion of the mesh. The current prediction // vertex valences of the unencoded portion of the mesh. The current prediction
// scheme assumes that each vertex has valence 6 which can be used to predict // scheme assumes that each vertex has valence 6 which can be used to predict
// the symbol preceeding the one that is currently encoded. Predictions are // the symbol preceding the one that is currently encoded. Predictions are
// encoded using an arithmetic coding which can lead to less than 1 bit per // encoded using an arithmetic coding which can lead to less than 1 bit per
// triangle encoding for highly regular meshes. // triangle encoding for highly regular meshes.
class MeshEdgeBreakerTraversalPredictiveEncoder class MeshEdgeBreakerTraversalPredictiveEncoder
@ -84,10 +84,10 @@ class MeshEdgeBreakerTraversalPredictiveEncoder
// Whenever we reach a split symbol, mark its tip vertex as invalid by // Whenever we reach a split symbol, mark its tip vertex as invalid by
// setting the valence to a negative value. Any prediction that will // setting the valence to a negative value. Any prediction that will
// use this vertex will then cause a misprediction. This is currently // use this vertex will then cause a misprediction. This is currently
// necessary because the decodding works in the reverse direction and // necessary because the decoding works in the reverse direction and
// the decoder doesn't know about these vertices until the split // the decoder doesn't know about these vertices until the split
// symbol is decoded at which point two vertices are merged into one. // symbol is decoded at which point two vertices are merged into one.
// This can be most likely solved on the encoder side by spliting the // This can be most likely solved on the encoder side by splitting the
// tip vertex into two, but since split symbols are relatively rare, // tip vertex into two, but since split symbols are relatively rare,
// it's probably not worth doing it. // it's probably not worth doing it.
vertex_valences_[corner_table_->Vertex(last_corner_).value()] = -1; vertex_valences_[corner_table_->Vertex(last_corner_).value()] = -1;

View File

@ -63,7 +63,7 @@ class MeshEdgeBreakerTraversalValenceEncoder
// Replicate the corner to vertex map from the corner table. We need to do // Replicate the corner to vertex map from the corner table. We need to do
// this because the map may get updated during encoding because we add new // this because the map may get updated during encoding because we add new
// vertices when we encouter split symbols. // vertices when we encounter split symbols.
corner_to_vertex_map_.resize(corner_table_->num_corners()); corner_to_vertex_map_.resize(corner_table_->num_corners());
for (CornerIndex i(0); i < corner_table_->num_corners(); ++i) { for (CornerIndex i(0); i < corner_table_->num_corners(); ++i) {
corner_to_vertex_map_[i] = corner_table_->Vertex(i); corner_to_vertex_map_[i] = corner_table_->Vertex(i);

View File

@ -22,7 +22,7 @@
namespace draco { namespace draco {
// Abstract base class for all point cloud and mesh decoders. It provides a // Abstract base class for all point cloud and mesh decoders. It provides a
// basic funcionality that is shared between different decoders. // basic functionality that is shared between different decoders.
class PointCloudDecoder { class PointCloudDecoder {
public: public:
PointCloudDecoder(); PointCloudDecoder();
@ -30,7 +30,7 @@ class PointCloudDecoder {
virtual EncodedGeometryType GetGeometryType() const { return POINT_CLOUD; } virtual EncodedGeometryType GetGeometryType() const { return POINT_CLOUD; }
// Decodes a Draco header int othe provided |out_header|. // Decodes a Draco header int other provided |out_header|.
// Returns false on error. // Returns false on error.
static bool DecodeHeader(DecoderBuffer *buffer, DracoHeader *out_header); static bool DecodeHeader(DecoderBuffer *buffer, DracoHeader *out_header);

View File

@ -153,7 +153,7 @@ bool PointCloudEncoder::RearrangeAttributesEncoders() {
// Find the encoding order of the attribute encoders that is determined by // Find the encoding order of the attribute encoders that is determined by
// the parent dependencies between individual encoders. Instead of traversing // the parent dependencies between individual encoders. Instead of traversing
// a graph we encode the attributes in multiple iterations where encoding of // a graph we encode the attributes in multiple iterations where encoding of
// attributes that depend on other attributes may get posponed until the // attributes that depend on other attributes may get postponed until the
// parent attributes are processed. // parent attributes are processed.
// This is simpler to implement than graph traversal and it automatically // This is simpler to implement than graph traversal and it automatically
// detects any cycles in the dependency graph. // detects any cycles in the dependency graph.

View File

@ -24,7 +24,7 @@
namespace draco { namespace draco {
// Abstract base class for all point cloud and mesh encoders. It provides a // Abstract base class for all point cloud and mesh encoders. It provides a
// basic funcionality that's shared between different encoders. // basic functionality that's shared between different encoders.
class PointCloudEncoder { class PointCloudEncoder {
public: public:
PointCloudEncoder(); PointCloudEncoder();

View File

@ -30,7 +30,7 @@ inline uint8_t clamp_probability(double p) {
return static_cast<uint8_t>(p_int); return static_cast<uint8_t>(p_int);
} }
// Update the probablity according to new incoming bit. // Update the probability according to new incoming bit.
inline double update_probability(double old_p, bool bit) { inline double update_probability(double old_p, bool bit) {
static constexpr double w = 128.0; static constexpr double w = 128.0;
static constexpr double w0 = (w - 1.0) / w; static constexpr double w0 = (w - 1.0) / w;

View File

@ -33,7 +33,7 @@ class AdaptiveRAnsBitDecoder {
// Sets |source_buffer| as the buffer to decode bits from. // Sets |source_buffer| as the buffer to decode bits from.
bool StartDecoding(DecoderBuffer *source_buffer); bool StartDecoding(DecoderBuffer *source_buffer);
// Decode one bit. Returns true if the bit is a 1, otherwsie false. // Decode one bit. Returns true if the bit is a 1, otherwise false.
bool DecodeNextBit(); bool DecodeNextBit();
// Decode the next |nbits| and return the sequence in |value|. |nbits| must be // Decode the next |nbits| and return the sequence in |value|. |nbits| must be

View File

@ -30,7 +30,7 @@ void AdaptiveRAnsBitEncoder::EndEncoding(EncoderBuffer *target_buffer) {
AnsCoder ans_coder; AnsCoder ans_coder;
ans_write_init(&ans_coder, buffer.data()); ans_write_init(&ans_coder, buffer.data());
// Unfortunaetly we have to encode the bits in reversed order, while the // Unfortunately we have to encode the bits in reversed order, while the
// probabilities that should be given are those of the forward sequence. // probabilities that should be given are those of the forward sequence.
double p0_f = 0.5; double p0_f = 0.5;
std::vector<uint8_t> p0s; std::vector<uint8_t> p0s;

View File

@ -50,7 +50,7 @@ inline void CopyBits32(uint32_t *dst, int dst_offset, uint32_t src,
// Returns the most location of the most significant bit in the input integer // Returns the most location of the most significant bit in the input integer
// |n|. // |n|.
// The funcionality is not defined for |n == 0|. // The functionality is not defined for |n == 0|.
inline int MostSignificantBit(uint32_t n) { inline int MostSignificantBit(uint32_t n) {
#if defined(__GNUC__) #if defined(__GNUC__)
return 31 ^ __builtin_clz(n); return 31 ^ __builtin_clz(n);

View File

@ -33,7 +33,7 @@ class DecoderBuffer {
DecoderBuffer &operator=(const DecoderBuffer &buf) = default; DecoderBuffer &operator=(const DecoderBuffer &buf) = default;
// Sets the buffer's internal data. Note that no copy of the input data is // Sets the buffer's internal data. Note that no copy of the input data is
// made so the data owner needs to keep the data valid and unchaged for // made so the data owner needs to keep the data valid and unchanged for
// runtime of the decoder. // runtime of the decoder.
void Init(const char *data, size_t data_size); void Init(const char *data, size_t data_size);
@ -48,7 +48,7 @@ class DecoderBuffer {
void EndBitDecoding(); void EndBitDecoding();
// Decodes up to 32 bits into out_val. Can be called only in between // Decodes up to 32 bits into out_val. Can be called only in between
// StartBitDecoding and EndBitDeoding. Otherwise returns false. // StartBitDecoding and EndBitDecoding. Otherwise returns false.
bool DecodeLeastSignificantBits32(int nbits, uint32_t *out_value) { bool DecodeLeastSignificantBits32(int nbits, uint32_t *out_value) {
if (!bit_decoder_active()) if (!bit_decoder_active())
return false; return false;
@ -95,7 +95,7 @@ class DecoderBuffer {
// Discards #bytes from the input buffer. // Discards #bytes from the input buffer.
void Advance(int64_t bytes) { pos_ += bytes; } void Advance(int64_t bytes) { pos_ += bytes; }
// Moves the parsing position to a specific offset from the beggining of the // Moves the parsing position to a specific offset from the beginning of the
// input data. // input data.
void StartDecodingFrom(int64_t offset) { pos_ = offset; } void StartDecodingFrom(int64_t offset) { pos_ = offset; }

View File

@ -30,7 +30,7 @@ class DirectBitDecoder {
// Sets |source_buffer| as the buffer to decode bits from. // Sets |source_buffer| as the buffer to decode bits from.
bool StartDecoding(DecoderBuffer *source_buffer); bool StartDecoding(DecoderBuffer *source_buffer);
// Decode one bit. Returns true if the bit is a 1, otherwsie false. // Decode one bit. Returns true if the bit is a 1, otherwise false.
bool DecodeNextBit() { bool DecodeNextBit() {
const uint32_t selector = 1 << (31 - num_used_bits_); const uint32_t selector = 1 << (31 - num_used_bits_);
const bool bit = *pos_ & selector; const bool bit = *pos_ & selector;

View File

@ -45,7 +45,7 @@
// //
// Strongly typed indices support most of the common binary and unary // Strongly typed indices support most of the common binary and unary
// operators and support for additional operators can be added if // operators and support for additional operators can be added if
// necesssary. // necessary.
#ifndef DRACO_CORE_DRACO_INDEX_TYPE_H_ #ifndef DRACO_CORE_DRACO_INDEX_TYPE_H_
#define DRACO_CORE_DRACO_INDEX_TYPE_H_ #define DRACO_CORE_DRACO_INDEX_TYPE_H_
@ -166,7 +166,7 @@ std::ostream &operator<<(std::ostream &os, IndexType<ValueTypeT, TagT> index) {
} // namespace draco } // namespace draco
// Specialize std::hash for the stongly indexed types. // Specialize std::hash for the strongly indexed types.
namespace std { namespace std {
template <class ValueTypeT, class TagT> template <class ValueTypeT, class TagT>

View File

@ -23,7 +23,7 @@
namespace draco { namespace draco {
// Class representing a buffer that can be used for either for byte-aligned // Class representing a buffer that can be used for either for byte-aligned
// encoding of arbitrary data structures or for encoding of varialble-length // encoding of arbitrary data structures or for encoding of variable-length
// bit data. // bit data.
class EncoderBuffer { class EncoderBuffer {
public: public:

View File

@ -33,7 +33,7 @@ class RAnsBitDecoder {
// Returns false when the data is invalid. // Returns false when the data is invalid.
bool StartDecoding(DecoderBuffer *source_buffer); bool StartDecoding(DecoderBuffer *source_buffer);
// Decode one bit. Returns true if the bit is a 1, otherwsie false. // Decode one bit. Returns true if the bit is a 1, otherwise false.
bool DecodeNextBit(); bool DecodeNextBit();
// Decode the next |nbits| and return the sequence in |value|. |nbits| must be // Decode the next |nbits| and return the sequence in |value|. |nbits| must be

View File

@ -16,7 +16,7 @@ class SymbolBitDecoder {
// Sets |source_buffer| as the buffer to decode bits from. // Sets |source_buffer| as the buffer to decode bits from.
bool StartDecoding(DecoderBuffer *source_buffer); bool StartDecoding(DecoderBuffer *source_buffer);
// Decode one bit. Returns true if the bit is a 1, otherwsie false. // Decode one bit. Returns true if the bit is a 1, otherwise false.
bool DecodeNextBit(); bool DecodeNextBit();
// Decode the next |nbits| and return the sequence in |value|. |nbits| must be // Decode the next |nbits| and return the sequence in |value|. |nbits| must be

View File

@ -179,7 +179,7 @@ CoeffT SquaredDistance(const VectorD<CoeffT, dimension_t> v1,
const VectorD<CoeffT, dimension_t> v2) { const VectorD<CoeffT, dimension_t> v2) {
CoeffT difference; CoeffT difference;
CoeffT squared_distance = 0; CoeffT squared_distance = 0;
// Check each index seperately so difference is never negative and underflow // Check each index separately so difference is never negative and underflow
// is avoided for unsigned types. // is avoided for unsigned types.
for (int i = 0; i < dimension_t; ++i) { for (int i = 0; i < dimension_t; ++i) {
if (v1[i] >= v2[i]) { if (v1[i] >= v2[i]) {

View File

@ -356,7 +356,7 @@ bool ObjDecoder::ParseFace(bool *error) {
++num_obj_faces_; ++num_obj_faces_;
} }
} else { } else {
// We are in the couting mode. // We are in the counting mode.
// We need to determine how many triangles are in the obj face. // We need to determine how many triangles are in the obj face.
// Go over the line and check how many gaps there are between non-empty // Go over the line and check how many gaps there are between non-empty
// sub-strings. // sub-strings.

View File

@ -41,7 +41,7 @@ class ObjDecoder {
bool DecodeFromBuffer(DecoderBuffer *buffer, PointCloud *out_point_cloud); bool DecodeFromBuffer(DecoderBuffer *buffer, PointCloud *out_point_cloud);
// Flag that can be used to turn on/off deduplication of input values. // Flag that can be used to turn on/off deduplication of input values.
// This should be disabled only when we are sure that the input data doesn not // This should be disabled only when we are sure that the input data does not
// contain any duplicate entries. // contain any duplicate entries.
// Default: true // Default: true
void set_deduplicate_input_values(bool v) { deduplicate_input_values_ = v; } void set_deduplicate_input_values(bool v) { deduplicate_input_values_ = v; }

View File

@ -30,7 +30,7 @@ bool ObjEncoder::EncodeToFile(const PointCloud &pc,
const std::string &file_name) { const std::string &file_name) {
std::ofstream file(file_name); std::ofstream file(file_name);
if (!file) if (!file)
return false; // File coulnd't be opened. return false; // File could not be opened.
// Encode the mesh into a buffer. // Encode the mesh into a buffer.
EncoderBuffer buffer; EncoderBuffer buffer;
if (!EncodeToBuffer(pc, &buffer)) if (!EncodeToBuffer(pc, &buffer))

View File

@ -26,7 +26,7 @@ bool PlyEncoder::EncodeToFile(const PointCloud &pc,
const std::string &file_name) { const std::string &file_name) {
std::ofstream file(file_name, std::ios::binary); std::ofstream file(file_name, std::ios::binary);
if (!file) if (!file)
return false; // File coulnd't be opened. return false; // File couldn't be opened.
// Encode the mesh into a buffer. // Encode the mesh into a buffer.
EncoderBuffer buffer; EncoderBuffer buffer;
if (!EncodeToBuffer(pc, &buffer)) if (!EncodeToBuffer(pc, &buffer))

View File

@ -53,7 +53,7 @@ class CornerTable {
const IndexTypeVector<FaceIndex, FaceType> &faces); const IndexTypeVector<FaceIndex, FaceType> &faces);
// Initializes the CornerTable from provides set of indexed faces. // Initializes the CornerTable from provides set of indexed faces.
// The input faces can represent a non-manifold topolgy, in which case the // The input faces can represent a non-manifold topology, in which case the
// non-manifold edges and vertices are going to be split. // non-manifold edges and vertices are going to be split.
bool Initialize(const IndexTypeVector<FaceIndex, FaceType> &faces); bool Initialize(const IndexTypeVector<FaceIndex, FaceType> &faces);
@ -157,7 +157,7 @@ class CornerTable {
return Next(Opposite(Next(corner))); return Next(Opposite(Next(corner)));
} }
// Get opposite corners on the left and right faces respecitively (see image // Get opposite corners on the left and right faces respectively (see image
// below, where L and R are the left and right corners of a corner X. // below, where L and R are the left and right corners of a corner X.
// //
// *-------*-------* // *-------*-------*
@ -177,7 +177,7 @@ class CornerTable {
} }
// Returns the number of new vertices that were created as a result of // Returns the number of new vertices that were created as a result of
// spliting of non-manifold vertices of the input geometry. // splitting of non-manifold vertices of the input geometry.
int NumNewVertices() const { return num_vertices() - num_original_vertices_; } int NumNewVertices() const { return num_vertices() - num_original_vertices_; }
int NumOriginalVertices() const { return num_original_vertices_; } int NumOriginalVertices() const { return num_original_vertices_; }
@ -206,7 +206,7 @@ class CornerTable {
SetOppositeCorner(corner_1, corner_0); SetOppositeCorner(corner_1, corner_0);
} }
// Updates mapping betweeh a corner and a vertex. // Updates mapping between a corner and a vertex.
inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) { inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
const FaceIndex face = Face(corner_id); const FaceIndex face = Face(corner_id);
faces_[face][LocalIndex(corner_id)] = vert_id; faces_[face][LocalIndex(corner_id)] = vert_id;
@ -284,7 +284,7 @@ class CornerTable {
bool ComputeOppositeCorners(int *num_vertices); bool ComputeOppositeCorners(int *num_vertices);
// Computes the lookup map for going from a vertex to a corner. This method // Computes the lookup map for going from a vertex to a corner. This method
// can handle non-manifold vertices by spliting them into multiple manifold // can handle non-manifold vertices by splitting them into multiple manifold
// vertices. // vertices.
bool ComputeVertexCorners(int num_vertices); bool ComputeVertexCorners(int num_vertices);
@ -412,7 +412,7 @@ class FaceAdjacencyIterator
// Returns true when all adjacent faces have been visited. // Returns true when all adjacent faces have been visited.
bool End() const { return corner_ < 0; } bool End() const { return corner_ < 0; }
// Proceeds to the next adjacen face if possible. // Proceeds to the next adjacent face if possible.
void Next() { FindNextFaceNeighbor(); } void Next() { FindNextFaceNeighbor(); }
// std::iterator interface. // std::iterator interface.

View File

@ -19,7 +19,7 @@
namespace draco { namespace draco {
// Class providing the basic traversal funcionality needed by traversers (such // Class providing the basic traversal functionality needed by traverses (such
// as the EdgeBreakerTraverser, see edgebreaker_traverser.h). It is used to // as the EdgeBreakerTraverser, see edgebreaker_traverser.h). It is used to
// return the corner table that is used for the traversal, plus it provides a // return the corner table that is used for the traversal, plus it provides a
// basic book-keeping of visited faces and vertices during the traversal. // basic book-keeping of visited faces and vertices during the traversal.

View File

@ -27,7 +27,7 @@ namespace draco {
// arguments TraversalProcessorT, TraversalObserverT and EdgeBreakerObserverT. // arguments TraversalProcessorT, TraversalObserverT and EdgeBreakerObserverT.
// TraversalProcessorT is used to provide infrastructure for handling of visited // TraversalProcessorT is used to provide infrastructure for handling of visited
// vertices and faces, TraversalObserverT can be used to implement custom // vertices and faces, TraversalObserverT can be used to implement custom
// callbacks for varous traversal events, and EdgeBreakerObserverT can be used // callbacks for various traversal events, and EdgeBreakerObserverT can be used
// to provide handling of edgebreaker symbols. // to provide handling of edgebreaker symbols.
// TraversalProcessorT needs to define the type of the corner table as: // TraversalProcessorT needs to define the type of the corner table as:
// //

View File

@ -55,7 +55,7 @@ class Mesh : public PointCloud {
} }
// Sets the total number of faces. Creates new empty faces or deletes // Sets the total number of faces. Creates new empty faces or deletes
// existings ones if necessary. // existing ones if necessary.
void SetNumFaces(size_t num_faces) { faces_.resize(num_faces, Face()); } void SetNumFaces(size_t num_faces) { faces_.resize(num_faces, Face()); }
FaceIndex::ValueType num_faces() const { return faces_.size(); } FaceIndex::ValueType num_faces() const { return faces_.size(); }

View File

@ -135,7 +135,7 @@ bool MeshAreEquivalent::operator()(const Mesh &mesh0, const Mesh &mesh1) {
DCHECK(att0->IsValid()); DCHECK(att0->IsValid());
DCHECK(att1->IsValid()); DCHECK(att1->IsValid());
// Prepare blocks of memomry to hold data of corners for this attribute. // Prepare blocks of memory to hold data of corners for this attribute.
std::unique_ptr<uint8_t[]> data0(new uint8_t[att0->byte_stride()]); std::unique_ptr<uint8_t[]> data0(new uint8_t[att0->byte_stride()]);
std::unique_ptr<uint8_t[]> data1(new uint8_t[att0->byte_stride()]); std::unique_ptr<uint8_t[]> data1(new uint8_t[att0->byte_stride()]);

View File

@ -22,7 +22,7 @@ namespace draco {
// Class for storing connectivity of mesh attributes. The connectivity is stored // Class for storing connectivity of mesh attributes. The connectivity is stored
// as a difference from the base mesh's corner table, where the differences are // as a difference from the base mesh's corner table, where the differences are
// represnted by attribute seam edges. This class provides a basic funcionality // represented by attribute seam edges. This class provides a basic functionality
// for detecting the seam edges for a given attribute and for traversing the // for detecting the seam edges for a given attribute and for traversing the
// constrained corner table with the seam edges. // constrained corner table with the seam edges.
class MeshAttributeCornerTable { class MeshAttributeCornerTable {
@ -122,7 +122,7 @@ class MeshAttributeCornerTable {
std::vector<VertexIndex> corner_to_vertex_map_; std::vector<VertexIndex> corner_to_vertex_map_;
// Map between vertices and their associated left most corners. A left most // Map between vertices and their associated left most corners. A left most
// corner is a corner that is adjecent to a boundary or an attribute seam from // corner is a corner that is adjacent to a boundary or an attribute seam from
// right (i.e., SwingLeft from that corner will return an invalid corner). If // right (i.e., SwingLeft from that corner will return an invalid corner). If
// no such corner exists for a given vertex, then any corner attached to the // no such corner exists for a given vertex, then any corner attached to the
// vertex can be used. // vertex can be used.

View File

@ -162,7 +162,7 @@ bool MeshCleanup::operator()(Mesh *mesh, const MeshCleanupOptions &options) {
const PointIndex new_point_id = point_map[i]; const PointIndex new_point_id = point_map[i];
if (new_point_id < 0) if (new_point_id < 0)
continue; continue;
// Index of the currenlty processed attribut entry in the original // Index of the currently processed attribute entry in the original
// mesh. // mesh.
const AttributeValueIndex original_entry_index = const AttributeValueIndex original_entry_index =
att->mapped_index(i); att->mapped_index(i);

View File

@ -157,14 +157,14 @@ class GeometryAttribute {
// Returns the type of the attribute indicating the nature of the attribute. // Returns the type of the attribute indicating the nature of the attribute.
Type attribute_type() const { return attribute_type_; } Type attribute_type() const { return attribute_type_; }
void set_attribute_type(Type type) { attribute_type_ = type; } void set_attribute_type(Type type) { attribute_type_ = type; }
// Retruns the data type that is stored in the attrbute. // Returns the data type that is stored in the attribute.
DataType data_type() const { return data_type_; } DataType data_type() const { return data_type_; }
// Returns the number of components that are stored for each entry. // Returns the number of components that are stored for each entry.
// For position attrinute this is usually three (x,y,z), // For position attribute this is usually three (x,y,z),
// while texture coordinates have two compontents (u,v). // while texture coordinates have two components (u,v).
int8_t components_count() const { return components_count_; } int8_t components_count() const { return components_count_; }
// Indicates whether the data type should be normalized before interpretation, // Indicates whether the data type should be normalized before interpretation,
// that is, it should be devided by the max value of the data type. // that is, it should be divided by the max value of the data type.
bool normalized() const { return normalized_; } bool normalized() const { return normalized_; }
// The buffer storing the entire data of the attribute. // The buffer storing the entire data of the attribute.
const DataBuffer *buffer() const { return buffer_; } const DataBuffer *buffer() const { return buffer_; }
@ -219,7 +219,7 @@ class GeometryAttribute {
// The same as above but without a component specifier for input attribute. // The same as above but without a component specifier for input attribute.
template <typename T, typename OutT, int OUT_CMPS> template <typename T, typename OutT, int OUT_CMPS>
bool ConvertTypedValue(AttributeValueIndex att_index, OutT *out_value) const { bool ConvertTypedValue(AttributeValueIndex att_index, OutT *out_value) const {
// Selecte the right method to call based on the number of attribute // Select the right method to call based on the number of attribute
// components. // components.
switch (components_count_) { switch (components_count_) {
case 1: case 1:

View File

@ -81,7 +81,7 @@ AttributeValueIndex::ValueType PointAttribute::DeduplicateValues(
return -1; // Unsupported data type. return -1; // Unsupported data type.
} }
if (unique_vals == 0) if (unique_vals == 0)
return -1; // Unexcpected error. return -1; // Unexpected error.
return unique_vals; return unique_vals;
} }

View File

@ -169,7 +169,7 @@ void PointCloud::ApplyPointIdDeduplication(
bool PointCloud::DeduplicateAttributeValues() { bool PointCloud::DeduplicateAttributeValues() {
// Go over all attributes and create mapping between duplicate entries. // Go over all attributes and create mapping between duplicate entries.
if (num_points() == 0) if (num_points() == 0)
return false; // Unexcpected attribute size. return false; // Unexpected attribute size.
// Deduplicate all attributes. // Deduplicate all attributes.
for (int32_t att_id = 0; att_id < num_attributes(); ++att_id) { for (int32_t att_id = 0; att_id < num_attributes(); ++att_id) {
if (!attribute(att_id)->DeduplicateValues(*attribute(att_id))) if (!attribute(att_id)->DeduplicateValues(*attribute(att_id)))

View File

@ -140,7 +140,7 @@ TEST_F(PointCloudBuilderTest, MultiUse) {
} }
{ {
// Use only a sub-set of data (offseted to avoid possible reuse of old // Use only a sub-set of data (offsetted to avoid possible reuse of old
// data). // data).
builder.Start(4); builder.Start(4);
const int pos_att_id = const int pos_att_id =