Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue using coder BYPASS (-M 1) #209

Closed
gcode-importer opened this issue Feb 7, 2013 · 9 comments
Closed

Issue using coder BYPASS (-M 1) #209

gcode-importer opened this issue Feb 7, 2013 · 9 comments

Comments

@gcode-importer
Copy link

Originally reported on Google Code with ID 209

I am seeing artifacting when encoding with a self compiled OpenJPEG 1.5.1 on Debian.


Encoding ~4500x6000 greyscale tiffs with the following options results in artifacts
in the output jp2 files:
-I -p RPCL -n 6 -EPH -SOP -c [256,256],[256,256],[128,128],[128,128],[128,128],[128,128]
-b 64,64 -M 1 -r 320,160,80,40,20,11.25,7,4.6,3.4,2.75,2.4,1

When encoded with these settings all files have artifacts and one file cannot be opened
at all, despite jpylyzer reporting the headers as valid.  Changing the parameters to
-n 7 allows that file to be opened but it still shows the same artifacts as other files.

No artifacts are apparent when coder bypass is removed from the parameters.


Reported by [email protected] on 2013-02-07 14:30:50

@gcode-importer
Copy link
Author

Reported by malaterre on 2014-02-25 15:32:21

  • Labels added: Priority-High, Milestone-Release2.1
  • Labels removed: Priority-Medium

@gcode-importer
Copy link
Author

$ wget http://merovingio.c2rmf.cnrs.fr/iipimage/PalaisDuLouvre.tif
$ tiffcp PalaisDuLouvre.tif,0 out.tif
$ convert out.tif   -colorspace gray test.tif
$ valgrind ./bin/opj_compress -i test.tif -o test.jp2 -I -p RPCL -n 6 -EPH -SOP -c
[256,256],[256,256],[128,128],[128,128],[128,128],[128,128] -b 64,64 -M 1 -r  320,160,80,40,20,11.25,7,4.6,3.4,2.75,2.4,1
==31712== Memcheck, a memory error detector
==31712== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==31712== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==31712== Command: ./bin/opj_compress -i test.tif -o test.jp2 -I -p RPCL -n 6 -EPH
-SOP -c [256,256],[256,256],[128,128],[128,128],[128,128],[128,128] -b 64,64 -M 1 -r
320,160,80,40,20,11.25,7,4.6,3.4,2.75,2.4,1
==31712== 

[INFO] tile number 1 / 1
==31712== Conditional jump or move depends on uninitialised value(s)
==31712==    at 0x4E63336: opj_t1_encode_cblk (t1.c:1674)
==31712==    by 0x4E62DB2: opj_t1_encode_cblks (t1.c:1523)
==31712==    by 0x4E6BACC: opj_tcd_t1_encode (tcd.c:1958)
==31712==    by 0x4E6A441: opj_tcd_encode_tile (tcd.c:1155)
==31712==    by 0x4E42670: opj_j2k_write_sod (j2k.c:4207)
==31712==    by 0x4E50603: opj_j2k_write_first_tile_part (j2k.c:9823)
==31712==    by 0x4E500DF: opj_j2k_post_write_tile (j2k.c:9664)
==31712==    by 0x4E4F925: opj_j2k_encode (j2k.c:9441)
==31712==    by 0x4E53FA6: opj_jp2_encode (jp2.c:1651)
==31712==    by 0x4E591F0: opj_encode (openjpeg.c:853)
==31712==    by 0x406CBC: main (opj_compress.c:1682)
==31712== 
==31712== Conditional jump or move depends on uninitialised value(s)
==31712==    at 0x4E57699: opj_mqc_byteout (mqc.c:200)
==31712==    by 0x4E57E7E: opj_mqc_flush (mqc.c:401)
==31712==    by 0x4E631A1: opj_t1_encode_cblk (t1.c:1631)
==31712==    by 0x4E62DB2: opj_t1_encode_cblks (t1.c:1523)
==31712==    by 0x4E6BACC: opj_tcd_t1_encode (tcd.c:1958)
==31712==    by 0x4E6A441: opj_tcd_encode_tile (tcd.c:1155)
==31712==    by 0x4E42670: opj_j2k_write_sod (j2k.c:4207)
==31712==    by 0x4E50603: opj_j2k_write_first_tile_part (j2k.c:9823)
==31712==    by 0x4E500DF: opj_j2k_post_write_tile (j2k.c:9664)
==31712==    by 0x4E4F925: opj_j2k_encode (j2k.c:9441)
==31712==    by 0x4E53FA6: opj_jp2_encode (jp2.c:1651)
==31712==    by 0x4E591F0: opj_encode (openjpeg.c:853)

Reported by malaterre on 2014-02-27 10:31:36

  • Status changed: Started

@gcode-importer
Copy link
Author

Removing -M 1 do indeed produces proper result (at least not bad).

Reported by malaterre on 2014-02-27 10:34:38

@gcode-importer
Copy link
Author

When using BYPASS mode, there is one more byte read (cp is 13 instead of 12). I could
not figure out where the invalid initialization is coding from anyway.

Reported by malaterre on 2014-02-28 10:37:24

@gcode-importer
Copy link
Author

Reduced test case:

$ tiffcp PalaisDuLouvre.tif,0 out.tif
$ convert out.tif -colorspace gray test.tif
$ tiffcp -c none test.tif test.none.tif
$ opj_compress -i test.none.tif -o M1.j2k -M 1

Reported by malaterre on 2014-03-12 16:15:44

@gcode-importer
Copy link
Author

openjpeg 1.3 and 1.5 all exhibit the same artifacts.

Reported by malaterre on 2014-03-12 16:18:43

@gcode-importer
Copy link
Author

Reported by malaterre on 2014-03-12 16:19:05

@gcode-importer
Copy link
Author

$ make opj_compress && valgrind bin/opj_compress -i test.none.tif -o M1.j2k -M 1
[ 84%] Built target openjp2
Linking C executable ../../../bin/opj_compress
[100%] Built target opj_compress
==12059== Memcheck, a memory error detector
==12059== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==12059== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==12059== Command: bin/opj_compress -i test.none.tif -o M1.j2k -M 1
==12059== 

[INFO] tile number 1 / 1
==12059== Conditional jump or move depends on uninitialised value(s)
==12059==    at 0x4E67448: opj_t1_encode_cblk (t1.c:1678)
==12059==    by 0x4E66E4C: opj_t1_encode_cblks (t1.c:1527)
==12059==    by 0x4E702A4: opj_tcd_t1_encode (tcd.c:1959)
==12059==    by 0x4E6EA3D: opj_tcd_encode_tile (tcd.c:1155)
==12059==    by 0x4E45FFB: opj_j2k_write_sod (j2k.c:4262)
==12059==    by 0x4E53F9E: opj_j2k_write_first_tile_part (j2k.c:9907)
==12059==    by 0x4E53A7A: opj_j2k_post_write_tile (j2k.c:9747)
==12059==    by 0x4E53289: opj_j2k_encode (j2k.c:9524)
==12059==    by 0x4E5CDA8: opj_encode (openjpeg.c:736)
==12059==    by 0x406E11: main (opj_compress.c:1681)
==12059== 

Reported by malaterre on 2014-03-14 11:10:40

@rouault
Copy link
Collaborator

rouault commented Jun 13, 2017

Fixed per #949

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants