pjsip logo pjsip.org
Open source SIP stack and media stack for presence, im/instant messaging, and multimedia communication

HOME

SIP/media Features
High Performance SIP
Small Footprint SIP
Symbian Port

FAQ

Documentation

Licensing

Download

Development (Trac)

Projects using pjsip

Mailing List

Open Source Links


About: PJLIB, PJLIB-UTIL, PJSIP, and PJMEDIA are created by: Benny Prijono
<bennylp@pjsip.org>


 

Home --> Documentations --> PJMEDIA Reference

G722.1 Codec
[Supported codecs]


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.


Functions

PJ_BEGIN_DECL pj_status_t pjmedia_codec_g7221_init (pjmedia_endpt *endpt)
pj_status_t pjmedia_codec_g7221_set_mode (unsigned sample_rate, unsigned bitrate, pj_bool_t enabled)
pj_status_t pjmedia_codec_g7221_set_pcm_shift (int val)
pj_status_t pjmedia_codec_g7221_deinit (void)


Function Documentation

PJ_BEGIN_DECL pj_status_t pjmedia_codec_g7221_init ( pjmedia_endpt endpt  ) 

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.

pj_status_t pjmedia_codec_g7221_set_pcm_shift ( int  val  ) 

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:
val The value
Returns:
PJ_SUCCESS on success.

pj_status_t pjmedia_codec_g7221_deinit ( void   ) 

Unregister G722.1 codecs factory from pjmedia endpoint.

Returns:
PJ_SUCCESS on success.

 


PJMEDIA small footprint Open Source media stack
Copyright (C) 2006-2008 Teluu Inc.