Menu

Encoding image sizes efficiently

2016-02-26
2016-03-09
  • Florian Link

    Florian Link - 2016-02-26

    First of all, thanks for this great library. I tried it and got a speedup of factor 20 compared to libJPEGTurbo.

    In my project, the image sizes vary, because we also send partial updates of large images.
    If I understand the current Api right, I need to create a new encoder for each image size,
    which seems to be quite some overhead when sizes change a lot.
    Could this be changed to create an encoder with a maximum image size and reuse the same encoder with different image sizes? The cuda buffers could be reused for all kinds of image sizes smaller than the maximum one.
    This would require adding the image size to the image data setter/struct.

    What do you think about this?

     
  • Martin Srom

    Martin Srom - 2016-02-29

    Hi Florian,
    In the past we also needed the GPUJPEG encoder to be able to encode various image sizes and thus we already made appropriate modifications. You can find it in branch "enc-various-imgs", but keep in mind that only encoder was modified this way.

     
  • Florian Link

    Florian Link - 2016-03-02

    Thanks, I now use that branch and it works fine. I did some minor fixes to make it run on Windows
    (sqrt needs double or float on VC++, otherwise it is ambiguous) and to support GLEW and disable X11
    via DEFINES.

    I attached a patch with my changes.

     
  • Florian Link

    Florian Link - 2016-03-09

    Do you plan to support different image sizes in the decoder as well?

    I had a look at the decoder source code but I had problems understanding which buffers are affected by the image width and height and how that could be changed to reuse buffers if the data fits.

     
    • Martin Srom

      Martin Srom - 2016-03-09

      I didn't plan it yet to support different image sizes in decoder. But it should be easier to implement than in encoder.
      Do you need it for personal or commercial use?

       

Log in to post a comment.