Skip to main content
Visitor II
February 12, 2025
Question

STM32F7xx JPEG Encoder switches to green if input is extreme red color

  • February 12, 2025
  • 1 reply
  • 395 views

Hello to all,

We encountered a strange behaviour of the ST32F7xx jpeg encoder.
We feed the encoder with RGB data like 0xFF0000 which is pure red.
However the resulting jgp image is green.
Then we gradually reduced the intensity of red like 0xFE0000, 0xFD0000, ..., still same error.
But from 0xFA0000 the red color is correct!!

What can be the reason for this?

We use the software based on the JPEG_EncodingFromFLASH_DMA from ST
Link: https://github.com/STMicroelectronics/STM32CubeF7/tree/master/Projects/STM32F769I_EVAL/Examples/JPEG/JPEG_EncodingFromFLASH_DMA

Thank you for your help
Andy

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    February 12, 2025

    Hello @andywild2 

    This can be related to the JPEG memory requirement.
    To have more details about Hardware JPEG codec peripheral in STM32F7, you can refer to Application note AN4996 "How to use the JPEG codec peripheral on STM32 MCUs".

    andywild2Author
    Visitor II
    February 12, 2025

    Hello Imen.D;
    I scanned the AN4996 for memory requirements. There is no entry about this.
    The quantisation tables are fixed in size and are getting filled by the ST software. Do you mean the buffer sizes for the conversion of RGB to MCU before feeding to the encoder?

    I do not understand we this can be a memory issue.

    I would like to make the error more clear:
    There is a picture of 800*480 pixels. This picture gets basically converted ok, if pixels are not of "extreme" red color.
    So the converter does it´s work ok and obviously has enough memory.
    Now there is line of pixels among these 800*480 pixels which has color code 0xFB0000 (Red).
    This line is then converted to green. If I use then colorcode 0xFA0000, the line is converted to red, all ok.
    So there is just one increment (0xFA0000 to 0xFB0000) to provoke the fault.
    How can this be memory releated?
    Thanks
    Andy