Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-8600

QJpegHandler is creating and destroying the jpeg (de)compressor multiple times

    XMLWordPrintable

Details

    • Task
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • None
    • Image formats
    • None

    Description

      Currently QtWebKit's ImageDecoderQt.cpp is asking for the ImageSize, the ImageFormat and later decoding asking to decode the image itself. The QJpegHandler will call read_jpeg_format, read_jpeg_size and read_jpeg_image which will create and destroy the JPEG decompressor three times for every JPEG image.

      The boilerplate code for read_jpeg_format and read_jpeg_size is the same and the extra init of the decompressor could be saved. On top of that even the read_jpeg_image could use the same decompressor. One thing to get right though is that one can set "scaling" on the image, so the jpeg_calc_output_dimensions method needs to be called from the read_jpeg_image with updated information. From a quick look at the libjpeg code this seems to be allowed and possible.

      A quick hack showed a promising improvement on the "image_cycling" test case.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            albisser Zeno Albisser
            holger Holger Freyther
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes