I was searching for a solution to compress a GPU-located buffer with RGB values to a jpeg conform buffer. During my search I came across the nvJPEG library, which I would like to use as well. Unfortunately I noticed quite fast that the JPEG encoder takes data from the host memory, copies it to the GPU, executes the JPEG algorithm and writes results back to the host memory.
Since a data processing algorithm is running before the compression on the GPU, the Bitmap24 data are already located in GPU memory. To avoid unnecessary transfer between host and GPU, I’m looking for a way to give the nvJPEG encoder a data buffer that is located on the GPU.
Neither the nvJPEG documentation nor example codes provide a way to pass a GPU buffer to the nvJPEG encoder.
The resulting function signature for converting BMP24 to JPEG should look like this
void CudaBase::encodeBmpToJpeg(char* idata, char* odata, int width, int height)
Where idata and odata are pointers located in the GPU memory.
My question: Does the nvJPEG library provide an interface for GPU-located input/output data? If not, what could be an alternative to nvJPEG?
Thanks in advance!