summaryrefslogtreecommitdiff
path: root/src/lib/openjp2/openjpeg.h
AgeCommit message (Collapse)Author
2024-02-28Fix some typos (found by `codespell` and `typos`)Stefan Weil
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2024-02-27openjpeg.h: make sure to include opj_config.h (fixes #1514)Even Rouault
It was previously included by openjpeg.h
2023-09-24Require `stdint.h` & `inttypes.h`mayeut
With #1450 which goes with 480cc9d49775d018c19ce0e01f6be27858d63d39 "Remove support for non-C99 compilers (like VS2010) that don't support snprintf()", support for MSVC versions prior to vs2015 is dropped: https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010 This means that all supported MSVC versions do have `stdint.h` & `inttypes.h` now. For non windows platforms, those headers were already mandatory. Make them mandatory for all builds.
2022-08-11Cleanup code related to quality layer allocation, and add a few safety checksEven Rouault
2022-02-10Add support for partial bitstream decoding (#1407) (fixes #715)Robert Gabriel Jakabosky
Add a -allow-partial option to opj_decompress utility and a opj_decoder_set_strict_mode() option to the API Co-authored-by: Chris Hafey <chafey@gmail.com>
2022-01-23opj_encoder_set_extra_options(): add a GUARD_BITS=value optionEven Rouault
and add a -GuardBits option to opj_compress. The recently-released SMPTE DCP Bv2.1 Application Profile (link below) says that the number of guard bits in the QCD marker shall be 1 for 2K content and 2 for 4K content. This change allows the number of guard bits to be configured, so that users of openjpeg have the control they need to meet the specification. https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9161348 This is an alternative implementation of https://github.com/uclouvain/openjpeg/pull/1388 that keeps ABI unchanged.
2021-12-05Fix some typos (found by codespell)Stefan Weil
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-10-21API: deprecate 'bpp' member in favor of 'prec'Even Rouault
in opj_image_comp and opj_image_comptparm structures. bpp was redundant with prec, and almost never set by the library, except by opj_image_create(). This change should hopefully not impact existing, working, users of the API, which should already have used prec to get things working. Fixes #1379
2021-06-07Add support for enabling generation of TLM markers in encoderEven Rouault
Support was already there, but restricted to Cinema and IMF profiles, and 255 tiles * Add -TLM switch added to opj_compress * Make opj_encoder_set_extra_options() function accept a TLM=YES option.
2020-12-21Change defined WIN32Jamaika1
2020-05-20Add multithreading support in the T1 (entropy phase) encoderEven Rouault
- API wise, opj_codec_set_threads() can be used on the encoding side - opj_compress has a -threads switch similar to opj_uncompress
2020-04-21Add support for generation of PLT markers in encoderEven Rouault
* -PLT switch added to opj_compress * Add a opj_encoder_set_extra_options() function that accepts a PLT=YES option, and could be expanded later for other uses. ------- Testing with a Sentinel2 10m band, T36JTT_20160914T074612_B02.jp2, coming from S2A_MSIL1C_20160914T074612_N0204_R135_T36JTT_20160914T081456.SAFE Decompress it to TIFF: ``` opj_uncompress -i T36JTT_20160914T074612_B02.jp2 -o T36JTT_20160914T074612_B02.tif ``` Recompress it with similar parameters as original: ``` opj_compress -n 5 -c [256,256],[256,256],[256,256],[256,256],[256,256] -t 1024,1024 -PLT -i T36JTT_20160914T074612_B02.tif -o T36JTT_20160914T074612_B02_PLT.jp2 ``` Dump codestream detail with GDAL dump_jp2.py utility (https://github.com/OSGeo/gdal/blob/master/gdal/swig/python/samples/dump_jp2.py) ``` python dump_jp2.py T36JTT_20160914T074612_B02.jp2 > /tmp/dump_sentinel2_ori.txt python dump_jp2.py T36JTT_20160914T074612_B02_PLT.jp2 > /tmp/dump_sentinel2_openjpeg_plt.txt ``` The diff between both show very similar structure, and identical number of packets in PLT markers Now testing with Kakadu (KDU803_Demo_Apps_for_Linux-x86-64_200210) Full file decompression: ``` kdu_expand -i T36JTT_20160914T074612_B02_PLT.jp2 -o tmp.tif Consumed 121 tile-part(s) from a total of 121 tile(s). Consumed 80,318,806 codestream bytes (excluding any file format) = 5.329697 bits/pel. Processed using the multi-threaded environment, with 8 parallel threads of execution ``` Partial decompresson (presumably using PLT markers): ``` kdu_expand -i T36JTT_20160914T074612_B02.jp2 -o tmp.pgm -region "{0.5,0.5},{0.01,0.01}" kdu_expand -i T36JTT_20160914T074612_B02_PLT.jp2 -o tmp2.pgm -region "{0.5,0.5},{0.01,0.01}" diff tmp.pgm tmp2.pgm && echo "same !" ``` ------- Funded by ESA for S2-MPC project
2020-04-16Fix warnings about signed/unsigned casts in pi.cEven Rouault
2020-02-12Implement writing of IMF profilesEven Rouault
Add -IMF switch to opj_compress as well
2020-02-12openjpeg.h: fix values of OPJ_PROFILE_IMF_ constantsEven Rouault
2019-04-25Change opj_j2k_check_poc_val() to take into account tile numberEven Rouault
2018-09-05Fix some typos in code comments and documentationStefan Weil
All typos were found by Codespell. Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-01-18Note that seek uses SEEK_SET behavior.Campbell Barton
2017-10-12Improve doc of opj_codec_set_threads()Even Rouault
2017-09-19opj_set_decoded_components(): add a provision for a apply_color_transforms ↵Even Rouault
parameter in case we support it in the future
2017-09-19Add capability to decode only a subset of all components of an image.Even Rouault
This adds a opj_set_decoded_components(opj_codec_t *p_codec, OPJ_UINT32 numcomps, const OPJ_UINT32* comps_indices) function, and equivalent "opj_decompress -c compno[,compno]*" option. When specified, neither the MCT transform nor JP2 channel transformations will be applied. Tests added for various combinations of whole image vs tiled-based decoding, full or reduced resolution, use of decode area or not.
2017-09-05Merge pull request #1010 from rouault/subtile_decoding_stage3Even Rouault
Subtile decoding: memory use reduction and perf improvements
2017-09-01opj_compress help: revert 32572617765cb9d77302384653a48d793b8f657f and ↵Even Rouault
indicate 1 again as being the value to get lossless for -r. In opj_j2k_setup_encoder(), make sure that ll rates[] <= 1.0 are set to 0. Document 0 as being lossless for -q / tcp_distoratio (#1009)
2017-09-01Allow several repeated calls to opj_set_decode_area() and opj_decode() for ↵Even Rouault
single-tiled images * Only works for single-tiled images --> will error out cleanly, as currently in other cases * Save re-reading the codestream for the tile, and re-use code-blocks of the previous decoding pass. * Future improvements might involve improving opj_decompress, and the image writing logic, to use this strategy.
2017-08-28Make opj_set_decode_area() and opj_decode() take into account ↵Even Rouault
opj_set_decoded_resolution_factor() (#1006, affect API use) * Better document usage of opj_set_decode_area(), ie expecting coordinates in full resolution/reference grid even if requesting at a lower resolution factor * Make sure that image->comps[].factor is set by opj_set_decode_area() and opj_decode() from the value specified in opj_set_decoded_resolution_factor() * opj_decompress: add 2 environmenet variables to test alternate ways of using the API, namely USE_OPJ_SET_DECODED_RESOLUTION_FACTOR=YES to use opj_set_decoded_resolution_factor() instead of parameters.cp_reduce, and SKIP_OPJ_SET_DECODE_AREA=YES to not call opj_set_decode_area() if -d is not specified.
2017-08-10Improve doc of opj_tccp_info_t::cblkw and cblkhEven Rouault
2017-08-09Document qmfbid valuesEven Rouault
2017-08-08Merge pull request #975 from szukw000/changes-for-afl-testsAntonin Descampe
Catch images broken by AFL
2017-08-07Add opj_image_data_alloc() / opj_image_data_free()Even Rouault
As bin/common/color.c used to directly call malloc()/free(), we need to export functions dedicated to allocating/freeing image component data.
2017-08-02First change on changes-for-afl-testsszukw000
2017-07-31Catch images broken by AFLszukw000
2017-07-30Fix Doxygen warnings (patch derived from Winfried's doxygen-dif.txt.zip, #849)Even Rouault
2017-07-26Spelling fixes (patch by ka7, #890, rebased on top of master)Even Rouault
2017-05-15Reformat: apply reformattin on .h files (#128)Even Rouault
2016-05-25Add opj_codec_set_threads() in public API and propagate resulting thread ↵Even Rouault
pool to tcd level By default, only the main thread is used. If opj_codec_set_threads() is not used, but the OPJ_NUM_THREADS environment variable is set, its value will be used to initialize the number of threads. The value can be either an integer number, or "ALL_CPUS". If OPJ_NUM_THREADS is set and this function is called, this function will override the behaviour of the environment variable.
2016-05-25Add threading and thread pool APIEven Rouault
2015-09-29Fix typos in comments and stringStefan Weil
Most typos were found by codespell. Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-01-25[trunk] use hidden visibility for static library (fixes issue 354)Matthieu Darbois
2014-04-23[trunk]Replaced deprecated opj_stream_set_user_data function from APIAntonin Descampe
with its 'v3' version, and removed all other 'v3' suffixes from API.
2014-04-17[trunk] fixed warning related to r2837 and move new field at the end ofAntonin Descampe
parameters structure.
2014-04-17[trunk] refactoring of rsiz, profiles, and extensions managementAntonin Descampe
2014-04-03[trunk] updated copyright and added copyright notice required by ISO, in ↵Antonin Descampe
each file; updated AUTHORS, NEWS
2014-03-25[trunk] Rework previous commit r2610Mathieu Malaterre
This way we are able to gently deprecate the old API, and preserve ABI Update issue 306
2014-03-14[trunk] Add internal implementation to dump all tiles/comp infoMathieu Malaterre
Eg: opj_dump -f 8 -i input.j2k Update issue 3
2014-03-14[trunk] Move INLINE definition within openjpeg.h header since application ↵Mathieu Malaterre
may use it
2014-03-07[trunk] un-deprecated opj_stream_destroy API, import patch manuallyMathieu Malaterre
In some case user still want to be able to call opj_stream_destroy. Fixes issue 227
2014-03-03[trunk] remove all api with invalid FILE* parameters which could leads to ↵Mathieu Malaterre
issues when applications are compiled with different flags from openjpeg. Fixes issue 198
2014-02-26[trunk] Import patch from sumatrapdf team. This patch adds new colorspace ↵Mathieu Malaterre
handling. Update issue 225
2014-02-26[trunk] Import patch from sumatrapdf team. This adds alpha handling. This ↵Mathieu Malaterre
patch changes ABI. Update issue 225
2013-02-18[trunk] add the prefix opj_ to deprecated everywhereMickael Savinaud