AN2094 Freescale Semiconductor / Motorola, AN2094 Datasheet - Page 7

no-image

AN2094

Manufacturer Part Number
AN2094
Description
ITU-T G.729 Implementation on StarCore SC140
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
This routine requires four cycles to execute. However, this approach forces the compiler to use a dedicated DALU
register. A more acceptable solution is to use the intrinsic functions provided by the C compiler, as shown in
Example 2.
A= _sat(L_shl(L_shl(L_a, 8), 8));
Although the code generated by this statement requires 5 cycles instead of 4 cycles, the compiler uses any DALU
register for the operation. This was the solution chosen for the vocoder project.
2.2.3 Code Modifications for Multi-Channel Environments
To accommodate multi-channel systems, global variables and static data in each C module were eliminated. For
each file that contained static or global data, the following steps were taken:
Vocoder performance at the end of this phase is listed in Table 4.
:
2.3 Project-Level Optimizations
Two optimization techniques, function inlining and data alignment, were applied to the entire project. In general,
these techniques improve the performance of both C and assembly code.
Freescale Semiconductor
Note:
29.29 MCPS
1.
2.
3.
4.
5.
RWH
Speed
A data structure containing the static data variables was defined in the g729codec.h file.
The generated data structure in g729codec.h was added to the general encoder and decoder chan-
nel information.
Former static data initialization was performed explicitly in the encoder/decoder initialization function,
g729_encode_initialize()/g729_decode_initialize().
For each function in the original file that used static data:
a.
b.
For each function that called any of the functions modified in step 4, a pointer to the data structure in
g729codec.h was added to its parameter list. This process was repeated recursively up to the main
encoder/decoder function, g729_encode()/g729_decode().
Processing load in millions of cycles per second
v‡…v†vpÃsˆp‡v‚Ã†h‡ˆ…h‡r†Ã‡urÃy‚r…à %Ãiv‡†Ã‚sÃhÃ"!iv‡Ã‰hyˆrÃwˆ†‡Ãh†Ã‡urÃ
s…‚€ÃB&!(Ãp‚qrÃq‚r†
A pointer to the data structure in g729codec.h was added to the parameter list.
All static variables referenced in the function body were replaced with variables stored in the data
structure whose addresses are received as parameters.
To improve compiler performance, it is recommended that computations be made on local copies
of the ex-global data structures, passing the results back to the channel data.
rtvvtÐv‡uÉr…†v‚Ã r‡hà ÂsÃHr‡…‚r…x†Ã8‚qrXh……v‚…Ãs‚…ÃT‡h…8‚…rÇurÃ
1
ITU-T G.729 Implementation on the StarCore™ SC140/SC1400 Cores, Rev. 1
Table 4. Performance Characteristics After Initial Porting Phase
Program Size
37.9 KB
Example 2. C Emulation of Sature()
6.43 KB
Tables
Channel Data
3.18 KB
sature()
Optimization Process
Stack Size
3.16 KB
saturate()
Ãsˆp‡v‚Ã
Ã
7

Related parts for AN2094