Elias gamma encoding using bit-by-bit encoding and decoding (slow)
More...
#include <compress_integer_elias_gamma_bitwise.h>
|
|
static void | unittest (void) |
| | Unit test this class.
|
| |
| static size_t | d1_encode (integer *encoded, const integer *source, size_t source_integers) |
| | Convert an array of integers into an array of D1 (delta, d-gap) encoded integers. More...
|
| |
| static size_t | d1_decode (integer *decoded, const integer *source, size_t source_integers) |
| | Convert a D1 encoded array of integers into an array of integers. More...
|
| |
| static size_t | dn_encode (integer *encoded, const integer *source, size_t source_integers, size_t n=1) |
| | Convert an array of integers into an array of Dn (delta, d-gap) encoded integers with a gap of n. More...
|
| |
| static size_t | dn_decode (integer *decoded, const integer *source, size_t source_integers, size_t n=1) |
| | Convert a Dn encoded array of integers into an array of integers. More...
|
| |
| static void | unittest_one (compress_integer &encoder, const std::vector< uint32_t > &sequence) |
| | Test one sequence to make sure it encodes and decodes to the same thing. Assert if not. More...
|
| |
| static void | unittest (compress_integer &compressor, uint32_t staring_from=0) |
| | Unit test this class, assert on failure. More...
|
| |
|
|
typedef uint32_t | integer |
| | This class and descendants will work on integers of this size. Do not change without also changing JASS_COMPRESS_INTEGER_BITS_PER_INTEGER.
|
| |
Elias gamma encoding using bit-by-bit encoding and decoding (slow)
◆ decode() [1/2]
| integer JASS::compress_integer_elias_gamma_bitwise::decode |
( |
void |
| ) |
|
|
inlineprotected |
Decode (and pull) one integer from the stream.
- Returns
- The next integer in the stream
◆ decode() [2/2]
| virtual void JASS::compress_integer_elias_gamma_bitwise::decode |
( |
integer * |
decoded, |
|
|
size_t |
integers_to_decode, |
|
|
const void * |
source, |
|
|
size_t |
source_length |
|
) |
| |
|
inlinevirtual |
Decode a sequence of integers encoded with this codex.
- Parameters
-
| decoded | [out] The sequence of decoded integers. |
| integers_to_decode | [in] The minimum number of integers to decode (it may decode more). |
| source | [in] The encoded integers. |
| source_length | [in] The length (in bytes) of the source buffer. |
Implements JASS::compress_integer.
Reimplemented in JASS::compress_integer_elias_delta_bitwise.
◆ encode() [1/2]
| void JASS::compress_integer_elias_gamma_bitwise::encode |
( |
integer |
val | ) |
|
|
inlineprotected |
encode (and push) one integer
- Parameters
-
| val | [in] The integer to encode |
◆ encode() [2/2]
| virtual size_t JASS::compress_integer_elias_gamma_bitwise::encode |
( |
void * |
encoded, |
|
|
size_t |
encoded_buffer_length, |
|
|
const integer * |
source, |
|
|
size_t |
source_integers |
|
) |
| |
|
inlinevirtual |
Encode a sequence of integers returning the number of bytes used for the encoding, or 0 if the encoded sequence doesn't fit in the buffer.
- Parameters
-
| encoded | [out] The sequence of bytes that is the encoded sequence. |
| encoded_buffer_length | [in] The length (in bytes) of the output buffer, encoded. |
| source | [in] The sequence of integers to encode. |
| source_integers | [in] The length (in integers) of the source buffer. |
- Returns
- The number of bytes used to encode the integer sequence, or 0 on error (i.e. overflow).
Implements JASS::compress_integer.
Reimplemented in JASS::compress_integer_elias_delta_bitwise.
◆ eof()
| uint64_t JASS::compress_integer_elias_gamma_bitwise::eof |
( |
void |
| ) |
|
|
inlineprotected |
Mark the stream as complete.
- Returns
- The length of the stream (in bytes)
The documentation for this class was generated from the following file: