GorillaStream.Compression.Decoder.ValueDecompression
(gorilla_stream v3.0.3)
Copy Markdown
View Source
XOR-based value decompression for floating-point values in the Gorilla algorithm.
This module reverses the XOR-based compression process to reconstruct the original floating-point values from the compressed bitstream.
The decoding process:
- Read the first value (64 bits)
- For subsequent values:
- '0' bit: value is identical to previous
- '10' + meaningful bits: use previous window for meaningful bits
- '11' + 5 bits leading + 6 bits length + meaningful bits: use new window
This decoding efficiently reconstructs slowly changing floating-point time series data.
Summary
Functions
Decompresses value bitstream back into a list of float values.
Decompresses values and validates they match expected characteristics.
Gets information about a value bitstream without full decompression.
Validates that a value bitstream can be properly decompressed.
Functions
Decompresses value bitstream back into a list of float values.
Parameters
value_bits: Bitstream containing encoded valuesmetadata: Metadata containing count and first value info
Returns
{:ok, values}: List of decoded float values{:error, reason}: If decompression fails
Decompresses values and validates they match expected characteristics.
Parameters
value_bits: Bitstream containing encoded valuesmetadata: Metadata with expected characteristicsvalidation_opts: Optional validation parameters
Returns
{:ok, {values, stats}}: Decompressed values and statistics{:error, reason}: If decompression or validation fails
Gets information about a value bitstream without full decompression.
Parameters
value_bits: Bitstream to analyzemetadata: Metadata with count and first value information
Returns
{:ok, info}with basic information, or{:error, reason}
Validates that a value bitstream can be properly decompressed.
Parameters
value_bits: Bitstream to validateexpected_count: Expected number of values
Returns
:okif valid,{:error, reason}if invalid