4.7.47. ETSI basic operations

RVCT supports for the original ETSI family of basic operations described in the ETSI G.729 recommendation Coding of speech at 8 kbit/s using conjugate-structure algebraic-code-excited linear prediction (CS-ACELP).

To make use of the ETSI basic operations in your own code, include the standard header file dspfns.h. The intrinsics supplied in dspfns.h are listed in Table 4.13.

Table 4.13. ETSI basic operations supported in RVCT

Intrinsics
abs_sL_add_cL_multL_sub_cnorm_l
addL_deposit_hL_negatemac_rround
div_sL_deposit_lL_satmsu_rsaturate
extract_hL_macL_shlmultshl
extract_lL_macNsL_shrmult_rshr
L_absL_msuL_shr_rnegateshr_r
L_addL_msuNsL_subnorm_ssub

The header file dspfns.h also exposes certain status flags as global variables for use in your C or C++ programs. The status flags exposed by dspfns.h are listed in Table 4.14.

Table 4.14. ETSI status flags exposed in RVCT

Status flagDescription
Overflow

Overflow status flag.

Generally, saturating functions have a sticky effect on overflow.

Carry

Carry status flag.


Example

#include <limits.h>
#include <stdint.h>
#include <dspfns.h>       // include ETSI basic operations

int32_t C_L_add(int32_t a, int32_t b)
{
    int32_t c = a + b;

    if (((a ^ b) & INT_MIN) == 0)
    {
        if ((c ^ a) & INT_MIN)
        {
            c = (a < 0) ? INT_MIN : INT_MAX;
        }
    }

    return c;
}

__asm int32_t asm_L_add(int32_t a, int32_t b)
{
    qadd r0, r0, r1
    bx lr
}

int32_t foo(int32_t a, int32_t b)
{
    int32_t c, d, e, f;

    Overflow = 0;         // set global overflow flag

    c = C_L_add(a, b);    // C saturating add
    d = asm_L_add(a, b);  // assembly language saturating add
    e = __qadd(a, b);     // ARM intrinsic saturating add
    f = L_add(a, b);      // ETSI saturating add
    return Overflow ? -1 : c == d == e == f; // returns 1, unless overflow
}

See also

  • the header file dspfns.h for definitions of the ETSI basic operations as a combination of C code and intrinsics

  • ETSI basic operations in the Compiler User Guide

  • ETSI Recommendation G.191: Software tools for speech and audio coding standardization

  • ITU-T Software Tool Library 2005 User's manual, included as part of ETSI Recommendation G.191

  • ETSI Recommendation G723.1 : Dual rate speech coder for multimedia communications transmitting at 5.3 and 6.3 kbit/s

  • ETSI Recommendation G.729: Coding of speech at 8 kbit/s using conjugate-structure algebraic-code-excited linear prediction (CS-ACELP).

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential