Implement partial jpx-write support and add new opj_merge
utility
#1523
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR I've added partial support for writing jpx files.
What's New
Public API
I've added a new jpx codec which is created when you call
opj_create_compress(OPJ_CODEC_JPX)
.From there the usual interface of
opj_encoder_set_extra_options
,opj_setup_encoder
,opj_start_compress
,opj_end_compress
, should all be called to complete the process.For this codec,
opj_encoder_set_extra_options
is used to specify the list of files that will be merged into the jpx file.Internal Changes
jpx.c
andjpx.h
jp2.c
functions non-static so they could be called fromjpx.c
. Mainly box writing functions.Overview of What I've Done
I manage an application which relies on
kdu_merge -link
. The opj_merge utility I've written has similar behavior as the kdu_merge command. What this merge does, is it creates a jpeg2000 file with only boxes, and no codestreams. The boxes included are:5.1 Each fragment table contains a fragment list box
5.2 Each fragment list box points to a j2k codestream in the jp2 files being merged. Specifically the codestream's file offset and length.
6.1 The association table uses a Number List Box to designate which jp2 the association is being made for
6.2 Any XML boxes in the source jp2s are embedded here. With an association table made for each xml box. If there's no xml box in the source jp2, then no association is added to the jpx.
Partial Support
Next Steps / Things I need help with
opj_merge
with the output ofkdu_merge
. It's not one-to-one since kdu_merge adds in some extra things that I didn't think needed to be there according to the standard. See jp2dump