FreeBSD kernel sound device code
g711.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define G711_TABLE_SIZE   256
 
#define ULAW_TO_U8
 
#define ALAW_TO_U8
 
#define U8_TO_ULAW
 
#define U8_TO_ALAW
 
#define _G711_TO_INTPCM(t, v)
 
#define _INTPCM_TO_G711(t, v)   ((t)[(uint8_t)((v) ^ 0x80)])
 
#define G711_DECLARE_TABLE(t)
 
#define G711_DECLARE_OP(t)
 
#define G711_DECLARE(t)
 

Macro Definition Documentation

◆ _G711_TO_INTPCM

#define _G711_TO_INTPCM (   t,
 
)
Value:
((intpcm_t) \
((int8_t)((t)[(uint8_t)(v)] ^ 0x80)))
int32_t intpcm_t
Definition: pcm.h:54

Definition at line 176 of file g711.h.

◆ _INTPCM_TO_G711

#define _INTPCM_TO_G711 (   t,
 
)    ((t)[(uint8_t)((v) ^ 0x80)])

Definition at line 179 of file g711.h.

◆ ALAW_TO_U8

#define ALAW_TO_U8

Definition at line 71 of file g711.h.

◆ G711_DECLARE

#define G711_DECLARE (   t)
Value:
G711_DECLARE_OP(t)
#define G711_DECLARE_TABLE(t)
Definition: g711.h:181

Definition at line 221 of file g711.h.

◆ G711_DECLARE_OP

#define G711_DECLARE_OP (   t)
Value:
static __inline intpcm_t \
pcm_read_ulaw(uint8_t v) \
{ \
\
return (_G711_TO_INTPCM((t).ulaw_to_u8, v)); \
} \
\
static __inline intpcm_t \
pcm_read_alaw(uint8_t v) \
{ \
\
return (_G711_TO_INTPCM((t).alaw_to_u8, v)); \
} \
\
static __inline void \
pcm_write_ulaw(uint8_t *dst, intpcm_t v) \
{ \
\
*dst = _INTPCM_TO_G711((t).u8_to_ulaw, v); \
} \
\
static __inline void \
pcm_write_alaw(uint8_t *dst, intpcm_t v) \
{ \
\
*dst = _INTPCM_TO_G711((t).u8_to_alaw, v); \
}
#define _INTPCM_TO_G711(t, v)
Definition: g711.h:179
#define _G711_TO_INTPCM(t, v)
Definition: g711.h:176

Definition at line 192 of file g711.h.

◆ G711_DECLARE_TABLE

#define G711_DECLARE_TABLE (   t)
Value:
static const struct { \
const uint8_t ulaw_to_u8[G711_TABLE_SIZE]; \
const uint8_t alaw_to_u8[G711_TABLE_SIZE]; \
const uint8_t u8_to_ulaw[G711_TABLE_SIZE]; \
const uint8_t u8_to_alaw[G711_TABLE_SIZE]; \
} t = { \
ULAW_TO_U8, ALAW_TO_U8, \
U8_TO_ULAW, U8_TO_ALAW \
}
#define G711_TABLE_SIZE
Definition: g711.h:34
#define U8_TO_ALAW
Definition: g711.h:141
#define ALAW_TO_U8
Definition: g711.h:71

Definition at line 181 of file g711.h.

◆ G711_TABLE_SIZE

#define G711_TABLE_SIZE   256

Definition at line 34 of file g711.h.

◆ U8_TO_ALAW

#define U8_TO_ALAW

Definition at line 141 of file g711.h.

◆ U8_TO_ULAW

#define U8_TO_ULAW

Definition at line 106 of file g711.h.

◆ ULAW_TO_U8

#define ULAW_TO_U8

Definition at line 36 of file g711.h.