mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-06-21 00:43:26 +08:00
commit
8008503278
@ -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
|
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 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
|
### Arithmetic operators
|
||||||
|
|
||||||
|
@ -304,10 +304,10 @@ void NewActiveCornerReached(new_corner, symbol_id) {
|
|||||||
|
|
||||||
~~~~~
|
~~~~~
|
||||||
void ParseEdgebreakerStandardSymbol() {
|
void ParseEdgebreakerStandardSymbol() {
|
||||||
bit_symbol_buffer.DecodeLeastSignificantBits32(1, &symbol);
|
symbol = bit_symbol_buffer.ReadBits32(1);
|
||||||
if (symbol != TOPOLOGY_C) {
|
if (symbol != TOPOLOGY_C) {
|
||||||
// Else decode two additional bits.
|
// Else decode two additional bits.
|
||||||
bit_symbol_buffer.DecodeLeastSignificantBits32(2, &symbol_suffix);
|
symbol_suffix = bit_symbol_buffer.ReadBits(2);
|
||||||
symbol |= (symbol_suffix << 1);
|
symbol |= (symbol_suffix << 1);
|
||||||
}
|
}
|
||||||
last_symbol_ = symbol;
|
last_symbol_ = symbol;
|
||||||
|
@ -13,7 +13,7 @@ void MeshPredictionSchemeConstrainedMultiParallelogramDecoder_ComputeOriginalVal
|
|||||||
out_values = signed_values;
|
out_values = signed_values;
|
||||||
PredictionSchemeTransform_ComputeOriginalValue(
|
PredictionSchemeTransform_ComputeOriginalValue(
|
||||||
pred_vals[0].data(), &signed_values[0], &out_values[0]);
|
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;
|
corner_map_size = num_values;
|
||||||
for (p = 1; p < corner_map_size; ++p) {
|
for (p = 1; p < corner_map_size; ++p) {
|
||||||
start_corner_id = encoded_attribute_value_index_to_corner_map[curr_att_dec][p];
|
start_corner_id = encoded_attribute_value_index_to_corner_map[curr_att_dec][p];
|
||||||
|
@ -47,21 +47,21 @@ void MeshPredictionSchemeParallelogramDecoder_ComputeOriginalValues(num_values)
|
|||||||
signed_values = seq_int_att_dec_symbols_to_signed_ints[curr_att_dec][curr_att];
|
signed_values = seq_int_att_dec_symbols_to_signed_ints[curr_att_dec][curr_att];
|
||||||
num_components = GetNumComponents();
|
num_components = GetNumComponents();
|
||||||
out_values = signed_values;
|
out_values = signed_values;
|
||||||
PredictionSchemeWrapDecodingTransform_ComputeOriginalValue(pred_vals.get(),
|
PredictionSchemeWrapDecodingTransform_ComputeOriginalValue(pred_vals,
|
||||||
&signed_values[0], &out_values[0]);
|
&signed_values[0], &out_values[0]);
|
||||||
corner_map_size = num_values;
|
corner_map_size = num_values;
|
||||||
for (p = 1; p < corner_map_size; ++p) {
|
for (p = 1; p < corner_map_size; ++p) {
|
||||||
corner_id = encoded_attribute_value_index_to_corner_map[curr_att_dec][p];
|
corner_id = encoded_attribute_value_index_to_corner_map[curr_att_dec][p];
|
||||||
dst_offset = p * num_components;
|
dst_offset = p * num_components;
|
||||||
if (!ComputeParallelogramPrediction(p, corner_id, &out_values[0],
|
if (!ComputeParallelogramPrediction(p, corner_id, &out_values[0],
|
||||||
num_components, pred_vals.get())) {
|
num_components, pred_vals)) {
|
||||||
src_offset = (p - 1) * num_components;
|
src_offset = (p - 1) * num_components;
|
||||||
PredictionSchemeWrapDecodingTransform_ComputeOriginalValue(
|
PredictionSchemeWrapDecodingTransform_ComputeOriginalValue(
|
||||||
&out_values[src_offset], &signed_values[dst_offset],
|
&out_values[src_offset], &signed_values[dst_offset],
|
||||||
&out_values[dst_offset]);
|
&out_values[dst_offset]);
|
||||||
} else {
|
} else {
|
||||||
PredictionSchemeWrapDecodingTransform_ComputeOriginalValue(
|
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;
|
seq_int_att_dec_original_values[curr_att_dec][curr_att] = out_values;
|
||||||
|
@ -31,7 +31,7 @@ void PredictionSchemeWrapDecodingTransform_ComputeOriginalValue(
|
|||||||
max = pred_trasnform_wrap_max[curr_att_dec][curr_att];
|
max = pred_trasnform_wrap_max[curr_att_dec][curr_att];
|
||||||
max_dif_ = 1 + max - min;
|
max_dif_ = 1 + max - min;
|
||||||
PredictionSchemeWrapTransformBase_ClampPredictedValue(predicted_vals,
|
PredictionSchemeWrapTransformBase_ClampPredictedValue(predicted_vals,
|
||||||
clamped_vals.get());
|
clamped_vals);
|
||||||
for (i = 0; i < num_components; ++i) {
|
for (i = 0; i < num_components; ++i) {
|
||||||
out_original_vals[i] = clamped_vals[i] + corr_vals[i];
|
out_original_vals[i] = clamped_vals[i] + corr_vals[i];
|
||||||
if (out_original_vals[i] > max)
|
if (out_original_vals[i] > max)
|
||||||
|
@ -16,17 +16,6 @@ void DecodeSymbols(num_symbols, num_components, out_values) {
|
|||||||
{:.draco-syntax }
|
{:.draco-syntax }
|
||||||
|
|
||||||
|
|
||||||
### DecodeSymbols
|
|
||||||
|
|
||||||
~~~~~
|
|
||||||
void ReadEncodedData(bytes_encoded, buffer) {
|
|
||||||
bytes_encoded varUI64
|
|
||||||
buffer UI8[size]
|
|
||||||
}
|
|
||||||
~~~~~
|
|
||||||
{:.draco-syntax }
|
|
||||||
|
|
||||||
|
|
||||||
### ComputeRAnsUnclampedPrecision
|
### ComputeRAnsUnclampedPrecision
|
||||||
|
|
||||||
~~~~~
|
~~~~~
|
||||||
|
Loading…
x
Reference in New Issue
Block a user