This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Please help : TMS320C6748 to print out images

Hello,

I have 2 questions about C6748.

1. Images are broken when I access the image array using pointers or memcpy

Above image is what i want to print out.

And to reduce the time, I used memcpy.

- This is my code : memcpy(VedioMem[0], TitleImage, 640 * 480 * 2);

- And TitleImage array :

unsigned short int TitleImage[] = {
      640, 480,
      0xCDB1, 0xD5D2, 0xD5F2, 0xD5F2,   0xD5B1, 0xD5D2, 0xD5F2, 0xD5D2,
      0xCDB1, 0xCDD2, 0xD5D2, 0xD5D2,   0xD5D2, 0xD5D2, 0xD5B2, 0xD5B2,
      ...(color info)...
      ...
      ...
}

But image is broken like this.

What is the problem?

2. When I use grlib, I can get unbroken image. But, "DpyPixelDraw" or "GrDrawPixel" is too late to express 640 * 480 pixels.(3xxx milliseconds)

If you have another way to print make shorter, please let me know. Thank you.

  • Hi,

    Thanks for your post.

    This needs to be taken care by the code, please walkthrough the code and catch the pointer to an input image array, then implement the logic to sample and process the image inside the C6748 dsp core which needs to be checked.

    Please keep the buffer to store the image samples and process the image in DSP frame by frame.

    Alternatively, I think, C674x devices are a part of c64x+ devices which does supports DSP IMG library package and you can download the same from the below link:

    http://www.ti.com/tool/sprc264

    May be, you could try optimized general-purpose image/video processing library routines in the above package and with these routines, you can achieve higher performance than equivalent code written in standard C language. By providing ready-to-use DSP functions with source code, IMGLIB can significantly shorten your application development time

    After installing, you could use the c64x+ DSP image library functions in your code by adding the IMGLIB path into your project, so that, it could make your CPU execution more optimized & faster.

    Even you could refer the c64x app. report & library ref. guide as below:

    http://www.ti.com/lit/an/spra887/spra887.pdf

    http://www.ti.com/lit/ug/spru023b/spru023b.pdf

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • Thank you for your reply.

    Actually, I don't need any other special image processing library.
    My main purpose is just drawing an real-time radar image. So only pixel drawing is needed.

    When i draw an 640*480 image, i usually use double for loop and DpyPixelDraw API.
    However, it performs "for loop" almost 300,000 times and spends too much time to draw an 640*480 image array.
    Is there any other ways to reduce the time? (without changing devices)

  • Yejin Kim,

    Do you get the same distorted view each time you do the memcpy? Or will the offset to the start of the image be different each time?

    The memcpy() function is very simple and will do the same thing every time, so this information will help in figuring out what your code is doing incorrectly.

    In CCS, you can display an image from memory. Use this feature to display the TitleImage array to confirm that it is correct.

    Do you need to copy the two size values at the beginning of the TitleImage array? Those are not pixel values and most likely do not belong in the video memory region.

    Check your definition for VedioMem[0] to see if it is in the correct location.

    When you use the "double for loop and DpyPixelDraw", does the image appear correctly? I understand it is slow, but this is for debug purposes.

    Regards,
    RandyP