There is a new, open source implementation of the JPEG 2000 codec at openjpeg.org. This is more focussed implementation that the jasper reference library, and may offer smaller and faster decode support. At the time of this writing, it doesn't support all the part 2 features required by PDF, like cmyk colour space support, however. It would be nice to support this as alternative to jasper in ghostscript. This bug is to track the project of writing a stream binding to libopenjpeg, similar to sjpx.c and sjpx_luratech.c for the jasper and luratech decoders. A makefile should also be constructed to compile the openjpeg code into ghostscript's monolithic build.
Marking this as suitable for the bounty program. I started on such a binding some months ago but haven't found the time to finish it. Assigning to myself as the likely reviewer.
Assigning myself to this project.
I started /branches/jpx_openjpeg/ and it is r11006 today. This is a current status report. Localcluster reported differences in 14 files. + tests/pdf/j2kp4-file2-ycc-8bpc.pdf + tests/pdf/j2kp4-file9-palette.pdf tests_private/comparefiles/Bug688807.pdf * tests_private/comparefiles/Bug689290.pdf * tests_private/comparefiles/Bug690174.pdf tests_private/comparefiles/jpx-689261.pdf * tests_private/comparefiles/jpx-flowcontrols.pdf * tests_private/comparefiles/jpx-johnny1.pdf * tests_private/pdf/PDFIA1.7_SUBSET/CATX1911.pdf * tests_private/pdf/PDFIA1.7_SUBSET/CATX2045.pdf tests_private/pdf/PDFIA1.7_SUBSET/CATX2071.pdf tests_private/pdf/PDFIA1.7_SUBSET/CATX2374.pdf * tests_private/pdf/PDFIA1.7_SUBSET/CATX5529.pdf * tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf Two files marked (+) are caused by openjpeg limitations. Openjpeg does not support image files with abnormal channel order (j2kp4-file2-ycc-8bpc.pdf), or palette image files (j2kp4-file9-palette.pdf). Files marked (*) rendered gray-ish garbage under some condition. I am still investigating the cause. Files without marks are the difference by decoding library. Some get better, some got worse (in my opinion.)
Please see comment 6 on bug 691122 (http://bugs.ghostscript.com/show_bug.cgi?id=691122#c6) too.
Just for information, we have 24 pdf files uses JPXDecode in our test suite right now. Those are: tests/pdf/j2kp4-file1-srgb-8bpc.pdf tests/pdf/j2kp4-file2-ycc-8bpc.pdf tests/pdf/j2kp4-file3-ycc-8bpc.pdf tests/pdf/j2kp4-file4-gray-8bpc.pdf tests/pdf/j2kp4-file5-icc-3ch-8bpc.pdf tests/pdf/j2kp4-file6-gray-12bpc.pdf tests/pdf/j2kp4-file7-icc-3ch-12bpc.pdf tests/pdf/j2kp4-file8-icc-1ch-8bpc.pdf tests/pdf/j2kp4-file9-palette.pdf tests_private/comparefiles/Bug688159.pdf tests_private/comparefiles/Bug688807.pdf tests_private/comparefiles/Bug689290.pdf tests_private/comparefiles/Bug689362.pdf tests_private/comparefiles/Bug689509.pdf tests_private/comparefiles/Bug690174.pdf tests_private/comparefiles/jpx-689261.pdf tests_private/comparefiles/jpx-flowcontrols.pdf tests_private/comparefiles/jpx-johnny1.pdf tests_private/pdf/PDFIA1.7_SUBSET/CATX1911.pdf tests_private/pdf/PDFIA1.7_SUBSET/CATX2045.pdf tests_private/pdf/PDFIA1.7_SUBSET/CATX2071.pdf tests_private/pdf/PDFIA1.7_SUBSET/CATX2374.pdf tests_private/pdf/PDFIA1.7_SUBSET/CATX5529.pdf tests_private/pdf/PDFIA1.7_SUBSET/IA3Z3225.pdf
Grayish garbage problem was fixed in r11343. Linux machines needed "-std=c99" option to compile openjpeg library. And there's a good news. Coming release of openjpeg 1.4 is going to support palette image.
r11647 (jpx_openjpeg branch) fixes j2kp4-file2-ycc-8bpc.pdf by applying a (modified) patch by Marek Mauder to our copy of openjpeg and making base/sjpx_opj.c respect the component definitions. The patch also adds support for paletted images, but it doesn't work for j2kp4-file9-palette.pdf, yet.
Alex, can you update the status of this problem? We thought openjpeg was done, is anything from this report still needed?
OpenJpeg is done. My recent patch that re-implements 1 bpc, multi-channel image support fixes the last known bug.