ISO/IEC 21122-1:2024
(Main)Information technology — JPEG XS low-latency lightweight image coding system — Part 1: Core coding system
Information technology — JPEG XS low-latency lightweight image coding system — Part 1: Core coding system
This document specifies the syntax and an accompanying decompression process that is capable to represent continuous-tone grey-scale, or continuous-tone colour digital images without visual loss at moderate compression rates. Typical compression rates are between 2:1 and 18:1 but can also be higher depending on the nature of the image. In particular, the syntax and the decoding process specified in this document allow lightweight encoder and decoder implementations that limit the end-to-end latency to a fraction of the frame size. However, the definition of transmission channel buffer models necessary to ensure such latency is beyond the scope of this document. This document: — specifies decoding processes for converting compressed image data to reconstructed image data; — specifies a codestream syntax containing information for interpreting the compressed image data; — provides guidance on encoding processes for converting source image data to compressed image data.
Technologies de l'information — Système de codage d'images léger à faible latence JPEG XS — Partie 1: Système de codage de noyau
General Information
Relations
Standards Content (Sample)
International
Standard
ISO/IEC 21122-1
Third edition
Information technology — JPEG
2024-07
XS low-latency lightweight image
coding system —
Part 1:
Core coding system
Technologies de l'information — Système de codage d'images
léger à faible latence JPEG XS —
Partie 1: Système de codage de noyau
Reference number
© ISO/IEC 2024
All rights reserved. Unless otherwise specified, or required in the context of its implementation, no part of this publication may
be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on
the internet or an intranet, without prior written permission. Permission can be requested from either ISO at the address below
or ISO’s member body in the country of the requester.
ISO copyright office
CP 401 • Ch. de Blandonnet 8
CH-1214 Vernier, Geneva
Phone: +41 22 749 01 11
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland
© ISO/IEC 2024 – All rights reserved
ii
Contents Page
Foreword .iv
1 Scope . 1
2 Normative references . 1
3 Terms and definitions, abbreviated terms and symbols . 1
3.1 Terms and definitions .1
3.2 Abbreviated terms .6
3.3 Symbols .6
4 Conventions . 10
4.1 Conformance language .10
4.2 Operators .10
4.2.1 Arithmetic operators .10
4.2.2 Logical operators .10
4.2.3 Relational operators .10
4.2.4 Precedence order of operators .10
4.2.5 Mathematical functions .11
5 Functional concepts . .11
5.1 Sample grid, sampling and components .11
5.2 Interpretation of CFA data . 12
5.3 Wavelet decomposition . 12
5.4 Codestream. 13
6 Encoder requirements .13
7 Decoder .13
7.1 Decoding process general provisions . 13
7.2 Decoder requirements . 15
Annex A (normative) Codestream syntax .16
Annex B (normative) Image data structures .32
Annex C (normative) Entropy decoding .45
Annex D (normative) Quantization .65
Annex E (normative) Discrete wavelet transformation .70
Annex F (normative) Multiple component transformations .80
Annex G (normative) DC level shifting, non-linear transform and output clipping.91
Annex H (normative) Frame buffer . .98
Annex I (informative) Example weight tables .106
Bibliography .114
© ISO/IEC 2024 – All rights reserved
iii
Foreword
ISO (the International Organization for Standardization) is a worldwide federation of national standards
bodies (ISO member bodies). The work of preparing International Standards is normally carried out through
ISO technical committees. Each member body interested in a subject for which a technical committee
has been established has the right to be represented on that committee. International organizations,
governmental and non-governmental, in liaison with ISO, also take part in the work. ISO collaborates closely
with the International Electrotechnical Commission (IEC) on all matters of electrotechnical standardization.
The procedures used to develop this document and those intended for its further maintenance are described
in the ISO/IEC Directives, Part 1. In particular, the different approval criteria needed for the different types
of ISO document should be noted. This document was drafted in accordance with the editorial rules of the
ISO/IEC Directives, Part 2 (see www.iso.org/directives).
ISO draws attention to the possibility that the implementation of this document may involve the use of (a)
patent(s). ISO takes no position concerning the evidence, validity or applicability of any claimed patent
rights in respect thereof. As of the date of publication of this document, ISO had received notice of (a)
patent(s) which may be required to implement this document. However, implementers are cautioned that
this may not represent the latest information, which may be obtained from the patent database available at
www.iso.org/patents. ISO shall not be held responsible for identifying any or all such patent rights.
Any trade name used in this document is information given for the convenience of users and does not
constitute an endorsement.
For an explanation of the voluntary nature of standards, the meaning of ISO specific terms and expressions
related to conformity assessment, as well as information about ISO's adherence to the World Trade
Organization (WTO) principles in the Technical Barriers to Trade (TBT), see www.iso.org/iso/foreword.html.
This document was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology,
Subcommittee SC 29, Coding of audio, picture, multimedia and hypermedia information.
This third edition cancels and replaces the second edition (ISO/IEC 21122-1:2022), which has been
technically revised.
The main changes are as follows:
— coding tools for improving the compression rates for screen content images have been added;
— coding tools that enable lossless coding of images with up to 16 bits per sample have been added.
A list of all parts in the ISO/IEC 21122 series can be found on the ISO and IEC websites.
Any feedback or questions on this document should be directed to the user’s national standards
body. A complete listing of these bodies can be found at www.iso.org/members.html and
www.iec.ch/national-committees.
© ISO/IEC 2024 – All rights reserved
iv
International Standard ISO/IEC 21122-1:2024(en)
Information technology — JPEG XS low-latency lightweight
image coding system —
Part 1:
Core coding system
1 Scope
This document specifies the syntax and an accompanying decompression process that is capable to represent
continuous-tone grey-scale, or continuous-tone colour digital images without visual loss at moderate
compression rates. Typical compression rates are between 2:1 and 18:1 but can also be higher depending
on the nature of the image. In particular, the syntax and the decoding process specified in this document
allow lightweight encoder and decoder implementations that limit the end-to-end latency to a fraction of the
frame size. However, the definition of transmission channel buffer models necessary to ensure such latency
is beyond the scope of this document.
This document:
— specifies decoding processes for converting compressed image data to reconstructed image data;
— specifies a codestream syntax containing information for interpreting the compressed image data;
— provides guidance on encoding processes for converting source image data to compressed image data.
2 Normative references
There are no normative references in this document.
3 Terms and definitions, abbreviated terms and symbols
3.1 Terms and definitions
For the purposes of this document, the following terms and definitions apply.
ISO and IEC maintain terminology databases for use in standardization at the following addresses:
— ISO Online browsing platform: available at https:// www .iso .org/ obp
— IEC Electropedia: available at https:// www .electropedia .org/
3.1.1
band
input data to a specific wavelet filter type (3.1.54) that contributes to the generation of one of the components
(3.1.14) of the image
3.1.2
band type
single number collapsing the information on the component, and horizontal and vertical wavelet filter types
that are applied in the filter cascade reconstructing spatial image samples from inversely quantized wavelet
coefficients
© ISO/IEC 2024 – All rights reserved
3.1.3
bit
binary choice encoded as either 0 or 1
3.1.4
bitplane
array of bits having all the same significance
3.1.5
bitplane count
number of significant bitplanes of a code group, counting from the LSB up to the most significant, non-empty
bitplane
3.1.6
bitplane count subpacket
subset of a packet which decodes to the bitplane counts of all code groups within a packet, followed by
padding and optional filler bytes
Note 1 to entry: See subclause C.5.3.
3.1.7
byte
group of 8 bits
3.1.8
colour filter array
CFA
rectangular array of sensor elements yielding a 1-component image where the colour to which a sensor
element is sensitive to depends on the position of the sensor element
3.1.9
codestream
compressed image data representation that includes all necessary data to allow a (full or approximate)
reconstruction of the sample values of a digital image
3.1.10
code group
group of quantization indices in sign-magnitude representation before inverse quantization
3.1.11
coefficient
input value to the inverse wavelet transformation resulting from inverse quantization
3.1.12
coefficient group
number of horizontally adjacent wavelet coefficients from the same band
3.1.13
column
set of vertically aligned precincts
3.1.14
component
two-dimensional array of samples having the same designation such as red, green or blue in the output or
display device
3.1.15
compression
process of reducing the number of bits used to represent source image data
© ISO/IEC 2024 – All rights reserved
3.1.16
continuous-tone image
image whose components have more than one bit per sample
3.1.17
data subpacket
subset of a packet which consists of the quantization index magnitudes, followed by padding and optional
filler bytes
Note 1 to entry: See subclause C.5.4.
3.1.18
deadzone quantizer
quantizer whose zero bucket has a size different from all other buckets
3.1.19
decoder
embodiment of a decoding process
3.1.20
decoding process
process which takes as its input a codestream and outputs a continuous-tone image
3.1.21
decomposition level
number of times a wavelet filter is applied to reconstruct image data from wavelet coefficients
3.1.22
encoder
embodiment of an encoding process
3.1.23
encoding process
process which outputs compressed image data in the form of a codestream
3.1.24
filler bytes
integer number of bytes a decoder will skip over on decoding without interpreting the values of the bytes itself
3.1.25
intra coding
coding process which decodes data independent from data decoded in a previous frame
Note 1 to entry: ISO/IEC 21122-1:2022 only defined intra coding tools.
3.1.26
inverse quantization
inverse procedure to quantization by which the decoder recovers a representation of the coefficients
3.1.27
inverse reversible multiple component transformation
inverse RCT
inverse transform across multiple component sample values located at the same sample grid point that is
invertible without loss
Note 1 to entry: See subclauses F.3 and F.4.
3.1.28
LL band
input to a series of wavelet filters where only inverse low-pass filters are applied in horizontal and vertical
direction
© ISO/IEC 2024 – All rights reserved
3.1.29
lossless
descriptive term for encoding and decoding processes and procedures in which the output of the decoding
procedure(s) is identical to the input to the encoding procedure(s)
3.1.30
lossless coding
mode of operation which refers to any one of the coding processes defined in this document in which all of
the procedures are lossless
3.1.31
lossy
descriptive term for encoding and decoding processes which are not lossless
3.1.32
packet
segment of the codestream containing entropy coded information on a single precinct, line and a subset of
the bands within this precinct and line
3.1.33
padding
bits within the codestream whose only purpose is to align syntax elements to byte boundaries and that
carry no information
3.1.34
precinct
collection of quantization indices of all bands contributing to a given spatial region of the image
3.1.35
precision
number of bits allocated to a particular sample, coefficient, or other binary numerical representation
3.1.36
procedure
set of steps which accomplishes one of the tasks which comprise an encoding or decoding process
3.1.37
quantization
method of reducing the precision of the individual coefficients
3.1.38
quantization index
input to the inverse quantization process which reconstructs the quantization index to a wavelet coefficient
3.1.39
quantization index magnitude
absolute value of a quantization index
3.1.40
sample
one element in the two-dimensional image array which comprises a component
3.1.41
sample grid
common coordinate system for all samples of an image, the samples at the top left edge of the image have the
coordinates (0,0), the first coordinate increases towards the right, the second towards the bottom
© ISO/IEC 2024 – All rights reserved
3.1.42
sign subpacket
subset of a packet that consists of the sign information of all non-zero quantization indices within a packet,
followed by padding and optional filler bytes
Note 1 to entry: See subclause C.5.5.
3.1.43
significance
attribute of code groups that applies if, depending on the Run Mode flag in the picture header, either at least
one of coefficients in the code group is non-zero, or the bitplane count prediction residual of the code group
is non-zero
3.1.44
significance group
group of a horizontally adjacent code groups sharing the same significance information in the significance
subpacket
3.1.45
significance subpacket
subset of a packet that identifies which significance groups within a packet are insignificant, followed by
padding and optional filler bytes
Note 1 to entry: see subclause C.5.2
3.1.46
slice
integral number of precincts whose wavelet coefficients can be entropy-decoded independently
3.1.47
star-tetrix
decorrelation transformation that combines a spatial with an inter-component decorrelation transformation
particularly tuned for CFA pattern compression
Note 1 to entry: see subclause F.5
3.1.48
subpacket
substructure of a packet containing information of one or multiple bands of one line of a single precinct
3.1.49
super pixel
2×2 arrangement of sensor elements in a CFA pattern array containing at least one sensor element for each
colour filter type
3.1.50
temporal differential coding
TDC
coding process which decodes a differential signal relative to a sample decoded in a previous frame
3.1.51
truncation position
number of least significant bitplanes not included in the quantization index of a wavelet coefficient
3.1.52
uniform quantizer
quantizer whose buckets are all of equal size
3.1.53
upsampling
procedure by which the spatial resolution of a component is increased
© ISO/IEC 2024 – All rights reserved
3.1.54
wavelet filter type
single number that uniquely identifies each element of the wavelet filter with regard to the number and type
of horizontal and vertical decompositions
Note 1 to entry: Unlike the band type, the wavelet filter type does not include component information.
3.2 Abbreviated terms
JPEG XS informal name of this standard where XS stands for “extra speed”
LSB least significant bit
MSB most significant bit
3.3 Symbols
B[i] bit precision of component i
β wavelet filter type
b band type
b [β,i] band existence flag for filter type β in component i. 1 if the filter exists, 0 otherwise.
x
b' [b] band existence flag for band type b. 1 if the filter exists, 0 otherwise.
x
B nominal overall bit precision of the wavelet coefficients
w
B number of bits required to encode a bitplane count in raw
r
C colour transformation type
pih
c[p,λ,b,x] wavelet coefficient residual in precinct p, line λ, band b and position x
c'[p,λ,b,x] wavelet coefficient in precinct p, line λ, band b and position x
C width of precincts other than the rightmost precinct in sample grid positions
s
C colour transformation CFA pattern type derived from the component registration
t
C colour transformation reflection and extension flags
f
C width of precincts in multiples of 8 LL subsampled band sample grid positions
w
D[p,b] bitplane count coding mode of band b in precinct p
D [p,b] TDC mode of band b in precinct p
i
D [p,s] raw coding mode override flag for packet s in precinct p
r
DCO DC offset
d [β,i] horizontal decomposition level of wavelet filter type β of component i
x
d [β,i] vertical decomposition level of wavelet filter type β of component i
y
δ [c] horizontal position of component c in a CFA super pixel
x
δ [c] vertical position of component c in a CFA super pixel
y
© ISO/IEC 2024 – All rights reserved
E exponent of the slope of the linear region of the extended non-linearity
e colour transformation exponent of first chroma component
e colour transformation exponent of second chroma component
f[p,λ,b,x] contents of the frame buffer at precinct p, line λ, band b and position x
Fs sign packing flag
Fslc slice coding mode
F number of fractional bits in the representation of wavelet coefficients
q
G[b] gain of band b
G [b] gain of band b under forced refresh
r
H [β,k] height of filter type β of component k in wavelet coefficients
b
H [i] height of the component i in sample points
c
H height of the image in sampling grid points
f
H height of a precinct in lines
p
H height of a slice in precincts
sl
I slice TDC flag, set if wavelet coefficients within a slice may use TDC
sl
I[p,λ,b,s] line inclusion flag, set if line λ of band b and precinct p is included in packet s, reset otherwise
k[δ , δ ] component within CFA super pixel at position δ , δ
x y x y
L [p,b] first line of band b in precinct p
L [p,b] last line + 1 of band b in precinct p
Lcod codestream length in bytes
L [p,s] size of the bitplane count subpacket of precinct p and packet s in bytes
cnt
L [p,s] size of the data subpacket of precinct p and packet s in bytes
dat
L long header flag in in the picture header, set if long headers are enforced, reset otherwise
h
L [p] length of the entropy coded data in precinct p
prc
L [p,s] size of the sign subpacket of precinct p and packet s in bytes
sgn
L [p,s] size of the significance subpacket of precinct p and packet s in bytes
sig
M[p,λ,b,g] bitplane count of precinct p, line λ, band b and code group g
M [p,λ,b,g] vertical predictor of the bitplane count of precinct p, line λ, band b and code group g
top
N number of components in an image
c
N [p,b] number of code groups in precinct p and band b
cg
N number of bands per component
β
© ISO/IEC 2024 – All rights reserved
N number of coefficients in a code group
g
N [p,b] number of TDC selection groups per line in band b of precinct p
i
N [p,b] number of significance groups per line in band b of precinct p
s
N [t] number of precincts in slice t
p
N number of bands in the wavelet decomposition of the image (wavelet filter types times com-
L
ponents)
N maximal number of horizontal decomposition levels
L,x
N' [i] number of horizontal decomposition levels of component i
L,x
N maximal number of vertical decomposition levels over all components
L,y
N' [i] number of vertical decomposition levels of component i
L,y
N number of precincts per sampling grid line
p,x
N number of precincts per sampling grid column
p,y
N [p] number of packets in precinct p
pc
O[c,x,y] unscaled output of the inverse wavelet transformation at coordinates x and y of the compo-
nent c
Ω[c,x,y] output of the inverse multiple component transformation at position x,y for component c
P[b] priority of band b
P [b] priority of band b under forced refresh
r
Plev level a particular codestream complies to
Ppih profile a particular codestream complies to
Ppoc progression order in which bands are transmitted in the codestream
Q[p] quantization parameter of precinct p
Q [p] quantization parameter to which precinct p will be quantized for storage in the frame buffer
f
Q’ [p] quantization parameter of the data stored in the frame buffer corresponding to precinct p
f
Q quantization adjustment for intra-coded coefficients that are intra-coded due to a rate-deci-
bi
sion
Q quantization adjustment for intra-coded coefficients that are intra-coded due to refresh,
br
overriding any rate-based TDC decision
Q quantization type of the image
pih
R raw-mode selection per packet flag
l
Rm run mode used for significance coding
R[p] refinement of precinct p
R [p] refinement parameter of the quantization to which precinct p will be quantized for storage
f
in the frame buffer
© ISO/IEC 2024 – All rights reserved
R’ [p] refinement parameter of the quantization of the data stored in the frame buffer correspond-
f
ing to precinct p
R[c,x,y] reconstructed sample value at position x,y for component c
S number of components for which wavelet decomposition is suppressed
d
S [b] intra refresh hash mask exponent of band b
h
S size of a TDC selection group in code groups
i
S size of a significance group in code groups
s
s [i] sampling factor of component i in horizontal direction
x
s [i] sampling factor of component i in vertical direction
y
s[p,λ,b,x] sign of the wavelet coefficient in precinct p, line λ, band b and position x.
T1 first threshold of the extended non-linearity
T2 second threshold of the extended non-linearity
T[p,b] truncation position of precinct p and band b
T [p,b] vertical truncation position predictor of precinct p and band b
top
T[β,x,y] temporary wavelet coefficient of filter type β at location x,y.
v[x,y] sample value at the sample grid position x,y
v[p,λ,b,x] quantization index magnitude of the wavelet coefficient in precinct p, line λ, band b and posi-
tion x
W [β,k] width of filter type β of component k in wavelet coefficients
b
W [i] width of component i in samples
c
W width of the image in sampling grid points
f
W [p] width of the precinct p in sampling grid points
p
W [p,b] width of band b of precinct p in coefficients
pb
Wt wavelet filter type for horizontal filtering
x
Wt wavelet filter type for vertical filtering
y
X[y] one-dimensional temporal array of wavelet coefficients
Xcrg[c] horizontal component registration of component c relative to the sample grid
Ycrg[c] vertical component registration of component c relative to the sample grid
Ysl slice index enumerating slices contiguously from top to bottom, starting at 0
Y[p,λ,b,k] TDC selection flag of precinct p, line λ, band b and TDC selection group k
Y [b] intra refresh position hash of band b
h
Z[p,λ,b,j] significance flag of precinct p, line λ, band b and significance group j
© ISO/IEC 2024 – All rights reserved
4 Conventions
4.1 Conformance language
The keyword "reserved" indicates a provision that is not specified at this time, shall not be used, and may
be specified in the future. The keyword "forbidden" indicates "reserved" and in addition indicates that the
provision will never be specified in the future.
4.2 Operators
NOTE Many of the operators used in document are similar to those used in the C programming language.
4.2.1 Arithmetic operators
& bitwise AND operation
+ addition
− subtraction (as a binary operator) or negation (as a unary prefix operator)
× multiplication
/ division without truncation or rounding
s
<< left shift: x<
s
>> right shift: x>>s is defined as ⎿x/2 ⏌
umod x umod a is the unique value y between 0 and a–1 for which y+Na = x with a suitable integer N
4.2.2 Logical operators
|| logical OR
&& logical AND
! logical NOT
4.2.3 Relational operators
> greater than
≥ greater than or equal to
< less than
≤ less than or equal to
== equal to
!= not equal to
4.2.4 Precedence order of operators
NOTE Operators are listed below in descending order of precedence. If several operators appear in the same line,
they have equal precedence. When several operators of equal precedence appear at the same level in an expression,
evaluation proceeds according to the associativity of the operator either from right to left or from left to right.
© ISO/IEC 2024 – All rights reserved
Operators Type of operation Associativity
() expression left to right
[] indexing of arrays left to right
– unary negation
×, / multiplication, division left to right
umod modulo (remainder) left to right
+, − addition and subtraction left to right
<<, >> left shift and right shift left to right
< , >, ≤, ≥ relational left to right
& bitwise AND left to right
4.2.5 Mathematical functions
x ceil of x: returns the smallest integer that is greater than or equal to x
x floor of x: returns the largest integer that is less than or equal to x
|x| absolute value of x, |x| equals –x for x < 0, otherwise x
log (x) logarithm to the basis of 2, e.g. log (1)=0 and log (2)=1
2 2 2
sign(x) sign of x, 0 if x is 0, +1 if x is positive, -1 if x is negative
square root of x, i.e. non-negative number y such that y×y=x
x
clamp(x,min,max) clamp x to the range [min,max]
clamp(x,min,max) equals min if x < min, max if x > max or otherwise x
max (x ) maximum of a sequence of numbers {x } enumerated by the index i
i i i
max(a,b) a if a>b, otherwise b
min (x ) minimum of a sequence of numbers {x } enumerated by the index i
i i i
min(a,b) a if a
5 Functional concepts
5.1 Sample grid, sampling and components
An image is defined as a rectangular array of scalar or vectorial samples regularly aligned along a sample
grid of W sample positions horizontally and H sample positions vertically. W is called the width and H is
f f f f
called the height of the image. The vector dimension of the image samples corresponds to the number of
colour components present and is indicated by N , the number of components of the image. Each dimension
c
of this vectorial data corresponds to one component of the image, and typically represents one of multiple
colour channels of the data. Components may be red, green and blue, or Luma (Y) and Chroma (Cb,Cr). These
are only non-exhaustive examples of components, and other uses are possible.
A given component may or may not populate every point on the sample grid. The distance, or sampling factor,
between sample points of a component shall be constant in each spatial dimension throughout the image.
The horizontal and vertical sampling factors of component i of an image are denoted by s [i] respectively
x
s [i] where i enumerates the components. Annex B provides further specifications on component sampling.
y
This document does not specify how to interpret the sample values, or how to reconstruct from subsampled
components an array of samples that populates the entire sample grid, i.e. it does not specify how to
© ISO/IEC 2024 – All rights reserved
upsample components to the full resolution of the sampling grid. The sampling grid provides only an abstract
coordinate system for the computation of positions and dimensions of codestream elements.
5.2 Interpretation of CFA data
This document defines coding tools and signalling for compression of Bayer-type CFA image data. According
to this specification, each sampling grid point represents a super pixel of four sensor elements containing
at least one sample of each component. Thus CFA data is interpreted as an image having four components,
where each sampling grid point describes four spatially disjoint sensor elements (one element per channel).
Squares represent individual sensor elements and circles represent sampling grid points. Groups of four sensor
elements overlapping with the same sampling grid point form one super pixel.
Figure 1 — Example of the interpretation of a GRBG Bayer-type CFA image
Moreover, regardless of the CFA sensor spatial subpixel arrangement, the Star-Tetrix colour transform of
this document defines a strict order on the components assigning the red channel to component 0, the green
channels to components 1 and 2, and the blue channel to component 3. The spatial subpixel arrangement is
signalled by the CRG marker. Figure 1 shows only one of the four potential subpixel arrangements of a Bayer-
type CFA.
5.3 Wavelet decomposition
This document provides an efficient representation of image signals through the mathematical tool of wavelet
analysis. The wavelet filter process specified in Annex E separates each component into multiple bands,
where each band consists of multiple coefficients describing the image signal of a given component within a
frequency domain specific to the wavelet filter type, i.e. the particular filter corresponding to the band.
Wavelet coefficients are grouped into precincts, where each precinct includes all coefficients over all bands
that contribute to a spatial region of the image. Each precinct is encoded into one or multiple packets in the
codestream syntax specified in Annex A.
Precincts are furthermore grouped into slices. Wavelet coefficients in precincts that are part of different
slices can be decoded independently from each other. Note, however, that the wavelet transformation runs
across slice boundaries. A slice always extends over the full width of the image, but may only cover parts of
its height. Bands, band types, precincts and slices are formally defined in Annex B.
© ISO/IEC 2024 – All rights reserved
5.4 Codestream
The codestream is a linear stream of bits from the first bit to the last bit. For convenience, it can be divided
into (8-bit) bytes, starting with the first bit of the codestream. Bits within bytes are enumerated from the
LSB to the MSB, with the least significant bit having the index zero.
Annex A specifies the codestream syntax that defines the coded representation of compressed image data
for exchange between application environments. Any compressed image data shall comply with the syntax
and code assignments appropriate for the decoding processes defined in this document.
The codestream consists of multiple syntax elements: marker segments define control information necessary
to steer the decoding process, and entropy coded data organized in packets that represent image information
itself. Packets are further grouped into subpackets, each of which includes particular information such as
magnitude, signs or significance of parts of the encoded image data.
All marker segments defined in this document are specified in Annex A. This annex also provides an
overview on the organization of the codestream. Packets and subpackets are specified in Annex C.
6 Encoder requirements
An encoder is an embodiment of a process that generates a codestream that conforms to the syntactical
requirements specified in Annex A. Annex C to Annex G include informative subclauses that indicate how an
encoder may be implemented.
7 Decoder
7.1 Decoding process general provisions
Figure 2 provides an overview on the decoding process and the layout of this document. Codestream decoding
can be grouped into a syntax analysis part in block 1, an entropy decoding stage consisting of multiple blocks
2.1 to 2.5, an inverse quantization in block 3, an optional inverse temporal decorrelation in block 7, an inverse
wavelet transformation in block 4 and an inverse multiple component transformation in block 5. In block 6,
sample values are scaled, a DC offset is added, and they are clamped to their nominal ranges.
© ISO/IEC 2024 – All rights reserved
Figure 2 — Decoder overview
In Block 1, described in Annex A, the decoder analyses the codestream syntax and retrieves information on
the layout of the sampling grid, and the dimensions of slices and precincts.
The subpackets of the entropy coded data segment of the codestream are then decoded by the procedures
given in Annex C to form significance information, sign information, bitplane count information, quantization
indices and optionally TDC selection flags. This operation is performed in blocks 2.1 to 2.5 in Figure 2.
In block 2.1, significance information is decoded from the significance subpacket as specified in subclause C.5.2.
Denoted by the array Z[p,λ,b,j], significance information indicates the presence of significant code groups
th
within the j significance group. Each significance group corresponds to a run of code groups indexed by
precinct p, line λ and band b. A code group is significant if, depending on the Run Mode flag Rm in the picture
header, it either contains non-zero coefficients, or has a non-zero bitplane count prediction residual.
In block 2.2, bitplane counts are decoded from the bitplane count subpacket as specified in subclause C.5.3 by
the procedures specified in subclause E.6 The integer array M[p,λ,b,g] indicates the bitplane counts of the
wavelet coefficients in the code group g indexed by precinct p, line λ and band b.
In block 2.3, Quantization index magnitudes v[p,λ,b,x] in precinct p, line λ, band b, and horizontal position x
are decoded from the data subpacket as specified in subclause C.5.4.
In block 2.4, the signs of the quantization indices s[p,λ,b,x] are either interleaved in the data subpacket, or
included in a separate sign subpacket as specified in subclause C.5.5.
In block 2.5, the TDC selection flags Y[p,λ,b,k] are decoded from the TDC subpacket as specified in
subclause C.5.6. This subpacket only exists for slices that enable TDC, see subclause A.4.15. Otherwise, the
TDC selection flags shall be inferred to be 0, indicating intra-coding.
In block 3, decoded quantization index magnitudes v[p,λ,b,x] and signs s[p,λ,b,x] are then inversely quantized
by the dequantizer specified in Annex D, giving wavelet coefficient residuals c[p,λ,b,x].
© ISO/IEC 2024 – All rights reserved
In block 7, wavelet coefficient residuals c[p,λ,b,x] are optionally inversely temporally predicted by means of
the frame buffer f[p,λ,b,x] and TDC selection flags Y[p,λ,b,k] if they are present. The result of this operation
are the wavelet coefficients c’[p,λ,b,x]. If the wavelet coefficient residuals are part of a precinct, band and
line that does not use TDC, then c’[p,λ,b,x] shall be identical to c[p,λ,b,x]. Inverse temporal decorrelation is
specified in Annex H.
In block 4, wavelet coefficients c’[p,λ,b,x] are inversely wavelet transformed by the procedure specified in
Annex E. This process generates spatial sample values for all components, denoted by O[x,y,c]. Coordinates x
and y are here subsampled sampling grid positions of component c.
In block 5, spatial sample values O[x,y,c] undergo optionally an inverse multiple component transformation,
giving intermediate image sample values Ω[x,y,c]. The inverse multiple component transformation is
specified in Annex F.
In block 6, a DC offset is added to the decorrelated sample values Ω[x,y,c], an optional non-linear
transformation is applied, they are scaled to their nominal range and then clamped to the range of the bit-
precision of the output, giving the final reconstructed output sample values R[x,y,c] populating the sample
grid positions x×s [c], y×s [c]. This procedure is specified in Annex G.
x y
7.2 Decoder requirements
A decoder is an embodiment of the decoding process. The decoding process converts a codestream by
performing the process specified in this document to sample values arranged on a rectangular sampling
grid. Annex A to Annex H describe and normatively specify the decoding process. All decoding processes
are normative. Decoder conformance and test procedures to test for conformance are specified in
ISO/IEC 21122-4.
There is no normative or required specification for the particular internal steps or ordering of internal
operations to be performed within the decoder that is used to produce the normatively specified result. Only
the result that is externally observable as the decoded output image produced by the decoder is required to
match the result produced by the decoding processes specified in this document up to a conformance-level
dependent error bound that is specified in ISO/IEC 21122-4. The descriptions use particular implementation
techniques for illustrative purposes only, and any implementation that is able to reproduce the same results
as those generated by the algorithms specified herein is conforming to this document.
© ISO/IEC 2024 – All rights reserved
Annex A
(normative)
Codestream syntax
A.1 General
A.1.1 Marker segments and entropy coded data
The compressed data format consists of an ordered collection of syntax elements. This document
distinguishes between three types of syntax elements: Marker, marker segments and entropy coded data.
Markers serve to identify the various structural parts of the codestream. Most markers start marker
segments, where marker segments signal the characteristics of the encoded image and encapsulate
parameters configuring the decoder. Some markers stand alone. Entropy coded data consists of the input to
the decoding procedure described in Annex C to Annex H which reconstructs this data to the output image.
A.1.2 Key to syntax information
JPEG XS codestream syntax elements belong to one of two categories: fixed-length numerical values, or
variable-length codes. In the syntax tables, the “Syntax” column indicates the category to which each
codestream syntax element belongs, in the “Size” column the size of each field is identified (if applicable).
Fixed-length numerical values and are unsigned integers and are denoted by u(n), where n is the number
of bits used to represent the value. Variable-length codes are denoted by vlc, see subclause C.7 for the
normative decoding procedure of variable length codes. Bit strings and variable-length codes appear in the
codestream with the left bit first; numerical values appear most-significant bit first. The notation pad(n)
indicates a variable number padding bits. Padding aligns the bitstream to an n-bit boundary, i.e. to an integer
multiple of n bits relative to the start of the bitstream. Thus, pad(n) expands to 0 to n−1 bits depending on
the position within the bitstream. While padding bits can have arbitrary values, a decoder shall ignore their
value. The notation fill() indicates an arbitrary number of filler bytes a decoder shall remove without
interpreting their value. The amount of filler bytes can be inferred from a length field of a corresponding
syntax element.
Syntax elements may be conditionally included in the codestream; this is indicated by if clauses in the
syntax column of the syntax tables. All syntactical elements enclosed in curly brackets following the if
clause are only included if
...








Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.
Loading comments...