cancel
Showing results for 
Search instead for 
Did you mean: 

Can I convert RGB888 data directly to a JPG file using the JPEG peripheral

Chris Rice
Associate III

Hello, we are using an STM32F7, and we are taking camera data which saves to RGB888 format. We would like to compress this to a JPG file before saving to USB, and I see that there is a JPEG peripheral which looks like it fits the bill. However I see conflicting info on this. On one hand, the JPEG_CONFR1.COLORSPACE register setting seems to provide for RGB data, and on the other hand I see this note from a smart user: "for Encoding operation the JPEG peripheral input should be organized in YCbCr MCU blocks. It is up to the application to perform the necessary RGB to YCbCr MCU blocks transformation before feeding the JPEG peripheral with data"

Is this last sentence true? We are trying to compress our data with hardware acceleration in order to speed up a subsequent transmission to USB. However if our application has to perform its own conversion in series, this may eat up that time savings.

And if it is true, can someone point me in the right direction in terms of how to perform this conversion? Thanks so much. (And happy new year!)

2 REPLIES 2

I don't use the 'F7 (and by 'F7 you here probably mean specifically 'F767 as the lower ones don't have the JPEG unit), but you may want to read AN4996.

JW

Chris Rice
Associate III

Thanks! I was just reading that and I think it confirms that this conversion is necessary... I was thrown off by all the talk of RGB "colorspaces" in the JPEG peripheral discussion (and I'm still not clear on the distinction between colorspaces and input format).