Information technology -- JPEG XL Image Coding System

Technologies de l'information - JPEG XL Systѐme de Codage d'Images

General Information

Status
Published
Current Stage
4060 - Close of voting
Start Date
08-Jul-2020
Completion Date
07-Jul-2020
Ref Project

RELATIONS

Buy Standard

Draft
ISO/IEC DIS 18181-1 - Information technology -- JPEG XL Image Coding System
English language
161 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (sample)

DRAFT INTERNATIONAL STANDARD
ISO/IEC DIS 18181-1
ISO/IEC JTC 1/SC 29 Secretariat: JISC
Voting begins on: Voting terminates on:
2020-04-14 2020-07-07
Information technology — JPEG XL Image Coding System —
Part 1:
Core coding system
ICS: 35.040.30
THIS DOCUMENT IS A DRAFT CIRCULATED
FOR COMMENT AND APPROVAL. IT IS
THEREFORE SUBJECT TO CHANGE AND MAY
NOT BE REFERRED TO AS AN INTERNATIONAL
STANDARD UNTIL PUBLISHED AS SUCH.
IN ADDITION TO THEIR EVALUATION AS
BEING ACCEPTABLE FOR INDUSTRIAL,
This document is circulated as received from the committee secretariat.
TECHNOLOGICAL, COMMERCIAL AND
USER PURPOSES, DRAFT INTERNATIONAL
STANDARDS MAY ON OCCASION HAVE TO
BE CONSIDERED IN THE LIGHT OF THEIR
POTENTIAL TO BECOME STANDARDS TO
WHICH REFERENCE MAY BE MADE IN
Reference number
NATIONAL REGULATIONS.
ISO/IEC DIS 18181-1:2020(E)
RECIPIENTS OF THIS DRAFT ARE INVITED
TO SUBMIT, WITH THEIR COMMENTS,
NOTIFICATION OF ANY RELEVANT PATENT
RIGHTS OF WHICH THEY ARE AWARE AND TO
PROVIDE SUPPORTING DOCUMENTATION. ISO/IEC 2020
---------------------- Page: 1 ----------------------
ISO/IEC DIS 18181-1:2020(E)
COPYRIGHT PROTECTED DOCUMENT
© ISO/IEC 2020

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
Fax: +41 22 749 09 47
Email: copyright@iso.org
Website: www.iso.org
Published in Switzerland
ii © ISO/IEC 2020 – All rights reserved
---------------------- Page: 2 ----------------------
ISO/IEC DIS 18181-1:2020(E)
Contents
Foreword 11
Scope 1
Normative references 1
Terms and definitions 2
Data storage 2
Inputs 3
Processes 4
Image organization 6
DCT 8
Symbols and abbreviated terms 9
Conventions 10
Mathematical symbols 10
Functions 10
Operators 11
Arithmetic operators 12
Bitwise arithmetic operators 12
Logical operators 12
Relational operators 12
Assignment operators 12
Operator precedence 13
Pseudocode 14
Functional concepts 15
Image organization 15
Group splitting 15
Codestream and bitstream 16
Multiple frames 16
Mirroring 16
Encoder requirements 16
Decoder requirements 16
Codestream overview 17
Syntax 17
Reading a field 17
Initializing a field 17
Field types 17
Basic types 17
u(n) 17
pu() 18
© ISO/IEC 2020 - All rights reserved iii
---------------------- Page: 3 ----------------------
ISO/IEC DIS 18181-1:2020(E)
U32(d0, d1, d2, d3) 18
U64() 18
Varint() 19
SL(n) 19
GL(g, n) 19
U8() 20
bu(n) 20
F16() 21
Derived types 21
Bool() 21
Enum(EnumTable) 21
S32(d0, d1, d2, d3) 21
ZeroPadToByte() 22
Structure 22
Decoder overview 22
General 22
Entropy decoding 23
Predictors 24
Adaptive dequantization 23
Chroma from luma 23
Integral transform 24
Loop filters 24
Image features 24
Colour transform 24
Headers 25
General 25
Signature 25
Image dimensions 25
ColourEncoding 27
Extensions 30
ImageMetadata 31
AnimationHeader 31
OpsinInverseMatrix 32
ExtraChannelInfo 33
ImageMetadata2 33
ICC profile 36
General 36
Data stream 36
Encoded ICC stream 36
ICC header 37
ICC tag list 39
Main content 41
iv © ISO/IEC 2020 - All rights reserved
---------------------- Page: 4 ----------------------
ISO/IEC DIS 18181-1:2020(E)
Frames 43
General 43
FrameHeader 44
TOC 50
General 50
Decoding permutations 50
Decoding TOC 50
DcGlobal 51
General 51
DC channel dequantization weights 51
Quantizer 52
Default and DC channel correlation factors 52
Patches 52
General 52
Decoding patch types 53
Splines 53
Overview 53
Splines stream 53
Dequantization 55
Decorrelation 55
Noise synthesis parameters 55
GlobalModular 55
DcGroup 56
General 56
ModularDcGroup 56
DC coefficients 57
AC colour correlation 58
DctSelect 58
Quantization field 59
Adaptive reconstruction parameters 60
AcGlobal 60
General 60
Dequantization matrices 60
Default values for each dequantization matrix 65
Number of AC decoding presets 67
AcPass 67
AC coefficient order 67
AC coefficient histograms 68
PassGroup 68
General 68
Modular group data 68
AC coefficients 68
Modular image sub-bitstream 70
General 70
© ISO/IEC 2020 - All rights reserved v
---------------------- Page: 5 ----------------------
ISO/IEC DIS 18181-1:2020(E)
Image decoding 71
TransformInfo 71
Channel decoding 71
MABEGABRAC channel decoding 73
Brotli channel decoding 73
MAANS channel decoding 74
Weighted predictor channel decoding 75
Transformations 75
Subsample 76
Quantize 77
LoopFilter 77
JpegCode Error! Bookmark not defined.
JpegDcGroup 78
JpegAcGroup 78
Entropy decoding 79
General 79
Brotli 79
ANS 79
General 79
Alias mapping 79
ANS symbol decoding 80
ANS distribution decoding 80
Distribution clustering 81
Hybrid integer coding 82
sANS 83
General 83
Symbol resolving 83
sANS symbol decoder 83
sANS distribution stream 83
Binary arithmetic coding 85
Histogram code 86
Huffman histogram stream 86
Huffman symbol stream 86
Adaptive binary range coding (ABRAC) 86
Bounded-Exp-Golomb ABRAC (BEGABRAC) 87
Meta-Adaptive BEGABRAC (MABEGABRAC) 88
MA tree decoding 91
Predictors 92
General 92
Adaptive 92
Sub-predictors 93
Luminance sub-predictors (YPredictor) 93
Chrominance sub-predictors (XBPredictor) 93
vi © ISO/IEC 2020 - All rights reserved
---------------------- Page: 6 ----------------------
ISO/IEC DIS 18181-1:2020(E)
Error metrics 93
PackSigned 93
PackSignedRange 94
Context computation 94
Weighted 94
General 94
Prediction 95
Adaptive quantization 98
General 98
DC dequantization 98
AC dequantization 98
Chroma from luma 100
Extensions 101
Extensions 101
General 101
ImageMetadata2 extensions 101
FrameHeader extensions 101
LoopFilter extensions 101
Integral transforms 102
General 102
Variable DCT 102
One-dimensional DCT and IDCT 102
Two-dimensional DCT and IDCT 104
Coefficients to samples 106
General 106
DCT8×8, DCT8×16, DCT16×8, DCT16×16, DCT8×32, DCT32×8, DCT16×32, DCT
32×16, DCT32×32 106
DCT2×2 106
DCT4×4 107
IDENTITY 107
DCT8×4 108
DCT4×8 108
AFV0, AFV1, AFV2, AFV3 109
Natural ordering of the DCT coefficients 110
LLF coefficients from downsampled image 111
General 111

DctSelect DCT 8 × 8, 8 × 16, 8 × 32, 16 × 8, 16 × 16, 32 × 8, 32 × 16, 32 × 32 112

DctSelect Identity, DCT 2 × 2, 4 × 4, 8 × 4, 4 × 8, AFV0, AFV1, AFV2, AFV3 112
Squeeze 112
Parameters 112
Horizontal inverse squeeze step 115
Vertical inverse squeeze step 116
© ISO/IEC 2020 - All rights reserved vii
---------------------- Page: 7 ----------------------
ISO/IEC DIS 18181-1:2020(E)
Loop filters 118
Overview 118
Edge-preserving filter 118
Overview 118
Distances 118
Weights 119
Weighted average 120
Gaborish 120
Image features 121
General 121
Patches 121
Splines 121
Noise 122
General 122
Pseudorandom number generator 122
Additive noise 124
Colour transforms 125
General 125
XYB 125
YCbCr 126
YCgCo 126
RCT (reversible colour transform) 126
Palette 127
Extra channel rendering 127
Losslessly recompressed JPEG codestream 129
General 129
Entities 129
QuantTable 129
HuffmanCode 129
Component 130
ComponentScanInfo 130
ExtraZeroRunInfo 130
ScanInfo 130
Stream 131
BinaryProbabilityTracker 132
ComponentStateDC 133
ComponentStateAC 133
State 134
DCT Block Order 135
Constants 135
Aliases 135
Subroutines 136
viii © ISO/IEC 2020 - All rights reserved
---------------------- Page: 8 ----------------------
ISO/IEC DIS 18181-1:2020(E)
A(ba, t) 136
E(ans, D) 136
Stream structure 136
Sections and subsections 136
Stages 137
Signature section 137
Header section 137
Width subsection 138
Height subsection 138
Version and component count subsection 139
Subsampling subsection 139
Metadata section 139
Common APP0 sequence 140
Common APPn sequence 140
Raw APPn sequence 141
Raw COM sequence 141
JPEG Internals section 141
HuffmanCode stream 142
ScanInfo stream 144
Quant Data section 145
Histogram Data section 146
ContextMap stream 146
DC Data section 147
AC Data section 148
Fallback section 151
Reconstruction of JPEG 151
Fallback mode 152
Regular mode 152
SOF segment 152
DHT segment 152
RSTn segment 152
EOI segment 153
SOS segment 153
DQT segment 154
DRI segment 154
APPn segment 154
COM segment 154
Unrecognized data segment 154
Direct rasterization 155
Dequantization 155
DCT coefficients conditioning 155
IDCT 157
Gaborish loop filter 157
Upsampling 158
© ISO/IEC 2020 - All rights reserved ix
---------------------- Page: 9 ----------------------
ISO/IEC DIS 18181-1:2020(E)
Colour space transformation 158
HDR colour space transformation 158
Cropping 159
Encoder overview 160
Electronic inserts 161
x © ISO/IEC 2020 - All rights reserved
---------------------- Page: 10 ----------------------
ISO/IEC DIS 18181-1:2020(E)
Foreword

ISO (the International Organization for Standardization) and IEC (the International

Electrotechnical Commission) form the specialized system for worldwide standardization.

National bodies that are members of ISO or IEC participate in the development of International

Standards through technical committees established by the respective organization to deal with

particular fields of technical activity. ISO and IEC technical committees collaborate in fields of

mutual interest. Other international organizations, governmental and non-governmental, in

liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and

IEC have established a joint technical committee, ISO/IEC JTC 1.

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 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).

Attention is drawn to the possibility that some of the elements of this document may be the

subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such

patent rights. Details of any patent rights identified during the development of the document will

be in the Introduction and/or on the ISO list of patent declarations received (see

www.iso.org/patents).

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 Technical Committee ISO/IEC JTC 1, Information technology,

Subcommittee SC 29, Coding of audio, picture, multimedia and hypermedia information.

A list of all parts in the ISO/IEC 18181 series can be found on the ISO website.

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.

© ISO/IEC 2020 - All rights reserved xi
---------------------- Page: 11 ----------------------
ISO/IEC DIS 18181-1:2020(E)
Information technology — JPEG XL Image Coding System —
Part 1: Core Coding System
1 Scope

This International Standard defines a set of compression methods for coding one or more images

of continuous-tone greyscale, or continuous-tone colour, or multichannel digital samples.

This International Standard:

- 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

The following documents are referred to in the text in such a way that some or all of their content

constitutes requirements of this document. For dated references, only the edition cited applies.

For undated references, the latest edition of the referenced document (including any

amendments) applies.

ISO/IEC 10918-1:1993(E), Information technology — Digital compression and coding of

continuous-tone still images: Requirements and guidelines
ISO 10526:1999/CIE S005/E-1998, CIE Standard Illuminants for Colourimetry
IEC 61966-2-1:1999, Multimedia systems and equipment — Colour measurement and
management — Part 2-1: Colour management — Default RGB colour space — sRGB

ISO 15076-1:2010, Image technology colour management — Architecture, profile format and

data structure — Part 1: Based on ICC.1:2010
ISO/IEC 14882:2011, Information technology — Programming languages — C++

ISO/IEC/IEEE 60559:2011, Information technology — Microprocessor Systems — Floating-Point

arithmetic

Rec. ITU-T H.273 | ISO/IEC 23091-2:2019(E), Information technology — Coding-independent code

points — Part 2: Video

Rec. ITU-R BT.709-6, Parameter values for the HDTV standards for production and international

programme exchange

Rec. ITU-R BT.2100-1, Image parameter values for high dynamic range television for use in

production and international programme exchange
SMPTE ST 428-1, D-Cinema Distribution Master Image Characteristics
INTERNET ENGINEERING TASK FORCE (IETF). RFC 7932: Brotli Compressed Data Format
[online].
© ISO/IEC 2020 - All rights reserved 1
---------------------- Page: 12 ----------------------
ISO/IEC DIS 18181-1:2020(E)
Edited by J. Alakuijala and Z. Szabadka. July 2016 [viewed 2019-08-05].
Available at https://tools.ietf.org/html/rfc7932
3 Terms and definitions
For the purposes of this document, the following terms and definitions apply.

ISO and IEC maintain terminological databases for use in standardization at the following

addresses:
— ISO Online browsing platform: available at https://www.iso.org/obp
— IEC Electropedia: available at http://www.electropedia.org/
3.1 Data storage
3.1.1
bit
binary digit (0 or 1)
3.1.2
byte
8 consecutive bits encoding a value between 0 and 255
3.1.3
big endian
value representation with bytes in most to least-significant order
3.1.4
bitstream

sequence of bytes from which bits are read starting from the least-significant bit of the first byte

3.1.5
JPEG marker

two-byte code in which the first byte is 255 and the second byte is a value v with 1 <= v <= 254,

as specified in ISO/IEC 10918-1
3.1.6
codestream
bitstream plus associated JPEG markers
© ISO/IEC 2020 - All rights reserved 2
---------------------- Page: 13 ----------------------
ISO/IEC DIS 18181-1:2020(E)
3.1.7
bundle
structured data consisting of one or more fields
3.1.8
field
numerical value or bundle, or an array of either
3.1.9
histo
array of unsigned integers, used for entropy coding
3.1.10
set
unordered collection of elements
3.2 Inputs
3.2.1
pixel

vector of dimension corresponding to the number of channels, consisting of samples

3.2.2
sample
integer or real value, of which there is one per channel per pixel
3.2.3
greyscale

image representation in which each pixel is defined by a single sample representing intensity

(either luminance or luma depending on the ICC profile)
3.2.4
continuous-tone image
image whose samples consist of more than one bit
3.2.5
opsin
© ISO/IEC 2020 - All rights reserved 3
---------------------- Page: 14 ----------------------
ISO/IEC DIS 18181-1:2020(E)

photosensitive pigments in the human retina, whose dynamics are approximated by the XYB

colour space
3.2.6
burst
sequences of images typically captured with identical settings
3.2.7
animation
series of pictures and timing delays to display as a video medium
3.2.8
layer
image which can be superimposed on top of other layers
3.2.9
composite
image consisting of one or more layers
3.2.10
frame
single image (possibly part of a burst or animation) or layer
3.2.11
preview

lower-fidelity rendition of one of the frames (e.g. lower resolution), or a frame that represents the

entire content of all frames
3.2.12
ICC profile
information for colour space transforms
3.3 Processes
3.3.1
decoding process
© ISO/IEC 2020 - All rights reserved 4
---------------------- Page: 15 ----------------------
ISO/IEC DIS 18181-1:2020(E)

process which takes as its input a codestream and outputs a continuous-tone image

3.3.2
decoder
embodiment of a decoding process
3.3.3
encoding process

process which takes as its input continuous-tone image(s) and outputs compressed image data

in the form of a codestream
3.3.4
encoder
embodiment of an encoding process
3.3.5
lossless

descriptive term for encoding and decoding processes in which the output of a decoding

procedure is identical to the input to the encoding procedure
3.3.6
lossy
descriptive term for encoding and decoding processes which are not lossless
3.3.7
upsampling
procedure by which the spatial resolution of a channel is increased
3.3.8
downsampling
procedure by which the spatial resolution of a channel is reduced
3.3.9
entropy encoding

lossless procedure which converts a sequence of input symbols into a sequence of bits such that

the average number of bits per symbol approaches the entropy of the input symbols

© ISO/IEC 2020 - All rights reserved 5
---------------------- Page: 16 ----------------------
ISO/IEC DIS 18181-1:2020(E)
3.3.10
entropy encoder
embodiment of an entropy encoding procedure
3.3.11
entropy decoding

lossless procedure which recovers the sequence of symbols from the sequence of bits produced

by the entropy encoder
3.3.12
entropy decoder
embodiment of an entropy decoding procedure
3.3.13
Gaborish
convolution with default or signaled 3x3 kernel for deblocking
3.3.14
tick

periodic event whose frequency is encoded in AnimationHeader, such that frame durations

are integer multiples of the tick duration
3.4 Image organization
3.4.1
grid

2-dimensional array; a[x, y] means addressing an element of grid a at row y and column x.

Where so specified (M.2), addressing elements with coordinates outside of bounding rectangle (x

< 0, or y < 0, or x >= width, or y >= height) is allowed
3.4.2
sample grid

common coordinate system for all samples of an image, with top-left coordinates (0, 0), the first

coordinate increasing towards the right, and the second increasing towards the bottom

3.4.3
© ISO/IEC 2020 - All rights reserved 6
---------------------- Page: 17 ----------------------
ISO/IEC DIS 18181-1:2020(E)
channel
component

rectangular array of samples having the same designation, regularly aligned along a sample grid

3.4.4
region
rectangular area within a channel or grid
3.4.5
xsize
width of a sample grid or a region
3.4.6
ysize
height of a sample grid or a region
3.4.7
raster order

access pattern from left to right in the top row, then in the row below and so on

3.4.8
naturally aligned

positioning of a power-of-two sized region such that its top and left coordinates are divisible by

its xsize and ysize, respectively
3.4.9
block
naturally aligned square region covering up to 8 × 8 input pixels
3.4.10
group
naturally aligned square region covering up to 256 × 256 input pixels
3.4.11
table of contents
© ISO/IEC 2020 - All rights reserved 7
---------------------- Page: 18 ----------------------
ISO/IEC DIS 18181-1:2020(E)

data structure that enables seeking to a group or the next frame within a codestream

3.4.12
section
part of the codestream whose size is stored in a frame's table of contents
3.5 DCT
3.5.1
coefficient
input value to the inverse DCT
3.5.2
quantization
method of reducing the precision of individual coefficients
3.5.3
varblock
naturally aligned variable-size region of input pixels
3.5.4
dct_block
an array with 64 elements corresponding to DCT coefficients of a (8 × 8) block
3.5.5
var-DCT
lossy encoding of a frame that applies DCT to varblocks
3.5.6
DC coefficient

lowest frequency DCT coefficient, containing the average value of a block or the lowest-frequency

coefficient within the 8 × 8 region of a varblock of size greater than 8 × 8
3.5.7
AC coefficients
all DCT coefficients except the DC coefficient
© ISO/IEC 2020 - All rights reserved 8
---------------------- Page: 19 ----------------------
ISO/IEC DIS 18181-1:2020(E)
3.5.8
pass
data enabling decoding of successively higher resolutions
3.5.9
DC group

256 × 256 DC values from a naturally aligned region covering up to 2048 × 2048 input pixels

3.5.10
quantization weight

factor that a quantized coefficient should be multiplied by to undo the quantization process

3.5.11
channel decorrelation

method of reducing total encoded entropy by removing correlations between channels

3.5.12
channel correlation factor

factor by which a channel should be multiplied by before adding it to another channel to undo the

channel decorrelation process
4 Symbols and abbreviated terms
ICC: International Colour Consortium
IEC: International Electrotechnical Commission
ISO: International Organization for Standardization
ITU: International Telecommunication Union
JPEG: Joint Photographic Experts Group
JPEG: reference to ISO/IEC 10918
RGB: additive colour model with red, green, blue channels
LMS: colour space representing the response of cone cells in the human eye

XYB: absolute colour space based on gamma-corrected LMS, in which X is derived from the

difference between L and M, Y is an average of L and M (behaves similarly to luminance), and

B is derived from the S ("blue") channel
© ISO/IEC 2020 - All rights reserved 9
---------------------- Page: 20 ----------------------
ISO/IEC DIS 18181-1:2020(E)
DCT: discrete cosine transform (DCT-II as specified in I.2)
IDCT: inverse discrete cosine transform (DCT-II as specified in I.2)

LLF: N / 8 × N / 8 square of lowest frequency coefficients of N × N DCT coefficients

HF: all of N × N DCT coefficients except LLF
5 Conventions
5.1 Mathematical symbols
|x|
absolute value of x, |x| equals –x for x < 0, otherwise x
[a, b], (c, d), [e, f)
closed or open or half-open intervals containing all integers
or real numbers x (depending on context) such that a <=
x <= b, c < x < d, e <= x < f.
{a, b, c}
ordered sequence of elements
the smallest positive zero of the sine function
© ISO/IEC 2020 - All rights reserved 10
---------------------- Page: 21 ----------------------
ISO/IEC DIS 18181-1:2020(E)
5.2 Functions
sqrt(x)
square root, such that sqrt(x) × sqrt(x) == x and sqrt(x)
>= 0. If x < 0, the codestream is ill-formed.
cbrt(x)
cube root, such that cbrt(x) × cbrt(x) × cbrt(x) == x.
cos(r)
cosine of the angle r (in radians)
sin(r)
sine of the angle r (in radians)
erf(x)
error function of sigmoid shape
log(x)
natural logarithm of x. If x <= 0, the codestream is ill-formed.
log2(x)
base-two logarithm of x. If x <= 0, the codestream is ill-formed.
floor(x)
the largest integer that is less than or equal to x
ilog2(x)
equivalent of floor(log2(x)) + 1
ceil(x)
the smallest integer that is greater than or equal to x
abs(x)
equivalent to |x|
sign(x)
sign of x, 0 if x is 0, +1 if x is positive, -1 if x is negative
UnpackSigned(u)
equivalent to u / 2 if u is even, and -(u + 1) / 2 if u is odd
clamp(x, lo, hi)
equivalent to min({max({lo, x}), hi})
MakeBinary16(u)
the number whose binary16 floating-point representation (as
defined in ISO/IEC/IEEE 60559) is u
MakeBinary32(u)
the number whose binary32 floating-point representation (as
defined in ISO/IEC/IEEE 60559) is u
signbit(x)
equivalent to 1 if x is negative (including the floating-point value -
0.0), otherwise 0
signbit(s)
copysign(m, s)
equivalent to |m| × (-1)
truncate(f)
equivalent to copysign(floor(abs(f)), f)
len(a)
length (number of elements) of array a
sum(a)
sum of all elements of the array/tuple/sequence a
max(a)
maximal element of the array/tuple/sequence a
min(a)
smallest element of the array/tuple/sequence a
min_argmax(a)
minimal number i such that a[i] == max(a)
© ISO/IEC 2020 - All rights reserved 11
---------------------- Page: 22 ----------------------
ISO/IEC DIS 18181-1:2020(E)
5.3 Operators
5.3.1 Arithmetic operators
addition
subtraction (as a binary operator) or negation (as a unary prefix operator)
increasing by one (before/after obtaining the value, if before/after a variable)
decreasing by one (before/after obtaining the value, if before/after a variable)
multiplication
division of real numbers without truncation or rounding
exponentiation, x to the power of y
left shift: x << s is defined as x × 2
right shift: x >> s is defined as floor(x / 2 )
Umod

a Umod d is the unique integer r in [0, d) for which a == r + q×d for a suitable

integer q
Idiv
a Idiv b is equivalent to truncate(a / b)
5.3.2 Bitwise arithmetic operators
bitwise NOT
bitwise AND
bitwise XOR
bitwise OR
5.3.3 Logical operators
logical OR with short-circuit evaluation
logical AND with short-circuit evaluation
logical NOT
c ? t : f is defined as t if the condition c evaluates to true (or nonzero),
otherwise f
5.3.4 Relational operators
greater than
greater than or equal to
less than
less than or equal to
equal to
not equal to
© ISO/IEC 2020 - All rights reserved 12
---------------------- Page: 23 ----------------------
ISO/IEC DIS 18181-1:2020(E)
5.3.5 Assignment operators
variable = value assigns value to variable.
a += b is equivalent to a = a + b
a -= b is equivalent to a = a - b
a ×= b is equivalent to a = a × b
a /= b is equivalent to a = a / b
a &= b is equivalent to a = a & b
a ^= b is equivalent to a = a ^ b
a |= b is equivalent to a = a | b
5.3.6 Operator precedence

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 2020 - All rights reserved 13
---------------------- Page: 24 ----------------------
ISO/IEC DIS 18181-1:2020(E)
Operators Type of operation Associativity
expression left to right
x++, x--
postfix increment/decrement left to right
indexing of arrays, indices start at 0 left to right
unless specified otherwise
member access left to right
++x, --x
prefix increment/decrement right to left
exponentiation right to left
unary negation right to left
!, ~
logical/bitwise NOT right to left
×, /, Idiv, Umod
multiplication, division, integer division, left to right
remainder
+, − addition and subtraction left to right
<<, >>
left shift and right shift left to right
< , >, <=, >=
relational left to right
==, !=
equality comparison left to right
bitwise AND left to right
bitwise XOR left to right
bitwise OR left to right
logical AND left to right
logical OR left to right
ternary conditional right to left
assignment right to left
+=, -=, ×=, /=
compound assignment right to left
<<=, >>=, &=, ^=, |=
compound assignment right to left
5.4 Pseudocode

This document describes functionality using pseudocode formatted as in Listing 5.1.

Listing 5.1 — Example
// Informative comment
var = u(8); // Defined in 9.2.1
if (var == 1) return; // Stop executing this code snippet
[[Normative specification: if var == 0, the codestream is ill-formed]]
(out1, out2) = Function(var, kConstant);
Variables such as var are typically referenced by text outside the source code.
© ISO/IEC 2020 - All rights reserved 14
---------------------- Page: 25 ----------------------
ISO/IEC DIS 18181-1:2020(E)

The semantics of this pseudocode are those of the C++ programming language as defined by

ISO/IEC 14882:2011, with the following exceptions:
● Symbols from 5.1 and functions from 5.2 are allowed;

● Multiplication, division, remainder and exponentiation are expressed as specified in 5.3;

● Functions can return tuples which unpack to variables as in the above example;
● [[ ]] enclose normative directives specified using prose;
● int denotes a 32 or 64-bit integer;
● All integers are stored using two's complement;

● Expressions, and variables whose types are omitted, are understood as real numbers.

Where unsigned integer wraparound and truncated division are required, Umod and Idiv (see

5.3.1) are used for those purposes. Fixed-size types uint#_t, where # is 8, 16, 32, or 64, are used

when the size of a variable is important.

Numbers with a 0x prefix are in base 16 (hexadecimal), and apostrophe (') characters inside them

are understood to have no effect.
EXAMPLE 0x0001'0000 == 65536.
6 Functional concepts
6.1 Image organization

A channel is defined as a rectangular array of (integer or real) samples regularly aligned along a

sample grid of xsize sample positions horizontally and ysize sample positions vertically. The

number of channels may be 1 to 4096 (see num
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.