cancel
Showing results for 
Search instead for 
Did you mean: 

why stm32f7 hardware JPEG can't read header?

eem
Associate

hi.i work with stm32f767IG and it's hardware JPEG.i write code like stmcube EVAL board JPEG example. in some cases and pictures, header data ready flag is set and i receive interrupt but returned values like image width and height etc are all zero.but when i open image with paint and just save it and use it again all header values get right .i want to know why this happen and how i can handle it . can anyone guide me?

i attached mentioned image below.

6 REPLIES 6
AvaTar
Lead

The STM32F7 MCU has no JPEG hardware I know of.

> .i write code like stmcube EVAL board JPEG example.

Cube code/examples might have bugs.

> The STM32F7 MCU has no JPEG hardware I know of.

From RM0410 reference manual:

21 JPEG codec (JPEG) [Click Show More]

21.1 Introduction

The hardware 8-bit JPEG codec encodes uncompressed image data stream or decodes JPEG-compressed image data stream. It also fully manages JPEG headers.

> but when i open image with paint and just save it and use it again all header values get right

Maybe the original image header has some fluctuations from the standard, or maybe the JPEG decoder has issues with some edge cases, it's hard to tell. You could compare byte-by-byte the working and not working JPEGs headers to find the differences. And make sure to check the errata document of your MCU model.

> 21 JPEG codec (JPEG) [Click Show More]

Didn't catch that. And still wondering about the fancy hardware ST puts in some of it's MCUs.

I'd like to know how it sells ...

> Maybe the original image header has some fluctuations from the standard, or maybe the JPEG decoder has issues with some edge cases, it's hard to tell.

Factual deviations from standards are commonplace in the industry, market power usual trumps conformity. And complex peripherals tend to have issues, too.

I would try debugging the code, and see where it bails out.

After conducting the due diligence, and checking the errata of course.

thanks for your answer. but when i use libjpeg to get header it returns correct values. i want to know that is it possible to get header info with libjpeg and then give it to hardware jpeg to decode image?

frackers
Senior

I've hit the same problem - anyone any ideas?

h2obrain
Associate II

I think the jpeg-codec in stm32[fh]7 does only support jpegs with baseline compression (and not progressive, 3rd paragraph in this wiki article).

At least my jpegs started to get parsed, when I saved it in GIMP with the progressive option unticked.