Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
Functions
g711.h File Reference
#include "ws_symbol_export.h"

Go to the source code of this file.

Functions

WS_DLL_PUBLIC unsigned char linear2alaw (int pcm_val)
 Converts a 16-bit linear PCM value to 8-bit A-law encoded format.
 
WS_DLL_PUBLIC int alaw2linear (unsigned char a_val)
 Converts an 8-bit A-law encoded value to a 16-bit linear PCM value.
 
WS_DLL_PUBLIC unsigned char linear2ulaw (int pcm_val)
 Converts a 16-bit linear PCM value to u-law encoded format.
 
WS_DLL_PUBLIC int ulaw2linear (unsigned char u_val)
 Converts a u-law encoded value to a 16-bit linear PCM value.
 

Detailed Description

Definitions for routines for u-law, A-law and linear PCM conversions

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ alaw2linear()

WS_DLL_PUBLIC int alaw2linear ( unsigned char  a_val)

Converts an 8-bit A-law encoded value to a 16-bit linear PCM value.

Decodes an 8-bit A-law value back into a signed 16-bit linear PCM value.

Parameters
a_valThe 8-bit A-law encoded value.
Returns
The corresponding 16-bit linear PCM value.

◆ linear2alaw()

WS_DLL_PUBLIC unsigned char linear2alaw ( int  pcm_val)

Converts a 16-bit linear PCM value to 8-bit A-law encoded format.

Encodes a signed 16-bit linear PCM value into an 8-bit A-law value, commonly used in telephony systems to compress audio data.

Parameters
pcm_valThe 16-bit linear PCM value to encode.
Returns
The corresponding 8-bit A-law encoded value.

◆ linear2ulaw()

WS_DLL_PUBLIC unsigned char linear2ulaw ( int  pcm_val)

Converts a 16-bit linear PCM value to u-law encoded format.

Encodes a signed 16-bit linear PCM value into an 8-bit u-law value, used in North American and Japanese telephony systems for audio compression.

Parameters
pcm_valThe 16-bit linear PCM value to encode.
Returns
The corresponding 8-bit u-law encoded value.

◆ ulaw2linear()

WS_DLL_PUBLIC int ulaw2linear ( unsigned char  u_val)

Converts a u-law encoded value to a 16-bit linear PCM value.

Decodes an 8-bit u-law value back into a signed 16-bit linear PCM value.

Parameters
u_valThe 8-bit u-law encoded value.
Returns
The corresponding 16-bit linear PCM value.