cancel
Showing results for 
Search instead for 
Did you mean: 

F7 hardware jpeg encoding colour failure

frackers
Senior

If I try to encode blocks of colour using the hardware JPEG encode in an F7 from a BMP image (screen memory in this case) they fail if the colour is pure (e.g. all red, all blue) and they come out different shades of green.

By experiment, I have found that extra bits have to be set for the encode to succeed.

Colour    Pure code      Code that encodes correctly
 red         0xff0000                          0xff0202
 green    0x00ff00                          0x02ff02
 blue      0x0000ff                           0x0202ff

Attached is a jpeg captured by the hardware encoder where the first 3 blocks are 'pure' colours and the other 3 are with the extra bits set.

Is this a limitaion of the encoder or should I be using something other than

#define JPEG_CHROMA_SAMPLING     JPEG_420_SUBSAMPLING
#define JPEG_COLOR_SPACE         JPEG_YCBCR_COLORSPACE  
#define JPEG_IMAGE_QUALITY       75

in the encoder config.

Thanks

1 REPLY 1
Bouraoui Chemli
ST Employee

Hi @frackers​ 

It can be related to the JPEG memory requirement...

For more details about Hardware JPEG codec peripheral in STM32F7, you can refer to Application note AN4996.

Also, you may refer to the last STM32CubeF7 firmware package and have a look to the JPEG example under: STM32Cube_FW_F7_Vxx\Projects\STM32F769I_EVAL\Examples\JPEG

Bouraoui