Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2962

Handle TIFF predictor for bpc 2 and 4 / optimize existing predictor code

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.8.10, 1.8.11, 2.0.0
    • 1.8.11, 2.0.0
    • Rendering
    • None

    Description

      I created code that will work for TIFF predictors with bpc 2 and 4. Because there are no test images, the code is written so that it can work with bpc 1, 2, 4 and 8 (but not 16) and has been tested on what we have, which are the corner cases bpc 1 and 8. The bit sequence retrieval / assignment methods have tests so the risk is small.

      If anyone wants to optimize the new code, it should be retested with the same method, i.e. disable the (faster) code for bpc 1 and 8. And if it comes out that optimization went wrong, we'll still have this code as a fallback. However optimization isn't really needed, almost all files "in the wild" are bpc 8.

      I also did some slight optimizations of the existing code, p - bytesPerPixel >= 0 ? ... can be removed by starting the for loop at bytesPerPixel.

      Attachments

        Issue Links

          Activity

            People

              tilman Tilman Hausherr
              tilman Tilman Hausherr
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: