+ Merge pull request #1246 from rouault/write_plt
+
+ Add support for generation of PLT markers in encoder
+
+commit 4edb8c83374f52cd6a8f2c7c875e8ffacccb5fa5
+Author: Even Rouault <even.rouault@spatialys.com>
+Date: 2020-04-21 15:55:44 +0200
+
+ Add support for generation of PLT markers in encoder
+
+ * -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
+
+commit 64689d05dfaaf52105581d93fb1eb173b20829a4
+Author: Even Rouault <even.rouault@spatialys.com>
+Date: 2020-04-18 18:25:44 +0200
+
+ struct opj_j2k: remove unused fields, and add some documentation
+
+commit 774889a328abd5d3c280d9a897f1ac4c672cb0e5
+Merge: b6b7e96 271a71e
+Author: Even Rouault <even.rouault@spatialys.com>
+Date: 2020-04-17 00:39:46 +0200
+
+ Merge pull request #1244 from rouault/fix_pi_warnings
+
+ Fix warnings about signed/unsigned casts in pi.c
+
+commit b6b7e96b0cf7819ef6a2e8ba2f8bdaaf938326ed
+Author: szukw000 <szukw000@arcor.de>
+Date: 2020-04-17 00:37:33 +0200
+
+ color_apply_icc_profile: add checks on the number of components (#1236)
+
+commit 271a71ef0f1dd4740c9f4474279c7da8d15850c9
+Author: Even Rouault <even.rouault@spatialys.com>
+Date: 2020-04-16 20:52:44 +0200
+
+ Fix warnings about signed/unsigned casts in pi.c
+
+commit f3ee448815eb992b8d4746e32c05e8289f30415f
+Author: Sebastian Rasmussen <sebras@gmail.com>
+Date: 2018-10-31 15:56:11 +0100
+
+ openjp2/j2k: Validate all SGcod/SPcod/SPcoc parameter values.
+
+ Previously the multiple component transformation SGcod(C)
+ and wavelet transformation SPcod(H)/SPcoc(E) parameter
+ values were never checked, allowing for out of range values.
+
+ The lack of validation allowed the bit stream provided in
+ issue #1158 through. After this commit an error message
+ points to the marker segments' parameters as being out of
+ range.
+
+ input/nonregression/edf_c2_20.jp2 contains an SPcod(H) value
+ of 17, but according to Table A-20 of the specification only
+ values 0 and 1 are valid. input/nonregression/issue826.jp2
+ contains a SGcod(B) value of 2, but according to Table A-17
+ of the specification only values 0 and 1 are valid.
+ input/nonregression/oss-fuzz2785.jp2 contains a SGcod(B)
+ value of 32, but it is likewise limited to 0 or 1. These test
+ cases have been updated to consistently fail to parse the
+ headers since they contain out of bounds values.
+
+ This fixes issue #1210.