Can a high-performance jpeglib-turbo implmentation decompress/compress in <100ms?

后端 未结 1 432
栀梦
栀梦 2021-01-03 05:30

I\'m currently implementing a jpeg resizer in C++ using the jpeglib-turbo library.

I\'ve been given the target of 100 milli-seconds for JPEG decompression and recomp

相关标签:
1条回答
  • 2021-01-03 05:49

    Thanks for the answers.

    It is actually possible to decompress and re-compress in around 100ms. After contacting the writer of libjpeg-turbo he told me that the dinfo.scale_num property I was using was wrong. This property is the scale numerator - I also needed to set the scale_denom (denominator) property.

    So the good code would be:

     dinfo.dct_method = JDCT_IFAST;
     dinfo.do_fancy_upsampling = FALSE;
     dinfo.two_pass_quantize = FALSE;
     dinfo.dither_mode = JDITHER_ORDERED;
     dinfo.scale_num = 1;
     dinfo.scale_denom = 8;
    

    I want the code to be so fast as the image scaling should be imperceptible for the user as it's in a client application where speed/user-experience is the most important thing.

    0 讨论(0)
提交回复
热议问题