[ Previous | Next | Contents | Glossary | Home | Search ]
Ultimedia Services Version 2 for AIX: Programmer's Guide and Reference

UMSG723Decoder Object

This audio decoder object converts G.723 .1 compressed data to 8 kilohertz 16-bit PCM audio data. The G.723 coder is an ITU Draft Recommendation that is part of the H. 323/ 324 family of standards. The G.723 .1 standard supports two compression rates, 5.3 Kbit per second and 6.3 Kbit per second and is optimized to handle speech signals.

To learn more about the UMSG723Decoder object, see:

For introductory information, see Audio Codec Objects.

Algorithm Overview

The G.723 coder is based on the principles of linear prediction analysis-by-synthesis coding and attempts to minimize a perceptually weighted error signal. The decoder produces frames of 240 samples (30 ms). Each input frame contains either 20 (5.3K data rate) or 24 (6.3K data rate) bytes of compressed data. There is an optional post processing filter step that can be applied to each frame.

Default Settings

Filter Mode: OFF

BitRate: 6.3K

Voice Activity Detector: OFF

Programming Tips

There is no information about the encoded data rate in the compressed data stream, and the first important point is to make sure the data rates for the encoder and decoder match. If the data rate is 5.3K, then each compressed frame consists of 20 bytes, and each decompressed frame consists of 240 16-bits samples. If the data rate is 6.3K, then each compressed frame consists of 24 bytes.

For a real-time conferencing application, there may be times when compressed data frames are lost. In this situation, the decoder will still be expecting a new frame every 30 ms. There is the capability, within the G.723 decoder, to synthesis data for a missing frame. The decompress_data method can be called with an empty compressed frame buffer by setting the buffer status set to Empty. Decompressed data will then be generated, using the accumulated frames in the decoder, and this audio data can be played. This will work for up to 2 consecutive frames. After the second frame, the decoder will generate silence if called with an empty frame.

Enumeration Lists

enum ReturnCode {
   Success, //Command completed successfully
   Failure, //Execution failure
   OutOfRange, //Bad input parameter value
   InsufficientData, //Not enough input data (less than one frame)
   Uninitialized, //Uninitialized state variable
   InvalidArgument, //Bad input parameter value
   ExcessData //Too much input data (more than one frame)
   };
enum BitRate { 
   Rate53K, //Compressed bit-rate of 5.3 kilobits per second
   Rate63K //Compressed bit-rate of 6.3 kilobits per second 
   };
enum FilterMode { 
   Filter_On, //Post processing filter ON
   Filter_Off //Post processing filter OFF 
   };
enum CompDataStatus { 
   FirstBuffer, //The first audio buffer in a sequence 
   NextBuffer, //Compressed audio data
   EmptyBuffer //No valid compressed data
   };

Method Descriptions

ReturnCode set_bit_rate(in BitRate bit_rate);

Description

Set the compressed bit rate, with 5.3K or 6.3K bits per second.

Arguments
in BitRate bit_rate An enum type variable that holds the bit rate setting.
Return Values

Success

InvalidArgument

ReturnCode get_bit_rate(inout BitRate bit_rate);

Description

Query the compressed bit rate setting.

Arguments
inout BitRate bit_rate A pointer to an enum type variable that holds the bit rate setting.
Return Values

Success

InvalidArgument

ReturnCode set_filter_mode(in FilterMode mode);

Description

Set the post-processing filter mode to ON or OFF.

Arguments
in FilterMode mode A enum type variable that holds the filter mode setting.
Return Values

Success

InvalidArgument

ReturnCode get_filter_mode(inout FilterMode mode);

Description

Query the state of the filter setting.

Arguments
inout FilterMode mode A pointer to an enum type variable that holds the bit rate setting.
Return Values

Success

InvalidArgument

ReturnCode get_version(out string g723_version);

Description

Query the version of the G.723 decoder object.

Arguments
out string g723_version A pointer to a character string holding the version number of the G723 decoder.
Return Values

Success

InvalidArgument

ReturnCode get_input_size(inout long input_size);

Description

Get the number of number of bytes needed for a input frame of compressed data.

Arguments
nout long input_size A pointer to a long variable that holds input frame size (in bytes).
Return Values

Success

InvalidArgument

ReturnCode get_max_output_buffer_size(inout long buffer_size);

Description

Query the maximum size needed for the output buffer (in bytes).

Arguments
inout long buffer_size A pointer to a long variable that holds the output buffer size.
Return Values

Success

InvalidArgument

ReturnCode decompress_data( in CompressedData comp_data, in UncompressedData uncomp_data, in CompDataStatus comp_status);

Description

This method decompresses a frame of input data into 240 samples of 16 - bit PCM audio data. If a frame of compressed data is lost or corrupted in the audio stream, then there is a procedure in the G.723 decoder that can generate up to two frames out of the decoder's history. This procedure can handle up to two consecutive lost frames. The comp_status variable should be set to EmptyBuffer for any lost or corrupted frames.

Arguments
in CompressedData comp_data A SOM structure variable that holds the input compressed data (buffer length, buffer maximum length, and pointer to buffer).
in UncompressedData uncomp_data A SOM structure variable that holds the output audio data (buffer length, buffer maximum length, and pointer to buffer).
in CompDataStatus comp_status A variable that identifies the type of input buffer, First buffer in a sequence, Next buffer (second and subsequent buffers), and Empty buffer (no valid compressed data).
Return Values

Success

InvalidArgument

For introductory information, see Audio Codec Objects.


[ Previous | Next | Contents | Glossary | Home | Search ]