In the JJ2000 decoder there are minor bugs in the error concealment code (but with a considerable impact).
If you use this software in scientific work, it would be appreciated if you cited the following paper Stuetz09a .
In StdEntropyDecoder.java line 2475 (4.1 unix release) it is better to set:
resetmask = (-1)<<(bp+1);
Thus JJ2000 references the erroneous bitplane in this comparison, while the corrected resetmask does not take corrupted values into account.
Another error concealment method is the additional employment of the predictive termination of every coding pass (-Cterm_type predict and -Cterminate on), which leaves error resilient information on the spare least significant bits, which can be used by a decoder to detect errors.
However, our experiments revealed that the JJ2000 decoder is not capable of achieving a higher detection rate with both error resilience methods enabled, on the contrary, error resilience on the basis of the segmentation symbol performed best. This is due to a minor bug in the cleanup pass code of the JJ2000 decoder (in the jj2000.j2k.entropy.decoder.StdEntropyDecoder in line 2439 (4.1 unix release) it should be error = error || mq.checkPredTerm();
The decoder's behavior if errors occur is not standardized, only the detection mechanism is. A conservtive strategy is to reset the coefficient value to the value prior to the error.