Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20704 Discussions

How to Parse a JPEG file instead of PPM

Altera_Forum
Honored Contributor II
1,261 Views

Hello, 

 

I am currently using the sobel filter design example for OpenCL on FPGA application. I notice that there is two cpp files, one for the host and one which handles the parsing of a ppm file. I find the code quite difficult to understand, and don't want to plagiarise the code, and would therefore like to develop one similar that instead parses a jpeg file to improve my coding knowledge., and use that to load a jpeg file for the sobel filter application instead. How could that be achieved? I have attached the parsing cpp code to this thread, as txt file as cpp is invalid file format. Thanks. 

 

Thanks in advance 

OK
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
544 Views

a jpeg image is a compressed image. this means you need to decode the image first. This is more complicated than using the uncompressed ppm format. Decoding the jpeg takes time, so if speed is your goal, you might want this to run on the fpga as well. But if you might be able to only pass the image data (not the encoder data) if the encoder data will be unchanged. The steps you will need to run though are 

jpeg file -> decode -> run filter -> do other stuff
0 Kudos
Reply