Menu

#22 Compress YUV image

closed-implemented
nobody
None
1
2014-03-27
2013-08-16
No

It would be nice to have a function able to compress a YUV pixmap to a JPEG file. I'm using libjpeg-turbo to reduce image size to a smaller one using the scale factor. I saw that since 1.4, ii is possible to use scale factor when decoding to a YUV image, so I think i can save a lot of time if I can directly compress a YUV image. This will avoid the RGB conversion step.

Discussion

  • DRC

    DRC - 2013-08-16

    I agree, but this is one of those projects that someone is going to have to sponsor, because none of my paying customers need that functionality at the moment. It is a relatively straightforward modification, since the underlying libjpeg API provides an interface for compressing YUV planar data.

    One caveat is that the padding restrictions are stricter when compressing from YUV planar than when decompressing to YUV planar. The hypothetical tjCompressFromYUV() function would require the planar data to be padded out to MCU boundaries, so unless the YUV data you got out of tjDecompressToYUV() was appropriately padded, you might have to copy it into another buffer prior to re-compressing. Still less CPU overhead than taking it all the way to RGB and back, though.

     
  • DRC

    DRC - 2013-11-05

    Someone stepped up to sponsor this technology, so it is now available in SVN trunk. Enjoy!

     
  • DRC

    DRC - 2013-11-05
    • status: open --> closed
     
  • DRC

    DRC - 2014-03-27
    • status: closed --> closed-implemented
     
Auth0 Logo