jasper-software / jasper

Official Repository for the JasPer Image Coding Toolkit
http://www.ece.uvic.ca/~mdadams/jasper
Other
223 stars 101 forks source link

Fix SOP marker checking #232

Closed osamu620 closed 4 years ago

osamu620 commented 4 years ago

Why: If SOP marker segments are allowed (by setting the second LSB of Scod parameter to "1" in the COD marker segment, see A.6.1 in the spec), each packet in any given tile-part may or may not be appended with an SOP marker segment. So, the decoding process should not be stopped by missing SOP markers. However, whether or not the SOP marker segment is used, the count in the Nsop (packet sequence number) is incremented for each packet.

How: Added code lines to check packet sequence number when a SOP is found and to show warning message when a SOP is missing.

FYI: Nsop is a field which has 16 bits length. Valid range of the value of Nsop is from 0 to 65535. The first packet in a coded tile is assigned the value zero. For every successive packet in this coded tile, this number is incremented by one. When the maximum number is reached, the number rolls over to zero.