Detailed Description
G722.1 licensed from PolycomŽ G722.1 Annex C licensed from PolycomŽ
This section describes functions to register and register G722.1 codec factory to the codec manager. After the codec factory has been registered, application can use Codec Framework API to manipulate the codec.
PJMEDIA G722.1 codec implementation is based on ITU-T Recommendation G.722.1 (05/2005) C fixed point implementation including its Annex C.
G722.1 is a low complexity codec that supports for 7kHz and 14kHz bandwidth audio signals working at bitrates ranging from 16kbps to 48kbps. It may be used with speech or music inputs.
The codec implementation supports for standard and non-standard bitrates. By default, the standard bitrates are enabled upon initialization, i.e.:
- 24kbps and 32kbps for audio bandwidth 7 kHz (16kHz sampling rate),
- 24kbps, 32kbps, and 48kbps for audio bandwidth 14 kHz (32kHz sampling rate). The usage of non-standard bitrates must follow this requirements:
- for sampling rate 16kHz: 16000 to 32000 bps, it must be a multiple of 400
- for sampling rate 32kHz: 24000 to 48000 bps, it must be a multiple of 400 Note that currently it is only up to two non-standard modes can be enabled at one time.
Function Documentation
Initialize and register G722.1 codec factory to pjmedia endpoint.
- Parameters:
-
| endpt | The pjmedia endpoint. |
- Returns:
- PJ_SUCCESS on success.
| pj_status_t pjmedia_codec_g7221_set_mode |
( |
unsigned |
sample_rate, |
|
|
unsigned |
bitrate, |
|
|
pj_bool_t |
enabled | |
|
) |
| | |
Enable and disable G722.1 mode. By default, the standard modes are enabled upon initialization, i.e.:
- sampling rate 16kHz, bitrate 24kbps and 32kbps.
- sampling rate 32kHz, bitrate 24kbps, 32kbps, and 48kbps. This function can also be used for enabling non-standard modes. Note that currently it is only up to two non-standard modes can be enabled at one time.
- Parameters:
-
| sample_rate | PCM sampling rate, in Hz, valid values are only 16000 and 32000. |
| bitrate | G722.1 bitrate, in bps, the valid values are standard and non-standard bitrates as described above. |
| enabled | PJ_TRUE for enabling specified mode. |
- Returns:
- PJ_SUCCESS on success.
Set the G.722.1 codec encoder and decoder level adjustment. If the value is non-zero, then PCM input samples to the encoder will be shifted right by this value, and similarly PCM output samples from the decoder will be shifted left by this value.
Default value is PJMEDIA_G7221_DEFAULT_PCM_SHIFT.
- Parameters:
-
- Returns:
- PJ_SUCCESS on success.
Unregister G722.1 codecs factory from pjmedia endpoint.
- Returns:
- PJ_SUCCESS on success.