<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openjpeg/src/lib/openjp2/tcd.h, branch floating_point_irreversible_encoding</title>
<subtitle>Fork of openjpeg library for JPEG2000 encoding and decoding</subtitle>
<id>https://git.carlh.net/cgit/openjpeg/atom?h=floating_point_irreversible_encoding</id>
<link rel='self' href='https://git.carlh.net/cgit/openjpeg/atom?h=floating_point_irreversible_encoding'/>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/'/>
<updated>2020-04-21T13:55:44Z</updated>
<entry>
<title>Add support for generation of PLT markers in encoder</title>
<updated>2020-04-21T13:55:44Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2020-04-21T13:55:44Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=4edb8c83374f52cd6a8f2c7c875e8ffacccb5fa5'/>
<id>urn:sha1:4edb8c83374f52cd6a8f2c7c875e8ffacccb5fa5</id>
<content type='text'>
* -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 &gt; /tmp/dump_sentinel2_ori.txt
python dump_jp2.py T36JTT_20160914T074612_B02_PLT.jp2 &gt; /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 &amp;&amp; echo "same !"
```

-------

Funded by ESA for S2-MPC project
</content>
</entry>
<entry>
<title>Rename mis-named function opj_tcd_get_encoded_tile_size() to opj_tcd_get_encoder_input_buffer_size()</title>
<updated>2020-04-16T18:33:22Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2020-04-16T18:33:22Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=221a801a97a3ea968a311f7905c18a1eb7f034c4'/>
<id>urn:sha1:221a801a97a3ea968a311f7905c18a1eb7f034c4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add capability to decode only a subset of all components of an image.</title>
<updated>2017-09-19T15:06:19Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2017-09-19T14:52:07Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=7e2b6bebff12eab8bdc17fc9af017e8c11652f4f'/>
<id>urn:sha1:7e2b6bebff12eab8bdc17fc9af017e8c11652f4f</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Various changes to allow tile buffers of more than 4giga pixels</title>
<updated>2017-09-01T14:30:44Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2017-09-01T14:30:44Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=98b93103613c90753fb6c57696f9403f8ea0b1d6'/>
<id>urn:sha1:98b93103613c90753fb6c57696f9403f8ea0b1d6</id>
<content type='text'>
Untested though, since that means a tile buffer of at least 16 GB. So
there might be places where uint32 overflow on multiplication still occur...
</content>
</entry>
<entry>
<title>TCD: allow tile buffer to be greater than 4GB on 64 bit hosts (but number of pixels must remain under 4 billion)</title>
<updated>2017-09-01T14:30:41Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2017-09-01T14:30:41Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=008a12d4fce0a7b1eabc51e04ed339be759646e2'/>
<id>urn:sha1:008a12d4fce0a7b1eabc51e04ed339be759646e2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Sub-tile decoding: only allocate tile component buffer of the needed dimension</title>
<updated>2017-09-01T14:30:29Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2017-09-01T14:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=f9e9942330f476b66ac4a35d0ae521200878f343'/>
<id>urn:sha1:f9e9942330f476b66ac4a35d0ae521200878f343</id>
<content type='text'>
Instead of being the full tile size.

* Use a sparse array mechanism to store code-blocks and intermediate stages of
  IDWT.
* IDWT, DC level shift and MCT stages are done just on that smaller array.
* Improve copy of tile component array to final image, by saving an intermediate
  buffer.
* For full-tile decoding at reduced resolution, only allocate the tile buffer to
  the reduced size, instead of the full-resolution size.
</content>
</entry>
<entry>
<title>Add comment</title>
<updated>2017-08-21T15:19:13Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2017-08-21T15:19:13Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=24d069e3ffa2286930a2e7e2638431ea1de6846a'/>
<id>urn:sha1:24d069e3ffa2286930a2e7e2638431ea1de6846a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Sub-tile decoding: only decode precincts and codeblocks that intersect the window specified in opj_set_decode_area()</title>
<updated>2017-08-17T17:05:54Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2017-08-14T11:23:57Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=fe338a057c39797bf61939471ebaef09e44464c7'/>
<id>urn:sha1:fe338a057c39797bf61939471ebaef09e44464c7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Propagate event manager down to opj_t2_encode_packet() and use it to emit an error message when the output buffer is too small</title>
<updated>2017-08-10T14:49:47Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2017-08-10T14:49:47Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=0b4fef6d1901254e41ab74ed681daba477d724c3'/>
<id>urn:sha1:0b4fef6d1901254e41ab74ed681daba477d724c3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove useless opj_tcd_t::enumcs field added per #975</title>
<updated>2017-08-09T15:37:05Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2017-08-09T15:37:05Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=4b16e8d27ae524c5bf5f8af299703f7334752465'/>
<id>urn:sha1:4b16e8d27ae524c5bf5f8af299703f7334752465</id>
<content type='text'>
</content>
</entry>
</feed>
