Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can GPU computing power be used for image conversion(tiff to jpeg)? if yes how to achieve it

Tags:

java

gpu

gpuimage

In my scenario I fetch screen from a device(it only produces tiff image) and transfer it to jpeg and sent it over network to the client(client only support jpeg encoding)

java code
    public byte[] getscreen(){
    /*
    logic for fetching tiff image from the device
    */
     if(tiffimage == null )
     return null;
     byteOutput = new ByteArrayOutputStream();
     ImageIO.write(tiffImage, "jpeg", byteOutput);
    return byteOutput;
    }

For the device to produce the image it's taking 10ms - 1 sec depending on the resolution of the device (please note no change can be done at this side, it produces only tiff image) and the size is from 3 MB -12 MB depending on the resolution.

Now converting the image to JPEG is taking some time. my query is, can we use the GPU power for converting the image from tiff to JPEG so that i can get improved FPS in my client side?

P.S: The application is running in various machines which have graphics cards such as (NVDIA, AMD,Intel HD graphics) I want to know whether this can be done, if so how to approach the solution.

like image 989
pavan Avatar asked Jan 05 '16 09:01

pavan


1 Answers

MPEG is roughly about just that: a lot of JPEG image encoding operations one after another, plus some logic involving differences for P frames, etc. I wrote a simple MPEG encoder using a GPU once, which gave some speedup factor (don't remember exactly by how much though). That said, in order to properly answer your question: yes, there might be some time difference, but for one picture only, that difference is probably negligible, including offset times for offloading the picture data to the GPU device, etc.

like image 83
gustafbstrom Avatar answered Oct 14 '22 11:10

gustafbstrom