A-law idle byte was defined incorrectly.

This commit is contained in:
Steve Underwood 2016-05-29 21:00:49 +08:00
parent 57aa22638c
commit a4cf41771e

View File

@ -50,9 +50,12 @@ specification by other means.
#if !defined(_SPANDSP_G711_H_) #if !defined(_SPANDSP_G711_H_)
#define _SPANDSP_G711_H_ #define _SPANDSP_G711_H_
/*! The A-law alternate mark inversion mask */
#define G711_ALAW_AMI_MASK 0x55
/* The usual values to use on idle channels, to emulate silence */ /* The usual values to use on idle channels, to emulate silence */
/*! Idle value for A-law channels */ /*! Idle value for A-law channels */
#define G711_ALAW_IDLE_OCTET 0x5D #define G711_ALAW_IDLE_OCTET (0x80 ^ G711_ALAW_AMI_MASK)
/*! Idle value for u-law channels */ /*! Idle value for u-law channels */
#define G711_ULAW_IDLE_OCTET 0xFF #define G711_ULAW_IDLE_OCTET 0xFF
@ -192,9 +195,6 @@ static __inline__ int16_t ulaw_to_linear(uint8_t ulaw)
* John Wiley & Sons, pps 98-111 and 472-476. * John Wiley & Sons, pps 98-111 and 472-476.
*/ */
/*! The A-law alternate mark inversion mask */
#define G711_ALAW_AMI_MASK 0x55
/*! \brief Encode a linear sample to A-law /*! \brief Encode a linear sample to A-law
\param linear The sample to encode. \param linear The sample to encode.
\return The A-law value. \return The A-law value.