From a55221407e3dc12e97fee99d44fbe3ca84417a08 Mon Sep 17 00:00:00 2001 From: Frank Galligan Date: Fri, 13 Oct 2017 15:50:38 -0700 Subject: [PATCH] Spec clean up - This addresses some comments in KhronosGroup/glTF#1114 --- docs/spec/04.00.00.conventions.md | 1 + docs/spec/edgebreaker.decoder.md | 4 ++-- docs/spec/prediction.multi.parallelogram.decoder.md | 2 +- docs/spec/prediction.parallelogram.decoder.md | 6 +++--- docs/spec/prediction.wrap.transform.md | 2 +- docs/spec/rans.decoding.md | 11 ----------- 6 files changed, 8 insertions(+), 18 deletions(-) diff --git a/docs/spec/04.00.00.conventions.md b/docs/spec/04.00.00.conventions.md index 9b238fa..1935c41 100644 --- a/docs/spec/04.00.00.conventions.md +++ b/docs/spec/04.00.00.conventions.md @@ -93,6 +93,7 @@ When a variable is said to be representable by a signed integer with `x` bits, it means that the variable is greater than or equal to `-(1 << (x-1))`, and that the variable is less than or equal to `(1 << (x-1))-1`. +The function ReadBits(X), reads the next X bits from an array. ### Arithmetic operators diff --git a/docs/spec/edgebreaker.decoder.md b/docs/spec/edgebreaker.decoder.md index 431d7ad..59a3d72 100644 --- a/docs/spec/edgebreaker.decoder.md +++ b/docs/spec/edgebreaker.decoder.md @@ -304,10 +304,10 @@ void NewActiveCornerReached(new_corner, symbol_id) { ~~~~~ void ParseEdgebreakerStandardSymbol() { - bit_symbol_buffer.DecodeLeastSignificantBits32(1, &symbol); + symbol = bit_symbol_buffer.ReadBits32(1); if (symbol != TOPOLOGY_C) { // Else decode two additional bits. - bit_symbol_buffer.DecodeLeastSignificantBits32(2, &symbol_suffix); + symbol_suffix = bit_symbol_buffer.ReadBits(2); symbol |= (symbol_suffix << 1); } last_symbol_ = symbol; diff --git a/docs/spec/prediction.multi.parallelogram.decoder.md b/docs/spec/prediction.multi.parallelogram.decoder.md index 48e1ed6..f7289e1 100644 --- a/docs/spec/prediction.multi.parallelogram.decoder.md +++ b/docs/spec/prediction.multi.parallelogram.decoder.md @@ -13,7 +13,7 @@ void MeshPredictionSchemeConstrainedMultiParallelogramDecoder_ComputeOriginalVal out_values = signed_values; PredictionSchemeTransform_ComputeOriginalValue( pred_vals[0].data(), &signed_values[0], &out_values[0]); - is_crease_edge_pos(kMaxNumParallelograms, 0); + is_crease_edge_pos.assign(kMaxNumParallelograms, 0); corner_map_size = num_values; for (p = 1; p < corner_map_size; ++p) { start_corner_id = encoded_attribute_value_index_to_corner_map[curr_att_dec][p]; diff --git a/docs/spec/prediction.parallelogram.decoder.md b/docs/spec/prediction.parallelogram.decoder.md index d035a07..44185a7 100644 --- a/docs/spec/prediction.parallelogram.decoder.md +++ b/docs/spec/prediction.parallelogram.decoder.md @@ -47,21 +47,21 @@ void MeshPredictionSchemeParallelogramDecoder_ComputeOriginalValues(num_values) signed_values = seq_int_att_dec_symbols_to_signed_ints[curr_att_dec][curr_att]; num_components = GetNumComponents(); out_values = signed_values; - PredictionSchemeWrapDecodingTransform_ComputeOriginalValue(pred_vals.get(), + PredictionSchemeWrapDecodingTransform_ComputeOriginalValue(pred_vals, &signed_values[0], &out_values[0]); corner_map_size = num_values; for (p = 1; p < corner_map_size; ++p) { corner_id = encoded_attribute_value_index_to_corner_map[curr_att_dec][p]; dst_offset = p * num_components; if (!ComputeParallelogramPrediction(p, corner_id, &out_values[0], - num_components, pred_vals.get())) { + num_components, pred_vals)) { src_offset = (p - 1) * num_components; PredictionSchemeWrapDecodingTransform_ComputeOriginalValue( &out_values[src_offset], &signed_values[dst_offset], &out_values[dst_offset]); } else { PredictionSchemeWrapDecodingTransform_ComputeOriginalValue( - pred_vals.get(), &signed_values[dst_offset], &out_values[dst_offset]); + pred_vals, &signed_values[dst_offset], &out_values[dst_offset]); } } seq_int_att_dec_original_values[curr_att_dec][curr_att] = out_values; diff --git a/docs/spec/prediction.wrap.transform.md b/docs/spec/prediction.wrap.transform.md index 9019ad6..58f1224 100644 --- a/docs/spec/prediction.wrap.transform.md +++ b/docs/spec/prediction.wrap.transform.md @@ -31,7 +31,7 @@ void PredictionSchemeWrapDecodingTransform_ComputeOriginalValue( max = pred_trasnform_wrap_max[curr_att_dec][curr_att]; max_dif_ = 1 + max - min; PredictionSchemeWrapTransformBase_ClampPredictedValue(predicted_vals, - clamped_vals.get()); + clamped_vals); for (i = 0; i < num_components; ++i) { out_original_vals[i] = clamped_vals[i] + corr_vals[i]; if (out_original_vals[i] > max) diff --git a/docs/spec/rans.decoding.md b/docs/spec/rans.decoding.md index 911c5de..5850c77 100644 --- a/docs/spec/rans.decoding.md +++ b/docs/spec/rans.decoding.md @@ -16,17 +16,6 @@ void DecodeSymbols(num_symbols, num_components, out_values) { {:.draco-syntax } -### DecodeSymbols - -~~~~~ -void ReadEncodedData(bytes_encoded, buffer) { - bytes_encoded varUI64 - buffer UI8[size] -} -~~~~~ -{:.draco-syntax } - - ### ComputeRAnsUnclampedPrecision ~~~~~