Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to find last MCU in JPEG file without parsing whole JPEG?

Status
Not open for further replies.

Terminator3

Advanced Member level 3
Advanced Member level 3
Joined
Feb 25, 2012
Messages
802
Helped
71
Reputation
142
Reaction score
63
Trophy points
1,308
Visit site
Activity points
9,027
Hello! I have device with erroneous JPEG stream, last MCU is filled with debug data of camera, so JPEG decoder algorithm throws an error. Sometimes debug data comes across 0xFFD9 marker (EOI = End of Image). And it can even provide fake marker, like progressive JPEG or something like that, or fake start of image, so it is obvious problem with the camera.

Is there any way to exactly know where is the last 8x8 unit inside the file? Currently overwriting last bytes of data by 0xFF (around 10 bytes) solves the problem, if there any more correct way, i want to ask how to do it.
For example, i want to overwrite last JPEG Minimum Coded Unit (MCU) with previous, but unsure how to do it.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top