AN2094 Freescale Semiconductor / Motorola, AN2094 Datasheet - Page 23

no-image

AN2094

Manufacturer Part Number
AN2094
Description
ITU-T G.729 Implementation on StarCore SC140
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
The final implementation in assembly resulted in a substantial decrease in code size. Although only a few functions
were implemented in assembly, the code size was reduced to 36.2 KB, which is actually less than the initial code
size. This confirmed that manually-written code is both faster and smaller than compiler-generated code. A future
compiler version offering a size reduction option may generate sufficiently small code size without the manpower
required for assembly coding.
3.6 Data Size
The data size refers to all the data handled by the vocoder. It includes read-only tables (which can be stored in
ROM), stack data for transient variables, and channel data structures to store persistent channel data. Figure 6 is a
bar graph showing the size of each of these components for each phase of the project. Note that the optimizations
performed in each phase, which were geared primarily to increase speed, had no substantial effect on total data
size.
3.6.1 Tables and Globals
The tables and globals component of data memory includes all data placed in the data segment. This includes all
tables, most of which are defined in tab_ld8k.c, and compiler-generated overhead data. The compiler generates
a kind of software stack of 10–20 bytes for each module. The difference of 536 bytes between the final C version
and the initial ported version is mostly due to this overhead data.
3.6.2 Channel Data
The channel data size remained virtually unchanged throughout the project. The one change affecting channel data
size was the insertion of extra padding to align certain vectors in the data structure.
Freescale Semiconductor
14000
12000
10000
8000
6000
4000
2000
0
2936
9592
Ported version
ITU-T G.729 Implementation on the StarCore™ SC140/SC1400 Cores, Rev. 1
0
Stack Size
Channel Data
Tables and globals
Figure 6. Data Size Versus Project Phase
3192
3236
6584
optimizations
Project-level
2896
3236
6564
Function-le vel C
optimizations
2904
3264
6908
Final C w ith algorithm ic
changes
3128
3264
7120
Mixed imple mentation
3024
3264
6748
Results
23

Related parts for AN2094