2229 views|1 replies

3836

Posts

19

Resources
The OP
 

Image Algorithm Transplantation to DSP and Its Optimization Steps [Copy link]

When you need to transplant the algorithm you have written to the DSP development board and run it well, what work needs to be done? The following is divided into two parts. The first part is transplantation, and the second part is algorithm optimization transplantation: 1) If the algorithm is developed based on basic opencv, it needs to be separated from the opencv environment. 2) If the algorithm is in C++ language, please change it to standard C language. Although the DSP development environment supports C++, it is not recommended to do so. 3) Modify the memory allocation of the algorithm. Try to allocate the memory once. There will be hidden dangers when the algorithm is constantly applying and releasing. Use static arrays first, which will reduce a lot of workload. 4) Create a project under CCS to debug the algorithm. The memory allocation function needs to use the function provided by TI. If the algorithm can run stably for a long time, then congratulations, the algorithm transplantation is completed. Optimization: Algorithm optimization requires you to understand the algorithm and DSP. If you can only write DSP programs but not algorithms, it will not be optimal for the entire product. Some companies are afraid of algorithm leaks, so they give optimizers one or several programs to optimize. I think this is very unreasonable. Unless you can control the overall situation and master optimization, this is feasible. 1) You need to have a deep and hard understanding of the algorithm principle and read relevant articles. 2) Be familiar with the algorithm in all aspects. 3) After doing the above preparations, you need to reorganize the structure of the algorithm. According to the characteristics of DSP, such as the distribution of memory. After the algorithm structure is adjusted, the speed of the algorithm on DSP should be significantly improved. 4) After the structure adjustment is completed, find the more time-consuming part of the algorithm. Determine the focus that needs to be optimized. This part is mostly the part that needs to be processed once or multiple times for each image. For the content of the initialization part when the algorithm starts, it is generally not necessary to optimize. 5) After determining the optimization content, first consider optimizing from the language structure. At this time, it should still be C language. It is not recommended to use the C library function provided by TI that uses optimization embedded in C language. 6) Rewrite the function that needs to be optimized into linear assembly or assembly function. Constantly adjust the software pipeline to increase the rate. The entire transplant optimization work is basically completed. In fact, in actual work, the workload of transplant optimization is often relatively large, and it is necessary to repeat it repeatedly to find a better method. Migration optimization is a meticulous job, just like algorithm development. It requires calmness and careful study. Welcome everyone to discuss it together.

This post is from Microcontroller MCU

Latest reply

  Details Published on 2019-4-18 08:43
 

173

Posts

0

Resources
2
 
This post is from Microcontroller MCU
 
Personal signature服务器大全
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list