View Source Membrane.H26x.ExpGolombConverter (Membrane H.264 and H.265 plugin v0.10.2)

This module holds function responsible for converting from and to Exp-Golomb Notation.

Summary

Functions

Returns a bitstring with an Exponential Golomb representation of a integer.

Reads the appropriate number of bits from the bitstring and decodes an integer out of these bits.

Functions

Link to this function

to_bitstring(integer, opts \\ [negatives: false])

View Source
@spec to_bitstring(integer(), [{:negatives, boolean()}]) :: bitstring()

Returns a bitstring with an Exponential Golomb representation of a integer.

By default, the function expects the number to be a non-negative integer. If negatives: true option is set, the function can also encode negative numbers, but number encoded with negatives: true option also needs to be decoded with that option.

Link to this function

to_integer(binary, opts \\ [negatives: false])

View Source
@spec to_integer(
  bitstring(),
  keyword()
) :: {integer(), bitstring()}

Reads the appropriate number of bits from the bitstring and decodes an integer out of these bits.

Returns the decoded integer and the rest of the bitstring, which wasn't used for decoding. By default, the decoded integer is an unsigned integer. If negatives: true is passed as an option, the decoded integer will be a signed integer.