G711 Class Reference
[Audio Codec - ITU-T Recomendation G711]

A class which implements ITU-T (formerly CCITT) Recomendation G711 "Pulse Code Modulation (PCM) of Voice Frequencies". More...

#include <G711.h>

List of all members.

Static Public Member Functions

static uint8_t ALawEncode (int16_t pcm16)
static int ALawDecode (uint8_t alaw)
static uint8_t ULawEncode (int16_t pcm16)
static int ULawDecode (uint8_t ulaw)
static uint8_t ALawToULaw (uint8_t alaw)
static uint8_t ULawToALaw (uint8_t ulaw)
static unsigned ALawEncode (uint8_t *dst, int16_t *src, size_t srcSize)
static unsigned ALawDecode (int16_t *dst, const uint8_t *src, size_t srcSize)
static unsigned ULawEncode (uint8_t *dst, int16_t *src, size_t srcSize)
static unsigned ULawDecode (int16_t *dst, const uint8_t *src, size_t srcSize)
static unsigned ALawToULaw (uint8_t *dst, const uint8_t *src, size_t srcSize)
static unsigned ULawToALaw (uint8_t *dst, const uint8_t *src, size_t srcSize)

Detailed Description

A class which implements ITU-T (formerly CCITT) Recomendation G711 "Pulse Code Modulation (PCM) of Voice Frequencies".

This encodes and decodes uniform PCM values to/from 8 bit A-law and u-Law values.

Note, the methods in this class use uniform PCM values which are of 16 bits precision, these are 'left justified' values corresponding to the 13 and 14 bit values described in G711.

Version:
2006-05-20
  • Changed code to use standard typedefs, e.g. replaced uint8 with uint8_t, and made use of size_t.

Definition at line 53 of file G711.h.


Member Function Documentation

uint8_t G711::ALawEncode ( int16_t  pcm16  )  [static]

Encode a single 16 bit uniform PCM value into an A-Law value

Parameters:
pcm16 A 16 bit uniform PCM value
Returns:
The A-Law encoded value corresponding to pcm16

Definition at line 41 of file G711.cpp.

int G711::ALawDecode ( uint8_t  alaw  )  [static]

Decode a single A-Law value into a 16 bit uniform PCM value

Parameters:
alaw An A-Law encoded value
Returns:
The 16 bit uniform PCM value corresponding to alaw

Definition at line 87 of file G711.cpp.

uint8_t G711::ULawEncode ( int16_t  pcm16  )  [static]

Encode single 16 bit uniform PCM value into an u-Law value

Parameters:
pcm16 A 16 bit uniform PCM value
Returns:
The u-Law encoded value corresponding to pcm16

Definition at line 112 of file G711.cpp.

int G711::ULawDecode ( uint8_t  ulaw  )  [static]

Decode a single u-Law value into a 16 bit uniform PCM value

Parameters:
ulaw An u-Law encoded value
Returns:
The 16 bit uniform PCM value corresponding to ulaw

Definition at line 161 of file G711.cpp.

uint8_t G711::ALawToULaw ( uint8_t  alaw  )  [static]

Convert a single A-Law value into a u-law value.

Parameters:
alaw An A-Law encoded value
Returns:
The u-law value.

Definition at line 182 of file G711.cpp.

uint8_t G711::ULawToALaw ( uint8_t  ulaw  )  [static]

Convert a single u-Law value into an A-law value.

Parameters:
ulaw An u-Law encoded value
Returns:
The A-Law value

Definition at line 207 of file G711.cpp.

unsigned G711::ALawEncode ( uint8_t dst,
int16_t src,
size_t  srcSize 
) [static]

Encode a buffer of 16 bit uniform PCM values into A-Law values

Parameters:
dst Pointer to location to store A-Law encoded values
src Pointer to the buffer of 16 bit uniform PCM values to be encoded
srcSize The size, in bytes, of the buffer at src
Returns:
The number of bytes which were stored at dst (equal to srcSize>>1)

Definition at line 232 of file G711.cpp.

unsigned G711::ALawDecode ( int16_t dst,
const uint8_t src,
size_t  srcSize 
) [static]

Decode a buffer of A-Law values into 16 bit uniform PCM values

Parameters:
dst Pointer to location to store decoded 16 bit uniform PCM values
src Pointer to the buffer of A-Law values to be decoded
srcSize The size, in bytes, of the buffer at src
Returns:
The number of bytes which were stored at dst (equal to srcSize<<1)

Definition at line 242 of file G711.cpp.

unsigned G711::ULawEncode ( uint8_t dst,
int16_t src,
size_t  srcSize 
) [static]

Encode a buffer of 16 bit uniform PCM values into u-Law values

Parameters:
dst Pointer to location to store u-Law encoded values
src Pointer to the buffer of 16 bit uniform PCM values to be encoded
srcSize The size, in bytes, of the buffer at src
Returns:
The number of bytes which were stored at dst (equal to srcSize>>1)

Definition at line 251 of file G711.cpp.

unsigned G711::ULawDecode ( int16_t dst,
const uint8_t src,
size_t  srcSize 
) [static]

Decode a buffer of u-Law values into 16 bit uniform PCM values

Parameters:
dst Pointer to location to store decoded 16 bit uniform PCM values
src Pointer to the buffer of u-Law values to be decoded
srcSize The size, in bytes, of the buffer at src
Returns:
The number of bytes which were stored at dst (equal to srcSize<<1)

Definition at line 261 of file G711.cpp.

unsigned G711::ALawToULaw ( uint8_t dst,
const uint8_t src,
size_t  srcSize 
) [static]

Convert a buffer of A-Law values into u-law values.

Parameters:
dst Pointer to location to store u-law values
src Pointer to the buffer of A-Law values to be converted
srcSize The size, in bytes, of the buffer at src
Returns:
The number of bytes which were stored at dst (equal to srcSize)

Definition at line 270 of file G711.cpp.

unsigned G711::ULawToALaw ( uint8_t dst,
const uint8_t src,
size_t  srcSize 
) [static]

Convert a buffer of u-Law values into A-law values.

Parameters:
dst Pointer to location to store A-law values
src Pointer to the buffer of u-Law values to be converted
srcSize The size, in bytes, of the buffer at src
Returns:
The number of bytes which were stored at dst (equal to srcSize)

Definition at line 279 of file G711.cpp.


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

Generated by  doxygen 1.6.1