AN2261 Freescale Semiconductor / Motorola, AN2261 Datasheet - Page 9

no-image

AN2261

Manufacturer Part Number
AN2261
Description
ITU-T G.729AB Implementation on the StarCore SC140 Core
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
The C optimization techniques are as follows:
• Multisampling
• Loop merging
• Loop unrolling
• Loop splitting
• Split summation
These techniques were applied to the following functions:
• Calc_exc_rand()
• Gauss()
• Random()
• New_ml_search_1()
• New_ml_search_2()
• Lsp_lsf()
Several descendants of Calc_exc_rand() were optimized. The result of combining the Gauss()
and Random() functions is the Generate_Gauss_Exc() function, which is used by
Calc_exc_rand() . This result was optimized using assembly to increase speed. Also, the loops used
for normalization were extracted into separate functions, normalize_1() and normalize_2() ,
that were optimized in C to increase speed. Table 9 summarizes the results of optimizing the
Calc_exc_rand() function.
Special optimization techniques were applied to New_ml_search_1() and New_ml_search_2()
to reduce the number of cycles. The goal was to optimize the loop that finds the index of the minimum
value in a vector of 16-bit values. The optimization consisted of creating a 32-bit array that contains the
16-bit value on the high part and its index in the low part. Using the split-summation technique, four
minimums and their indexes are computed at each loop iteration. Using this technique in conjunction
with the C optimization techniques improved the results, as shown in Table 10.
Table 9. Performance Results for the Calc_exc_rand() Optimization Phases
normalize_1() and normalize_2() (C optimized code)
Freescale Semiconductor, Inc.
Generate_Gauss_Exc() (C optimized version)
Generate_Gauss_Exc() (assembly version)
Generate_Gauss_Exc() (assembly version)
For More Information On This Product,
ITU-T Reference Code
Go to: www.freescale.com
Optimized Code
Optimized Code
Optimized Code
C Version
+
+
+
+
Number of
Cycles
22495
7946
6822
4684
Implementation Process
Code Size
(Bytes)
2168
2442
2442
2218
9

Related parts for AN2261