VLC 4.0.0-dev
Loading...
Searching...
No Matches
Collaboration diagram for Bit operations:

Macros

#define VLC_INT_FUNC(basename)
 
#define VLC_INT_FUNC_TYPE(basename, type, suffix)
 
#define VLC_INT_GENERIC(func, x)
 
#define ctz(x)   VLC_INT_GENERIC(vlc_ctz, x)
 Count trailing zeroes.
 
#define parity(x)   VLC_INT_GENERIC(vlc_parity, x)
 Parity.
 
#define vlc_popcount(x)
 Bit weight / population count.
 

Functions

static int vlc_ctz_generic (unsigned long long x)
 
static int vlc_parity_generic (unsigned long long x)
 
static int vlc_popcount_generic (unsigned long long x)
 
static int vlc_ctz (unsigned x)
 
static int vlc_ctzl (unsigned long x)
 
static int vlc_ctzll (unsigned long long x)
 
static int vlc_parity (unsigned x)
 
static int vlc_parityl (unsigned long x)
 
static int vlc_parityll (unsigned long long x)
 
static int vlc_popcount (unsigned x)
 
static int vlc_popcountl (unsigned long x)
 
static int vlc_popcountll (unsigned long long x)
 
static uint16_t vlc_bswap16 (uint16_t x)
 Byte swap (16 bits)
 
static uint32_t vlc_bswap32 (uint32_t x)
 Byte swap (32 bits)
 
static uint64_t vlc_bswap64 (uint64_t x)
 Byte swap (64 bits)
 

Detailed Description

Macro Definition Documentation

◆ ctz

#define ctz (   x)    VLC_INT_GENERIC(vlc_ctz, x)

Count trailing zeroes.

This function counts the number of consecutive zero bits up from the lowest order bit in an unsigned integer.

Parameters
xa non-zero integer
Note
This function assumes that CHAR_BIT equals 8.
Returns
The number of trailing zero bits in x.

◆ parity

#define parity (   x)    VLC_INT_GENERIC(vlc_parity, x)

Parity.

This function determines the parity of an integer.

Return values
0if x has an even number of set bits.
1if x has an odd number of set bits.

◆ VLC_INT_FUNC

#define VLC_INT_FUNC (   basename)
Value:
VLC_INT_FUNC_TYPE(basename, unsigned, ) \
VLC_INT_FUNC_TYPE(basename, unsigned long, l) \
VLC_INT_FUNC_TYPE(basename, unsigned long long, ll)
#define VLC_INT_FUNC_TYPE(basename, type, suffix)
Definition vlc_common.h:621

◆ VLC_INT_FUNC_TYPE

#define VLC_INT_FUNC_TYPE (   basename,
  type,
  suffix 
)
Value:
VLC_USED static inline int vlc_##basename##suffix(type x) \
{ \
return vlc_##basename##_generic(x); \
}
#define VLC_USED
Definition vlc_common.h:156

◆ VLC_INT_GENERIC

#define VLC_INT_GENERIC (   func,
 
)
Value:
_Generic((x), \
unsigned char: func(x), \
signed char: func(x), \
unsigned short: func(x), \
signed short: func(x), \
unsigned int: func(x), \
signed int: func(x), \
unsigned long: func##l(x), \
signed long: func##l(x), \
unsigned long long: func##ll(x), \
signed long long: func##ll(x))

◆ vlc_popcount

#define vlc_popcount (   x)
Value:
_Generic((x), \
signed char: vlc_popcount((unsigned char)(x)), \
signed short: vlc_popcount((unsigned short)(x)), \
#define VLC_INT_GENERIC(func, x)
Definition vlc_common.h:633
#define vlc_popcount(x)
Bit weight / population count.
Definition vlc_common.h:674

Bit weight / population count.

This function counts the number of non-zero bits in an integer.

Returns
The count of non-zero bits.

Function Documentation

◆ vlc_bswap16()

static uint16_t vlc_bswap16 ( uint16_t  x)
inlinestatic

Byte swap (16 bits)

Referenced by GetWLE(), and SetWLE().

◆ vlc_bswap32()

static uint32_t vlc_bswap32 ( uint32_t  x)
inlinestatic

Byte swap (32 bits)

Referenced by GetDWLE(), and SetDWLE().

◆ vlc_bswap64()

static uint64_t vlc_bswap64 ( uint64_t  x)
inlinestatic

Byte swap (64 bits)

Referenced by GetQWLE(), and SetQWLE().

◆ vlc_ctz()

static int vlc_ctz ( unsigned  x)
inlinestatic

◆ vlc_ctz_generic()

static int vlc_ctz_generic ( unsigned long long  x)
inlinestatic

◆ vlc_ctzl()

static int vlc_ctzl ( unsigned long  x)
inlinestatic

◆ vlc_ctzll()

static int vlc_ctzll ( unsigned long long  x)
inlinestatic

◆ vlc_parity()

static int vlc_parity ( unsigned  x)
inlinestatic

◆ vlc_parity_generic()

static int vlc_parity_generic ( unsigned long long  x)
inlinestatic

◆ vlc_parityl()

static int vlc_parityl ( unsigned long  x)
inlinestatic

◆ vlc_parityll()

static int vlc_parityll ( unsigned long long  x)
inlinestatic

◆ vlc_popcount()

static int vlc_popcount ( unsigned  x)
inlinestatic

◆ vlc_popcount_generic()

static int vlc_popcount_generic ( unsigned long long  x)
inlinestatic

References count.

◆ vlc_popcountl()

static int vlc_popcountl ( unsigned long  x)
inlinestatic

◆ vlc_popcountll()

static int vlc_popcountll ( unsigned long long  x)
inlinestatic