Compiler support for European Telecommunications Standards Institute (ETSI) basic operations
ARM Compiler 4.1 and later provide support for the ETSI basic operations to help implement coding of speech.
ETSI has produced several recommendations for the coding of speech, for example, the G.723.1 and G.729 recommendations. These recommendations include source code and test sequences for reference implementations of the codecs.
Model implementations of speech codecs supplied by ETSI are based on a collection of C functions known as the ETSI basic operations. The ETSI basic operations include 16-bit, 32-bit and 40-bit operations for saturated arithmetic, 16-bit and 32-bit logical operations, and 16-bit and 32-bit operations for data type conversion.
Version 2.0 of the ETSI collection of basic operations, as described in the ITU-T Software Tool Library 2005 User's manual, introduces new 16-bit, 32-bit and 40 bit-operations. These operations are not supported in the ARM compilation tools.
The ETSI basic operations serve as a set of primitives for developers publishing codec algorithms, rather than as a library for use by developers implementing codecs in C or C++.
ARM Compiler 4.1 and later provide support for the ETSI basic
operations through the header file dspfns.h.
dspfns.h header file contains definitions
of the ETSI basic operations as a combination of C code and intrinsics.
See dspfns.h for a complete list of the ETSI basic operations supported in ARM Compiler 4.1 and later.
ARM Compiler 4.1 and later support the original ETSI family of basic operations as described in the ETSI G.729 recommendation Coding of speech at 8 kbit/s using conjugate-structure algebraic-code-excited linear prediction (CS-ACELP), including:
16-bit and 32-bit saturated arithmetic operations, such as
sub. For example,
add(v1, v2)adds two 16-bit numbers
v2together, with overflow control and saturation, returning a 16-bit result.
16-bit and 32-bit multiplication operations, such as
L_mult. For example,
mult(v1, v2)multiplies two 16-bit numbers
v2together, returning a scaled 16-bit result.
16-bit arithmetic shift operations, such as
shr. For example, the saturating left shift operation
shl(v1, v2)arithmetically shifts the 16-bit input
v2positions. A negative shift count shifts
16-bit data conversion operations, such as
round. For example,
round(L_v1)rounds the lower 16 bits of the 32-bit input
L_v1into the most significant 16 bits with saturation.Note
Beware that both the dspfns.h header file and the ISO C99 header file math.h both define (different versions of) the function
round(). Take care to avoid this potential conflict.