AN2094 Freescale Semiconductor / Motorola, AN2094 Datasheet - Page 10

no-image

AN2094

Manufacturer Part Number
AN2094
Description
ITU-T G.729 Implementation on StarCore SC140
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Optimization Process
When internal pointers are used, conflicts can arise when two different functions require the same array to be
aligned differently. Tests should be run to identify the type of alignment that gives better overall performance.
When a compromise is difficult, the recommended approach is to make a local copy of the array in one of the
functions which contains the required alignment.
2.3.3 32-Bit DPF Format and Operations
Many vocoders including the ITU-T G.729 use a non-standard representation of 32-bit double-precision numbers
known as double precision format (DPF). The equation defining this representation is
where L_32 is a 32-bit signed integer, and hi and lo are 16-bit signed integers. The range of values for L_32 is
The fact that the lower as well as the upper portion of the 32-bit value is signed speeds up multiplication
operations. The DPF format and the operations based on it are defined in the G.729 oper_32b.c file. The
principal operations defined for DPF include:
The other two operations convert a 32-bit value to two 16-bit values and vice versa. The 32-bit DPF format was
designed for 16-bit processors that do not support 32-bit operations. Thus, although StarCore processors are 32-bit
processors that support 32-bit operations, the 32-bit operations had to be implemented in DPF format to maintain
bit-exactness with the original ITU-T implementation.
However, there was one optimization that could be performed to take advantage of the processor’s 32-bit
architecture without corrupting the DPF format. The two 16-bit portions, which were originally processed in two
separate DALU registers, were combined into a single 32-bit value using only one DALU register. Thus, functions
that originally received two pointers to two 16-bit arrays could now operate with one pointer to a 32-bit array. This
optimization step also reduced the number of memory moves required. However, the least significant bit of partial
or final computation results had to be reset to maintain bit-exactness with G.729. Again, although C replacement
functions were not always as fast as their original counterparts, the benefits of custom assembly implementation
and reduced data transfers resulted in an efficiency gain. For details on assembly implementation of 16-bit and 32-
bit multiplication, refer to Appendix B and the SC140 DSP Core Reference Manual.
2.3.4 Results
The vocoder performance characteristics after project-level optimizations are shown in Table 5.
10
Mpy_32()—multiplication of two 32-bit DPF values
Mpy_32_16()—multiplication of a 32-bit DPF value with a signed 16-bit value
Div_32()—division of two 32-bit DPF values
24.7 MCPS
Speed
ITU-T G.729 Implementation on the StarCore™ SC140/SC1400 Cores, Rev. 1
Table 5. Performance Characteristics After Project-Level Optimizations
Program Size
37.6 KB
$8000000 <= L_32 <= $7ffffffe
L_32 = hi<<16 + lo<<1
6.41 KB
Tables
Channel Data
3.16 KB
Freescale Semiconductor
Stack Size
2.83 KB
Equation 1
Equation 2

Related parts for AN2094