**ISO/IEC 10918-1 : 1993(E)**

**Annex H**

**Lossless mode of operation**

(This annex forms an integral part of this Recommendation | International Standard)

ISO/IEC 10918-1 : 1993(E)

CCITT Rec. T.81 (1992 E)

This annex provides a **functional specification** of the following coding processes for the lossless mode of operation:

1)

lossless processes with Huffman coding;

2)

lossless processes with arithmetic coding.

For each of these, the encoding process is specified in H.1, and the decoding process is specified in H.2. The functional

specification is presented by means of specific procedures which comprise these coding processes.

NOTE There is **no requirement** in this Specification that any encoder or decoder which embodies one of the above-named

processes shall implement the procedures in precisely the manner specified in this annex. It is necessary only that an encoder or decoder

implement the **function** specified in this annex. The sole criterion for an encoder or decoder to be considered in compliance with this

Specification is that it satisfy the requirements given in clause 6 (for encoders) or clause 7 (for decoders), as determined by the

compliance tests specified in Part 2.

The processes which provide for sequential lossless encoding and decoding are not based on the DCT. The processes used

are spatial processes based on the coding model developed for the DC coefficients of the DCT. However, the model is

extended by incorporating a set of selectable one- and two-dimensional predictors, and for interleaved data the ordering of

samples for the one-dimensional predictor can be different from that used in the DCT-based processes.

Either Huffman coding or arithmetic coding entropy coding may be employed for these lossless encoding and decoding

processes. The Huffman code table structure is extended to allow up to 16-bit precision for the input data. The arithmetic

coder statistical model is extended to a two-dimensional form.

**H.1**

**Lossless encoder processes**

**H.1.1**

**Lossless encoder control procedures**

Subclause E.1 contains the encoder control procedures. In applying these procedures to the lossless encoder, the data unit

is one sample.

Input data precision may be from 2 to 16 bits/sample. If the input data path has different precision from the input data, the

data shall be aligned with the least significant bits of the input data path. Input data is represented as unsigned integers

and is not level shifted prior to coding.

When the encoder is reset in the restart interval control procedure (see E.1.4), the prediction is reset to a default value. If

arithmetic coding is used, the statistics are also reset.

For the lossless processes the restart interval shall be an integer multiple of the number of MCU in an MCU-row.

**H.1.2**

**Coding model for lossless encoding**

The coding model developed for encoding the DC coefficients of the DCT is extended to allow a selection from a set of

seven one-dimensional and two-dimensional predictors. The predictor is selected in the scan header (see Annex B). The

same predictor is used for all components of the scan. Each component in the scan is modeled independently, using

predictions derived from neighbouring samples of that component.

**H.1.2.1**

**Prediction**

Figure H.1 shows the relationship between the positions (a, b, c) of the reconstructed neighboring samples used for

prediction and the position of x, the sample being coded.

**132**

**CCITT Rec. T.81 (1992 E)**