AN2094 Freescale Semiconductor / Motorola, AN2094 Datasheet - Page 22

no-image

AN2094

Manufacturer Part Number
AN2094
Description
ITU-T G.729 Implementation on StarCore SC140
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Results
3.5 Code Size
The evolution in code size as the project progressed is summarized in Figure 5. Again, the X axis represents the
manpower used to achieve each milestone. The Y axis represents the code size in KB at each milestone. The initial
ported version of the G.729 to the SC140 resulted in a code size of 37.9 KB (encoder + decoder). All code was
generated from C with the compiler optimized for speed (-Ot2 option). For the initial version it was difficult to
apply time and size compiler options differentially because the functions were not separated into units which could
be compiled individually.
Project-level optimization resulted in a slight reduction in code size. However, code size increased to 42.2 KB after
function-level C optimizations. The increase of almost 5 KB (12.5 percent) was due primarily to multisample and
loop unrolling (see Section 2.4.3, General Optimization Techniques, on page 11). Applying multisample to a
simple loop increases its code size by up to four times. Loop unrolling and compiler-generated software pipelining
increases the code size in specific areas even further.
Algorithmic changes plus reoptimizations in C resulted in a negligible increase in code size compared to the
previous C optimization phase, reducing execution time by a factor of 1.29 at a cost of only a 1.2 percent increase
in code size. Two major factors reduce the amount by which code size increases without significant speed penalty.
In some cases, multisample by four is replaced by multisample by two. Also, a less stringent compiler option for
speed is chosen. Time optimization should be applied aggressively only on the most time-consuming functions.
Improvements in compiler technology should provide more satisfactory trade-offs between speed and size.
Compiling the unoptimized code with a size optimization feature provides some compensation for the code
increase resulting from the time optimization applied to time-consuming functions.
22
50
45
40
35
30
25
20
15
10
5
0
0
ITU-T G.729 Implementation on the StarCore™ SC140/SC1400 Cores, Rev. 1
37.9
37.6
2
Our Target
4
Figure 5. Code Size Versus Effort
6
42.2
Effort (man-months)
8
42.7
10
12
Freescale Semiconductor
14
36.2
16

Related parts for AN2094