ALawToMuLaw

Converts samples from 8-bit A-law encoded format to 8-bit μ-law encoded format.

Syntax

IppStatus ippsALawToMuLaw_8u(const Ipp8u* 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 ippsMuLawToALaw is declared in the ipps.h file. This function converts signal samples from 8-bit A-law encoded format in the vector pSrc to 8-bit μ-law format and stores them in the vector pDst.

The conversion of A-law format to μ-law format is usually performed using look-up Table 4/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.

Using Companding Functions

void compand( void ) {
     Ipp32f x[4] = { 0.1f, 0.2f, 0.3f, 0.4f };
     Ipp8u m[4], a[4];
     ippsLinToMuLaw_32f8u( x, m, 4 );
     ippsMuLawToALaw_8u( m, a, 4 );
     ippsALawToLin_8u32f( a, x, 4 );
     // now x must be close to original
     printf_32f("x =", x, 4, ippStsNoErr);
}
Output:
    x =  0.099609 0.207031 0.304688 0.398438

Submit feedback on this help topic

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