Bug 690543 - stream bindings for libopenjpeg
Summary: stream bindings for libopenjpeg
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: master
Hardware: PC Linux
: P4 enhancement
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-16 17:59 UTC by Ralph Giles
Modified: 2012-02-27 00:41 UTC (History)
3 users (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralph Giles 2009-06-16 17:59:48 UTC
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.
Comment 1 Ralph Giles 2009-06-16 18:05:13 UTC
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.
Comment 2 Masaki Ushizaka 2010-02-21 17:58:35 UTC
Assigning myself to this project.
Comment 3 Masaki Ushizaka 2010-04-02 13:08:24 UTC
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.)
Comment 4 Masaki Ushizaka 2010-04-04 12:24:10 UTC
Please see comment 6 on bug 691122 (http://bugs.ghostscript.com/show_bug.cgi?id=691122#c6) too.
Comment 5 Masaki Ushizaka 2010-04-08 06:29:23 UTC
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
Comment 6 Masaki Ushizaka 2010-05-31 13:08:01 UTC
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.
Comment 7 Lars Uebernickel 2010-08-20 20:37:46 UTC
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.
Comment 8 Henry Stiles 2012-02-27 00:28:20 UTC
Alex, can you update the status of this problem?  We thought openjpeg was done, is anything from this report still needed?
Comment 9 Alex Cherepanov 2012-02-27 00:41:22 UTC
OpenJpeg is done.
My recent patch that re-implements 1 bpc, multi-channel image support
fixes the last known bug.