GIF drawing performance

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • GIF drawing performance

      Hi everyone,

      Got a small animated GIF 240x180 at 30fps played by IMAGE widget via IMAGE_SetGIF.
      The cpu usage turns out a bit higher than expected: 20-80% on stm32f769 with 800x480 screen (the Disco board).

      What would be the best way to use stm32f7's dma2d accelerator for GIF drawing in emWIN, because at the moment in my setup there's no GIF specific help from the hardware.

      Also, is there a better way/format for short videos/animations to be played by emWIN? Would EMF playing be more efficient?

      Many thanks.
    • Hi,

      The best performance will be experienced with 32bpp images generated with the Bitmap converter.

      The image data of the GIF won't be processed with the DMA2D.

      Unfortunately, having the complete GIF animation stored as 32bpp will require a large amount of ROM.

      The hardware you are using has a build in JPEG decoder this allows you to display EMF files quite fast because the JPEG decoding (EMF files are basically JPEG files) will be performed by the hardware.

      Attached is a configuration file which shows how the JPEG decoder could be used with emWin. It was written in combination with our RTOS embOS and it is very likely that you have to modify it.

      The function JPEG_X_Init() needs to be called before displaying a EMF file. Also it needs some heap, we use malloc an free because we wanted to make sure that the internal RAM gets used. If we would use the emWin memory management it might be possible to use external RAM which is way too slow for the decoding process.

      Regards,
      Sven
      Files
      • JPEGConf.zip

        (9.85 kB, downloaded 260 times, last: )
      Please read the forum rules before posting.

      Keep in mind, this is *not* a support forum.
      Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
      Should you be entitled to support you can contact us via our support system: segger.com/ticket/

      Or you can contact us via e-mail.
    • Thanks heaps, that's great. Based on your sample I could get decent performance.

      And when using RGB enconded jpegs instead of YCrCb the performance is even better - full hd 1280x720 EMF videos at 20 frames per second on stm32f7. This using 16bits per pixel and requiring 10MB of storage per 5 seconds, but that's fine for our requirements.

      Thanks once again.