Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
733 Views

How to Parse a JPEG file instead of PPM

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 I
16 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