Opening an image file direct from GPU


Ive been searching for a good way to open and show an jpeg image in a way that doesnt use the cpu. Searching this because the cpu high processing rates is keeping me from increase my frame rate.

Unfortunately, jpeg is my only option in the moment.

After my search about nVidia, nForce, CUDA i have a question for advance users.
I wanted to know if is a good shot to try to implement jpeg decoder using CUDA to throw the hard work to gpu or is there a best way to gain performance?


Before you start implementing a jpeg decoder you should take some time to measure how fast a good cpu implementation performs. Since you aim for high frame rates, I assume you want to implement some kind of video player. In this case you can use openGL to display the decoded frames instead of uploading the decoded frames back to host memory.
Having thought about this for 2 minutes, my strategy would probobaly be to download the the compressed jpeg file to GPU memory and launch a thread for each 8x8 block, undoing the huffmann compression. Afterwards you either have the same thread do the whole 8x8 iDCT or start another kernel with a thread per pixel and per component. You have to figure out what’s faster. Finally you will want to spawn a last kernel with a thread per pixel that does your YCbCr->RGB color conversion, possible already writing the output to a mapped OpenGL PBO.

If you google for “jpeg cuda”, you will find that you’re not the first one to consider implementing a decoder with cuda.