| |||||||||||||
On-Line Manuals RealView Compiler User's Guide | ETSI basic operations
The European Telecommunications Standard Institute (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 the 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. NoteVersion 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 currently supported in RVCT. 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++. RVCT provides support for the ETSI basic operations through the header file The
See the header file For more information see:
These documents are available from ITU-T, the telecommunications bureau of the ITU, at The implementation of the ETSI basic operations in
#include <dspfns.h> /* include ETSI intrinsics */
#include <stdio.h>
...
const int BUFLEN=255;
int a[BUFLEN], b[BUFLEN], c[BUFLEN];
...
Overflow = 0; /* clear overflow flag */
for (i = 0; i < BUFLEN; ++i) {
c[i] = L_add(a[i], b[i]); /* saturated add of a[i] and b[i] */
}
if (Overflow)
{
fprintf(stderr, "Overflow on saturated addition\n");
}
Generally, saturating functions have a sticky effect on overflow. That is, the overflow flag remains set until it is explicitly cleared. For more information, see the header file | ||||||||||||
| |||||||||||||