The sobel example code from adi is poor for if you want to use it to process 1k image, you need 6k free stack space .
Many years have past after blackfin'birth , Why adi still got so poor base code ?
Please note that it was implemented keeping in mind the tradeoff's between speed vs. space. There are two loops and the intermediate results needs to be saved somewhere. One option is to store the intermediate result in a temp variable mapped in L1 SRAM memory which will also consume the same amount of space as stack space and permanently use that space or one will have top use overlays to swap that memory space which adds programming efforts. The other option is to write the results to external memory and use cache, which as you can expect will degrade the performance. Also, when cache is used, then the cached data will be wrapped around for images greater than 4K and that will further degrade the performance (Note that your workload is typically exhibiting characteristics of a streaming type data). The way it's designed is assuming that the user will make use of DMA to move macro-block data in and out of L1 (where the full image is stored in SDRAM) and use stack to store temporary data in L1. So ideally one should process macro-block by macro-block of data with this function. There are some examples that you could use which demonstrate the data management with the use of memory DMA's.( Download EE-301 - http://www.analog.com/en/embedded-processing-dsp/blackfin/processors/application-notes/resources/index.html) There are some other examples which show how to overlay macro-blocks to negate the edges between macro-blocks (sort of a motion window type data movement). You can download that code from - (http://em.avnet.com/evk/home/0,1719,RID%253D0%2526CID%253D35741%2526CCD%253DUSA%2526SID%253D32214%2526DID%253DDF2%2526SRT%253D1%2526LID%253D32232%2526PRT%253D0%2526PVW%253D%2526PNT%253D%2526BID%253DDF2%2526CTP%253DEVK,00.html?cmp=AOD-btwvideo) once you register on Avnet.
Hope this helps.
Thank you for giving this useful reference . I will read it to find what is the answer. Despite the result , I think it is a good start point. Thanks.
Questions like this are very frustrating. You received an answer more gracious than you deserve; these ADI guys are very nice. If the example code is "poor", then write your own code. If that doesn't sound like fun, then maybe you are in the wrong line of work.
Retrieving data ...