openjpeg/tests
Even Rouault 4edb8c8337
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
2020-04-21 15:55:44 +02:00
..
conformance Spelling fixes (patch by ka7, #890, rebased on top of master) 2017-07-26 21:06:38 +02:00
fuzzers tests/fuzzers: link fuzz binaries using $LIB_FUZZING_ENGINE. (#1230) 2020-01-13 18:07:54 +01:00
nonregression Add support for generation of PLT markers in encoder 2020-04-21 15:55:44 +02:00
performance perf_test.py: implement -i option 2017-05-11 20:18:42 +02:00
profiling Add profiling of CPU and memory usage (#912) 2017-05-09 12:35:51 +02:00
unit Use lowercase for cmake commands consistenly 2016-05-02 16:05:41 +02:00
CMakeLists.txt Allow several repeated calls to opj_set_decode_area() and opj_decode() for single-tiled images 2017-09-01 16:30:48 +02:00
compare_dump_files.c Add sanity check for tile coordinates (#823) 2016-09-08 00:24:15 +02:00
compare_images.c Update lcms (#544) 2016-04-30 17:58:04 +02:00
compare_raw_files.c [trunk] fixed return value for compare_raw_files (fixes issue 453) 2014-12-20 12:42:40 +00:00
include_openjpeg.c Add compilation test for standalone inclusion of openjpeg.h (#798) 2016-07-14 11:06:26 +02:00
j2k_random_tile_access.c [trunk]Replaced deprecated opj_stream_set_user_data function from API 2014-04-23 07:46:11 +00:00
pdf2jp2.c trunk: extend support for pdf2jp2 2014-09-19 15:48:48 +00:00
ppm2rgb3.c [trunk] Add documentation 2014-03-25 10:22:40 +00:00
test_decode_area.c test_decode_area.c: assign tdy to *ptileh instead of *ptilew (fixes #1195) 2019-05-26 11:06:30 +02:00
test_tile_decoder.c Fix some issues reported by Coverity Scan (#846) 2016-09-21 21:15:25 +02:00
test_tile_encoder.c test_tile_encoder: fix checks on argc 2017-08-21 23:06:53 +02:00