LinToALaw

Encodes the linear samples using 8-bit A-law format and stores them in an array.

Syntax

IppStatus ippsLinToALaw_16s8u(const Ipp16s* pSrc, Ipp8u* pDst, int len);

IppStatus ippsLinToALaw_32f8u(const Ipp32f* pSrc, Ipp8u* pDst, int len);

Parameters

pSrc

Pointer to the source vector.

pDst

Pointer to the destination vector.

len

Number of samples in the vector.

Description

The function ippsLinToALaw is declared in the ipps.h file. This function encodes the PCM-linear samples in the vector pSrc using 8-bit A-law format and stores them in the vector pDst.

The formula for A-law companding is as follows:



where x is the linear signal sample and CA(x) is the A-law encoded sample.

The formula is shown in terms of absolute values of both the original and compressed signals since positive and negative values are compressed in an identical manner. The sign of the input is preserved in the output.

The formula shown above should not be implemented directly, since such an implementation would be slow. Encoding or decoding of A-law format is usually performed using look-up Tables 1a/G.711 and 1b/G.711 shown in the CCITT specification G.711 [CCITT]. Refer to the G.711 specification for details.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when the pDst or pSrc pointer is NULL.

ippStsSizeErr

Indicates an error when len is less than or equal to 0.

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.