Slim numerical data compression 1.0
slim_single_codec.h File Reference

Inline functions to standardize some multi-step systems for coding and decoding single values. More...

#include "bitstream.h"

Go to the source code of this file.

Functions

void mexp_golomb_write (obitstream *ob, uint32_t u, unsigned int order=1)
 Write an unsigned value to a bitstream by method mexp_golomb.
 
uint32_t mexp_golomb_read_u32 (ibitstream *ib, unsigned int order=1)
 Read an unsigned 32-bit value from a bitstream by method mexp_golomb.
 

Detailed Description

Inline functions to standardize some multi-step systems for coding and decoding single values.

Includes the "modified exponential Golomb" method.

Function Documentation

◆ mexp_golomb_read_u32()

uint32_t mexp_golomb_read_u32 ( ibitstream * ib,
unsigned int order = 1 )
inline

Read an unsigned 32-bit value from a bitstream by method mexp_golomb.

Parameters
ibThe bitstream to read.
orderThe order of the code, i.e. the minimum # of value bits.
Returns
The value read.

References ibitstream::read_unary(), and ibitstream::readbits().

◆ mexp_golomb_write()

void mexp_golomb_write ( obitstream * ob,
uint32_t u,
unsigned int order = 1 )
inline

Write an unsigned value to a bitstream by method mexp_golomb.

Parameters
obThe bitstream to write on.
uThe number to encode.
orderThe order of the code, i.e. the minimum # of value bits.

References bit_size(), obitstream::write_unary(), and obitstream::writebits().