G.722 Appendix IV

Introduction

G.722 is an ITU-T standard 7 kHz Wideband audio codec operating at 48, 56 and 64 kbit/s.

Source code

G.722 codec, with appendix IV for the decoder, and test sequences for use with G.722 codec + G.722 decoder appendix IV were taken from ITU-T G.722 Software Release 3.00, October 2012 and from G.191 Software Tools Library, 13 January 2019, also, this codec passes the test cases successfully.

Multi-instance and reentrance

Codec hasn’t tested on multi-instance run, for more information about support of multi-instance run see codec source documentation. Codec supports reentrance in case if the value of DSP_CTRL register, AGU address pointer registers (AGU_AUX_APx), AGU offset registers (AGU_AUX_OSx), AGU modifier registers (AGU_AUX_MODx) and accumulators registers (ACC0_LO, ACC0_HI, ACC0_GLO and ACC0_GHI in case of guard mode is on), see [1] in References, will be saved and restored. Also if you build with option USE_XCCM=on you must not use XCCM, because XCCM bank is used for storing table coefficients.

Codec Specific Build Options

LTO_BUILD, USE_XCCM and REMAPITU_T options are enabled for this codec by default.

Warning

XCCM bank is used for storing table coefficients.

The following table lists specific build options of G.722 codec:

Codec Specific Build Options
Command Description
gmake COMPONENT=<ENCODER/DECODER> These commands build only encoder (encg722.elf)or decoder (decg722.elf)
WMOPS=on Display information about each frame, frame number, total Weighted MOPS, computational complexity of the encoder or decoder for that frame, the average WMOPS figure for the frames processed, the observed worst case WMOPS figure and the observed “worst worst case” figure of the encoder or decoder for the current frame
USE_XCCM=on Use XCCM bank for storing tables of coefficients in funcg722.c

Example

The following command builds the encoder application and library with WMOPS:

gmake COMPONENT=ENCODER WMOPS=on

Codec-Specific Run-Time Options

To run G.722 codec in MetaWare Debugger (See [2] in References), use the following command:

  • For G.722 encoder:

    mdb -run -cl -nsim -tcf=<default TCF from /rules/common_hw_config.mk> encg722.elf [-q] [-mode <M>] [-byte] [-fsize N] [-frames N2] <file.inp> <file.out>
    
  • For G.722 decoder, appendix IV:

    mdb -run -cl -nsim -tcf=<default TCF from /rules/common_hw_config.mk> decg722.elf [-fsize N] <file.inp> <file.out>
    
  • For G.722 test encoder:

    mdb -run -cl -nsim -tcf=<default TCF from /rules/common_hw_config.mk> tstcg722.elf <file.inp> <file.ref>
    
  • For G.722 test decoder:

    mdb -run -cl -nsim -tcf=<default TCF from /rules/common_hw_config.mk> tstdg722.elf <file.inp> <low_file.ref> <high_file.ref>
    

The following tables list the parameters that can be passed to the G.722 codec:

Command-Line Options Descriptions for G.722 Encoder
Option Description
<file.inp> Specifies the input *.bin file
<file.out> Specifies the output *.cod file
-byte Provide encoder output data in legacy byte-oriented format (default is g192)
-fsize Number of 16 kHz input samples per frame (must be an even number). Default is 160 samples(16 kHz) (10 ms)
-frames Number of frames to process (values -1 or 0 processes the whole file)
-mode Operating mode (1,2,3) (or rate 64, 56, 48 in kbps) . Default is mode 1 (= 64 kbps)
-h/-help Print help message
-q Suppress debug information
Command-Line Options Descriptions for G.722 Decoder of appendix IV
Option Description
<file.inp> Specifies the input file *.bst file
<file.out> Specifies the output file *.out file
-fsize Define frame size for g192 operation and file reading
Command-Line Options Descriptions for Test G.722 Decoder
Option Description
<file.inp> Specifies the input file *.cod file
<low_file.ref> Specifies the low part of reference file
<high_file.ref> Specifies the high part of reference file
Command-Line Options Descriptions for Test G.722 Encoder
Option Description
<file.inp> Specifies the input file *.cod file
<file.ref> Specifies the reference file for checking the correctness of Encoder

Examples

Note

The decoder supports only g192 byte format. For this reason, if you will encode a file in the legacy byte-oriented format using [-byte] option, you can not decode this file by the decoder.

The following command encodes the inpsp.bin stream to legacy byte-oriented format:

mdb -run -cl -nsim -tcf=em9d_voice_audio encg722.elf -byte ../testvectors/inp/inpsp.bin ../testvectors/temp.cod

The following command decodes the test10.bst stream without any additional options:

mdb -run -cl -nsim -tcf=em9d_voice_audio decg722.elf ../testvectors/inp/test10.bst ../testvectors/test10.out