VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
G::ExpGolomb Class Reference

Does exp-golomb decoding, as used in H.264 "ue(v)" syntax elements. More...

#include <gexpgolomb.h>

Classes

struct  value
 Syntactic sugar for extracting ExpGolomb-encoded values. More...
 

Static Public Member Functions

template<typename U , typename T >
static U decode (T &begin, T end, U underflow_value)
 Decodes the bitstream data provided by the bit iterator. More...
 
template<typename U , typename T >
static U decode (T &begin, T end, bool *underflow_p)
 Overload that sets a flag on underflow.
 
template<typename U , typename T >
static U decode (T &begin, T end)
 Overload that throws on underflow.
 
template<typename S , typename U >
static S make_signed (U)
 Makes a signed value from the result of decode() so 0 maps to 0, 1 maps to 1, 2 maps to -1, 3 maps to 2, 4 maps to -2 etc. More...
 

Detailed Description

Does exp-golomb decoding, as used in H.264 "ue(v)" syntax elements.

The encoding is bit-oriented, so byte boundaries have no significance. The number of leading zero bits indicates the number of relevant trailing bits following the first '1' (eg. 0 0 0 0 1 x x x x), starting with zero encoded as '1' on its own, so 010 maps to 1, 011 to 2, 00100 to 3, 00101 to 4, 00110 to 5, 00111 to 6 etc.

See Also
H.264 spec (ISO/IEC 14496 part 10) section 9.1

Definition at line 46 of file gexpgolomb.h.

Member Function Documentation

template<typename U , typename T >
U G::ExpGolomb::decode ( T &  begin,
end,
underflow_value 
)
inlinestatic

Decodes the bitstream data provided by the bit iterator.

Returns the underflow value on underflow.

Definition at line 105 of file gexpgolomb.h.

template<typename S , typename U >
S G::ExpGolomb::make_signed ( u)
inlinestatic

Makes a signed value from the result of decode() so 0 maps to 0, 1 maps to 1, 2 maps to -1, 3 maps to 2, 4 maps to -2 etc.

Definition at line 129 of file gexpgolomb.h.


The documentation for this class was generated from the following file: