ITU T.87 JPEG LS 标准和示例 .jls SOS 编码流没有转义序列 0xFF 0x00

ITU T.87 JPEG LS Standard and sample .jls SOS encoded streams have no escape sequence 0xFF 0x00

ITU T.81 规定如下:

B.1.1.2 Markers Markers serve to identify the various structural parts of the compressed data formats. Most markers start marker segments containing a related group of parameters; some markers stand alone. All markers are assigned two-byte codes: an X’FF’ byte followed by a byte which is not equal to 0 or X’FF’ (see Table B.1). Any marker may optionally be preceded by any number of fill bytes, which are bytes assigned code X’FF’. NOTE – Because of this special code-assignment structure, markers make it possible for a decoder to parse the compressed data and locate its various parts without having to decode other segments of image data. "

B.1.1.5 Entropy-coded data segments An entropy-coded data segment contains the output of an entropy-coding procedure. It consists of an integer number of bytes, whether the entropy-coding procedure used is Huffman or arithmetic.

NOTES

(1) Making entropy-coded segments an integer number of bytes is performed as follows: for Huffman coding, 1-bits are used, if necessary, to pad the end of the compressed data to complete the final byte of a segment. For arithmetic coding, byte alignment is performed in the procedure which terminates the entropy-coded segment (see D.1.8).

(2) In order to ensure that a marker does not occur within an entropy-coded segment, any X’FF’ byte generated by either a Huffman or arithmetic encoder, or an X’FF’ byte that was generated by the padding of 1-bits described in NOTE 1 above, is followed by a “stuffed” zero byte (see D.1.6 and F.1.2.3).

并且在许多其他地方,众所周知的 Stuff_0() 函数也被命名。

不确定 ITU T.87 标准在 ITU T.81 标准指定的编码转义序列 0xFF 0x00 方面的立场:

在解码器中,当 0xFF 和 !0x00 实际使用该字节而不是在组件未完全解码时不跳过它时,我们可以制定逻辑来检测解码器错误。但是如果jls文件没有转义序列,我们遇到0xFF 0x00序列,我们应该跳过0x00字节吗?

想要对标准 ITU T.87 JPEG-LS 编码的主题进行一些澄清,以及正确的程序是什么。我们是否应该在编码流中对转义序列 0xFF 0x00 进行编码?

答案: ITU T.87 - 附件 A - A1 点编码参数和压缩图像数据 - pass 3

Marker segments are inserted in the data stream as specified in Annex D. In order to provide for easy detection of marker segments, a single byte with the value X'FF' in a coded image data segment shall be followed with the insertion of a single bit '0'. This inserted bit shall occupy the most significant bit of the next byte. If the X'FF' byte is followed by a single bit '1', then the decoder shall treat the byte which follows as the second byte of a marker, and process it in accordance with Annex C. If a '0' bit was inserted by the encoder, the decoder shall discard the inserted bit, which does not form part of the data stream to be decoded.

NOTE 2 – This marker segment detection procedure differs from the one specified in CCITT Rec. T.81 | ISO/IEC 10918-1.

JPEG-LS T.87 覆盖了编码数据流的 T.81 JPEG 标准,使字节 0xFF 后跟值介于 0x00 和 0x7F(含)之间的字节。