-
Notifications
You must be signed in to change notification settings - Fork 40
/
index.bs
executable file
·441 lines (312 loc) · 32.1 KB
/
index.bs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
<pre class='metadata'>
Group: AOM
Status: WGD
Text Macro: SPECVERSION v1.2.0
Title: AV1 Image File Format (AVIF)
URL: https://AOMediaCodec.github.io/av1-avif
Shortname: av1-avif
Editor: Yannis Guyon, Google, [email protected]
Editor: Leo Barnes, Apple, [email protected]
Former Editor: Cyril Concolato, Netflix, [email protected]
Former Editor: Paul Kerr, Netflix, [email protected]
Former Editor: Anders Klemets, Microsoft, [email protected]
Abstract: This document specifies syntax and semantics for the storage of [[!AV1]] images in the generic image file format [[!HEIF]], which is based on [[!ISOBMFF]]. While [[!HEIF]] defines general requirements, this document also specifies additional constraints to ensure higher interoperability between writers and readers when [[!HEIF]] is used with [[!AV1]] images. These constraints are based on constraints defined in the Multi-Image Application Format [[!MIAF]] and are grouped into profiles inspired by the profiles defined in [[!MIAF]].
Date: 2024-06-25
Repository: AOMediaCodec/av1-avif
Text Macro: ADDITIONALLOGO https://aomedia.org/assets/images/avif-logo-rgb.svg
!Previously approved version: <a href="v1.1.0.html">https://aomediacodec.github.io/av1-avif/v1.1.0.html</a>
!Latest approved version: <a href="latest-approved.html">https://aomediacodec.github.io/av1-avif/latest-approved.html</a>
!Latest draft version: <a href="latest-draft.html">https://aomediacodec.github.io/av1-avif/latest-draft.html</a>
Metadata Order: This version, !*, *
</pre>
<pre class='biblio'>
{
"AV1": {
"href": "https://aomediacodec.github.io/av1-spec/av1-spec.pdf",
"id": "AV1",
"title": "AV1 Bitstream & Decoding Process Specification",
"status": "LS",
"publisher": "AOM"
},
"AV1-ISOBMFF": {
"href": "https://aomediacodec.github.io/av1-isobmff/",
"id": "AV1-ISOBMFF",
"title": "AV1 Codec ISO Media File Format Binding",
"status": "LS",
"publisher": "AOM"
},
"HEIF": {
"id": "HEIF",
"href": "https://www.iso.org/standard/66067.html",
"title": "Information technology — High efficiency coding and media delivery in heterogeneous environments — Part 12: Image File Format",
"status": "International Standard",
"publisher": "ISO/IEC",
"isoNumber":"ISO/IEC 23008-12:2017"
},
"ISOBMFF": {
"id": "ISOBMFF",
"href": "https://www.iso.org/standard/68960.html",
"title": "Information technology — Coding of audio-visual objects — Part 12: ISO base media file format",
"status": "International Standard",
"publisher": "ISO/IEC",
"isoNumber":"ISO/IEC 14496-12:2015"
},
"MIAF": {
"href": "https://www.iso.org/standard/74417.html",
"id": "MIAF",
"title": "Information technology -- Multimedia application format (MPEG-A) -- Part 22: Multi-Image Application Format (MiAF)",
"status": "Enquiry",
"publisher": "ISO/IEC",
"isoNumber": "ISO/IEC DIS 23000-22"
}
}
</pre>
<pre class="anchors">
url: https://www.iso.org/standard/66067.html; spec: HEIF; type: property;
text: colr
text: mif1
text: msf1
text: pasp
text: pict
text: pixi
text: ispe
text: lsel
text: layer_id
text: image_width
text: image_height
url: https://www.iso.org/standard/68960.html; spec: ISOBMFF; type: dfn;
text: compatible_brands
text: FileTypeBox
text: major_brand
url: https://www.iso.org/standard/68960.html; spec: ISOBMFF; type: property;
text: sync
text: cclv
text: clli
text: mdcv
text: clap
text: iloc
url: https://www.iso.org/standard/74417.html; spec: MIAF; type: property;
text: miaf
url: https://www.iso.org/standard/74417.html; spec: MIAF; type: dfn;
text: primary image
text: MIAF image item
text: MIAF image sequence
text: MIAF auxiliary image item
text: MIAF auxiliary image sequence
text: MIAF file
url: https://aomediacodec.github.io/av1-isobmff/; spec: AV1-ISOBMFF; type: dfn;
text: AV1CodecConfigurationBox
text: AV1 Sample
text: AV1 Track
url: https://aomediacodec.github.io/av1-spec/av1-spec.pdf; spec: AV1; type: dfn;
text: AV1 bitstream
text: AV1 Frame
text: Sequence Header OBU
text: Metadata OBU
text: Temporal Unit
text: Operating Point
text: Intra Frame
url: https://aomediacodec.github.io/av1-spec/av1-spec.pdf; spec: AV1; type: dfn;
text: mono_chrome
text: color_range
text: still_picture
text: reduced_still_picture_header
text: operating_points_cnt_minus_1
text: choose_operating_point
text: spatial_id
text: seq_level_idx
text: render_width_minus1
text: render_height_minus1
text: FrameWidth
text: FrameHeight
text: max_frame_width_minus1
text: max_frame_height_minus1
</pre>
<h2 id="general">Scope</h2>
[[!AV1]] defines the syntax and semantics of an [=AV1 bitstream=]. The <dfn export>AV1 Image File Format</dfn> (AVIF) defined in this document supports the storage of a subset of the syntax and semantics of an [=AV1 bitstream=] in a [[!HEIF]] file.
The [=AV1 Image File Format=] defines multiple profiles, which restrict the allowed syntax and semantics of the [=AV1 bitstream=] with the goal to improve interoperability, especially for hardware implementations.
The profiles defined in this specification follow the conventions of the [[!MIAF]] specification.
Images encoded with AV1 and not meeting the restrictions of the defined profiles may still be compliant to this [=AV1 Image File Format=] if they adhere to the general AVIF requirements.
[=AV1 Image File Format=] supports High Dynamic Range (HDR) and Wide Color Gamut (WCG) images as well as Standard Dynamic Range (SDR). It supports monochrome images as well as multi-channel images with all the bit depths and color spaces specified in [[!AV1]].
[=AV1 Image File Format=] also supports multi-layer images as specified in [[!AV1]] to be stored both in image items and image sequences.
An AVIF file is designed to be a conformant [[!HEIF]] file for both image items and image sequences. Specifically, this specification follows the recommendations given in "Annex I: Guidelines On Defining
New Image Formats and Brands" of [[!HEIF]].
This specification reuses syntax and semantics used in [[!AV1-ISOBMFF]].
<h2 id="image-item-and-properties">Image Items and properties</h2>
<h3 id="image-item">AV1 Image Item</h3>
When an item is of type <dfn export for="AV1 Image Item Type">av01</dfn>, it is called an <dfn export>AV1 Image Item</dfn>, and shall obey the following constraints:
- <assert>The [=AV1 Image Item=] shall be a conformant [=MIAF image item=].</assert>
- <assert>The [=AV1 Image Item=] shall be associated with an [=AV1ItemConfigurationProperty=].</assert>
- The content of an [=AV1 Image Item=] is called the <dfn export>AV1 Image Item Data</dfn> and shall obey the following constraints:
- <assert>The [=AV1 Image Item Data=] shall be identical to the content of an [=AV1 Sample=] marked as 'sync', as defined in [[!AV1-ISOBMFF]].</assert>
- <assert>The [=AV1 Image Item Data=] shall have exactly one [=Sequence Header OBU=].</assert>
- If the [=AV1 Image Item Data=] consists of a single frame (i.e. when using a single layer),
- <assert>It should have its <code>[=still_picture=]</code> flag set to 1.</assert>
- <assert>It should have its <code>[=reduced_still_picture_header=]</code> flag set to 1.</assert>
<h3 id="image-item-properties">Image Item Properties</h3>
<h4 id="av1-item-configuration-property">AV1 Item Configuration Property</h4>
<pre class="def">
Box Type: <dfn export for="AV1ItemConfigurationProperty">av1C</dfn>
Property type: Descriptive item property
Container: ItemPropertyContainerBox
Mandatory (per item): Yes, for an image item of type 'av01'
Quantity: One for an image item of type 'av01'
</pre>
The syntax and semantics of the <dfn export>AV1ItemConfigurationProperty</dfn> are identical to those of the [=AV1CodecConfigurationBox=] defined in [[!AV1-ISOBMFF]], with the following constraints:
- <assert>[=Sequence Header OBUs=] should not be present in the [=AV1CodecConfigurationBox=].</assert>
- <assert>If a [=Sequence Header OBU=] is present in the [=AV1CodecConfigurationBox=], it shall match the [=Sequence Header OBU=] in the [=AV1 Image Item Data=].</assert>
- <assert>The values of the fields in the [=AV1CodecConfigurationBox=] shall match those of the [=Sequence Header OBU=] in the [=AV1 Image Item Data=].</assert>
- <assert>[=Metadata OBUs=], if present, shall match the values given in other item properties</assert>, such as the PixelInformationProperty or ColourInformationBox.
<assert>This property should be marked as essential.</assert>
<h4 id="image-spatial-extents-property">Image Spatial Extents Property</h4>
The semantics of the 'ispe' property as defined in [[!HEIF]] apply. More specifically, for AV1 images, <assert>the values of 'image_width' and 'image_height' shall respectively equal the values of [=FrameWidth=] and [=FrameHeight=]</assert> as defined in [[!AV1]] but for a specific frame in the item payload. The exact frame depends on the presence and content of the 'lsel' and [=OperatingPointSelectorProperty=] properties as follows:
- In the absence of a 'lsel' property associated with the item, or if it is present and its 'layer_id' value is set to 0xFFFF:
- If no [=OperatingPointSelectorProperty=] is associated with the item, the <assert>'ispe' shall document the dimensions of the last frame decoded when processing the operating point whose index is 0</assert>.
- If an [=OperatingPointSelectorProperty=] is associated with the item, the <assert>'ispe' property shall document the dimensions of the last frame decoded when processing the corresponding operating point</assert>.
NOTE: The dimensions of possible intermediate output images might not match the ones given in the 'ispe' property. If they display these intermediate images, renderers are expected to scale the output image to match the 'ispe' property.
- If a 'lsel' property is associated with an item and its 'layer_id' is different from 0xFFFF, the 'ispe' property documents the dimensions of the output frame produced by decoding the corresponding layer.
NOTE: The dimensions indicated in the 'ispe' property might not match the values [=max_frame_width_minus1=]+1 and [=max_frame_height_minus1=]+1 indicated in the AV1 bitstream.
NOTE: The values of [=render_width_minus1=] and [=render_height_minus1=] possibly present in the AV1 bistream are not exposed in the AVIF container level.
<h4 id="other-item-property">Other Item Properties</h4>
In addition to the Image Properties defined in [[!HEIF]], such as 'colr', 'pixi' or 'pasp', [=AV1 image items=] MAY also be associated with 'clli', 'cclv' and 'mdcv' introduced in [[!MIAF]].
In general, it is recommended to use properties instead of [=Metadata OBUs=] in the [=AV1ItemConfigurationProperty=].
NOTE: Although the clean aperture property ('clap') defined in [[!HEIF]] is applicable to AVIF, implementers of authoring tools should be aware of the possibility of unintended consequences since users may not realize image data outside the clap region is still in the file. A future revision of this specification may place normative restrictions on how clap can be used.
<h3 id="layered-items">AV1 Layered Image Items</h3>
<h4 id="layered-items-overview">Overview</h4>
[[!AV1]] supports encoding a frame using multiple spatial layers. A spatial layer may improve the resolution or quality of the image decoded based on one or more of the previous layers. A layer may also provide an image that does not depend on the previous layers. Additionally, not all layers are expected to produce an image meant to be rendered. Some decoded images may be used only as intermediate decodes. Finally, layers are grouped into one or more [=Operating Points=]. The [=Sequence Header OBU=] defines the list of [=Operating Points=], provides required decoding capabilities, and indicates which layers form each [=Operating Point=].
[[!AV1]] delegates the selection of which [=Operating Point=] to process to the application, by means of a function called <code>choose_operating_point()</code>. AVIF defines the [=OperatingPointSelectorProperty=] to control this selection. In the absence of an [=OperatingPointSelectorProperty=] associated with an [=AV1 Image Item=], the AVIF renderer is free to process any [=Operating Point=] present in the [=AV1 Image Item Data=]. In particular, <assert>when the [=AV1 Image Item=] is composed of a unique [=Operating Point=], the [=OperatingPointSelectorProperty=] should not be present</assert>. If an [=OperatingPointSelectorProperty=] is associated with an [=AV1 Image Item=], the <code>op_index</code> field indicates which [=Operating Point=] is expected to be processed for this item.
NOTE: When an author wants to offer the ability to render multiple [=Operating Points=] from the same AV1 image (e.g. in the case of multi-view images), multiple [=AV1 Image Items=] can be created that share the same [=AV1 Image Item Data=] but have different [=OperatingPointSelectorProperty=]s.
[[!AV1]] expects the renderer to display only one frame within the selected [=Operating Point=], which should be the highest spatial layer that is both within the [=Operating Point=] and present within the temporal unit, but [[!AV1]] leaves the option for other applications to set their own policy about which frames are output, as defined in the general output process. AVIF sets a different policy, and defines how the 'lsel' property (mandated by [[!HEIF]] for layered images) is used to control which layer is rendered. According to [[!HEIF]], the interpretation of the 'layer_id' field in the 'lsel' property is codec specific. In this specification, the value 0xFFFF is reserved for a special meaning. If a 'lsel' property is associated with an [=AV1 Image Item=] but its 'layer_id' value is set to 0xFFFF, the renderer is free to render either only the output image of the highest spatial layer, or to render all output images of all the intermediate layers and the highest spatial layer, resulting in a form of progressive decoding. If a 'lsel' property is associated with an [=AV1 Image Item=] and the value of 'layer_id' is not 0xFFFF, the renderer is expected to render only the output image for that layer.
NOTE: When such a progressive decoding of the layers within an [=Operating Point=] is not desired or when an author wants to expose each layer as a specific item, multiple [=AV1 Image Items=] sharing the same [=AV1 Image Item Data=] can be created and associated with different 'lsel' properties, each with a different value of 'layer_id'.
<h4 id="layered-properties">Properties</h4>
<h5 id="operating-point-selector-property">Operating Point Selector Property</h5>
<h6 id="operating-point-selector-property-definition" class="no-toc">Definition</h6>
<pre class="def">
Box Type: <dfn export for="OperatingPointSelectorProperty">a1op</dfn>
Property type: Descriptive item property
Container: <code>ItemPropertyContainerBox</code>
Mandatory: No
Quantity: Zero or one
</pre>
<h6 id="operating-point-selector-property-description" class="no-toc">Description</h6>
An <dfn export>OperatingPointSelectorProperty</dfn> may be associated with an [=AV1 Image Item=] to provide the index of the operating point to be processed for this item. <assert>If associated, it shall be marked as essential.</assert>
<h6 id="operating-point-selector-property-syntax" class="no-toc">Syntax</h6>
```
class OperatingPointSelectorProperty extends ItemProperty('a1op') {
unsigned int(8) op_index;
}
```
<h6 id="operating-point-selector-property-semantics" class="no-toc">Semantics</h6>
<dfn noexport>op_index</dfn> indicates the index of the operating point to be processed for this item. <assert>Its value shall be between 0 and [=operating_points_cnt_minus_1=].</assert>
<h5 id="layer-selector-property">Layer Selector Property</h5>
The 'lsel' property defined in [[!HEIF]] may be associated with an [=AV1 Image Item=]. The 'layer_id' indicates the value of the [=spatial_id=] to render. <assert>The value shall be between 0 and 3, or the special value 0xFFFF.</assert> When a value between 0 and 3 is used, <assert>the corresponding spatial layer shall be present in the bitstream</assert> and <assert>shall produce an output frame</assert>. Other layers may be needed to decode the indicated layer. When the special value 0xFFFF is used, progressive decoding is allowed as described in [[#layered-items-overview]].
<h5 id="layered-image-indexing-property">Layered Image Indexing Property</h5>
<h6 id="layered-image-indexing-property-definition" class="no-toc">Definition</h6>
<pre class="def">
Box Type: <dfn export for="AV1LayeredImageIndexingProperty">a1lx</dfn>
Property type: Descriptive item property
Container: <code>ItemPropertyContainerBox</code>
Mandatory: No
Quantity: Zero or one
</pre>
<h6 id="layered-image-indexing-property-description" class="no-toc">Description</h6>
The <dfn export>AV1LayeredImageIndexingProperty</dfn> property may be associated with an [=AV1 Image Item=]. <assert>It should not be associated with [=AV1 Image Items=] consisting of only one layer.</assert>
The [=AV1LayeredImageIndexingProperty=] documents the size in bytes of each layer (except the last one) in the [=AV1 Image Item Data=], and enables determining the byte ranges required to process one or more layers of an [=Operating Point=]. <assert>If associated, it shall not be marked as essential.</assert>
<h6 id="layered-image-indexing-property-syntax" class="no-toc">Syntax</h6>
```
class AV1LayeredImageIndexingProperty extends ItemProperty('a1lx') {
unsigned int(7) reserved = 0;
unsigned int(1) large_size;
FieldLength = (large_size + 1) * 16;
unsigned int(FieldLength) layer_size[3];
}
```
<h6 id="layered-image-indexing-property-semantics" class="no-toc">Semantics</h6>
<dfn noexport>layer_size</dfn> indicates the number of bytes corresponding to each layer in the item payload, except for the last layer. Values are provided in increasing order of [=spatial_id=]. A value of zero means that all the layers except the last one have been documented and <assert>following values shall be 0</assert>. <assert>The number of non-zero values shall match the number of layers in the image minus one.</assert>.
NOTE: The size of the last layer can be determined by subtracting the sum of the sizes of all layers indicated in this property from the entire item size.
<div class="example">A property indicating [X,0,0] is used for an image item composed of 2 layers. The size of the first layer is X and the size of the second layer is ItemSize - X. Note that the [=spatial_id=] for the first layer does not necessarily match the index in the array that provides the size. In other words, in this case the index giving value X is 0, but the corresponding [=spatial_id=] could be 0, 1 or 2. Similarly, a property indicating [X,Y,0] is used for an image made of 3 layers.</div>
<h2 id="image-sequences">Image Sequences</h2>
<p>An <dfn export>AV1 Image Sequence</dfn> is defined as a set of AV1 [=Temporal Units=] stored in an [=AV1 track=] as defined in [[!AV1-ISOBMFF]] with the following constraints:
- <assert>The track shall be a valid [=MIAF image sequence=].</assert>
- <assert>The track handler for an [=AV1 Image Sequence=] shall be <code>pict</code>.</assert>
- <assert>The track shall have only one sample description entry.</assert>
- <assert>If multiple [=Sequence Header OBUs=] are present in the track payload, they shall be identical.</assert></p>
<h2 id="auxiliary-images">Auxiliary Image Items and Sequences</h2>
<p>An <dfn export>AV1 Auxiliary Image Item</dfn> (respectively an <dfn export>AV1 Auxiliary Image Sequence</dfn>) is an [=AV1 Image Item=] (respectively [=AV1 Image Sequence=]) with the following additional constraints:
- <assert>It shall be a compliant [=MIAF Auxiliary Image Item=] (respectively [=MIAF Auxiliary Image Sequence=]).</assert>
- <assert>The <code>[=mono_chrome=]</code> field in the [=Sequence Header OBU=] shall be set to 1.</assert>
- <assert>The <code>[=color_range=]</code> field in the [=Sequence Header OBU=] shall be set to 1.</assert></p>
<p>An <dfn export>AV1 Alpha Image Item</dfn> (respectively an <dfn export>AV1 Alpha Image Sequence</dfn>) is an [=AV1 Auxiliary Image Item=] (respectively an [=AV1 Auxiliary Image Sequence=]), and as defined in [[!MIAF]], with the <code>aux_type</code> field of the <code>AuxiliaryTypeProperty</code> (respectively <code>AuxiliaryTypeInfoBox</code>) set to <code>urn:mpeg:mpegB:cicp:systems:auxiliary:alpha</code>. <assert>An [=AV1 Alpha Image Item=] (respectively an [=AV1 Alpha Image Sequence=]) shall be encoded with the same bit depth as the associated master [=AV1 Image Item=] (respectively [=AV1 Image Sequence=]).</assert></p>
<p><assert>For [=AV1 Alpha Image Item=] and [=AV1 Alpha Image Sequence=], the ColourInformationBox should be omitted.</assert> <assert>If present, readers shall ignore it.</assert></p>
<p>An <dfn export>AV1 Depth Image Item</dfn> (respectively an <dfn export>AV1 Depth Image Sequence</dfn>) is an [=AV1 Auxiliary Image Item=] (respectively an [=AV1 Auxiliary Image Sequence=]), and as defined in [[!MIAF]], with the <code>aux_type</code> field of the <code>AuxiliaryTypeProperty</code> (respectively <code>AuxiliaryTypeInfoBox</code>) set to <code>urn:mpeg:mpegB:cicp:systems:auxiliary:depth</code>.</p>
NOTE: [[!AV1]] supports encoding either 3-component images (whose semantics are given by the <code>matrix_coefficients</code> element), or 1-component images (monochrome). When an image requires a different number of components, multiple auxiliary images may be used, each providing additional component(s), according to the semantics of their <code>aux_type</code> field. In such case, the maximum number of components is restricted by number of possible items in a file, coded on 16 or 32 bits.
<h2 id="brands">Brands, Internet media types and file extensions</h2>
<h3 id="brands-overview">Brands overview</h3>
<p>As defined by [[!ISOBMFF]], the presence of a brand in the <code>[=compatible_brands=]</code> list in the <code>[=FileTypeBox=]</code> can be interpreted as the permission for those [=AV1 Image File Format=] readers/parsers and [=AV1 Image File Format=] renderers that only implement the features required by the brand, to process the corresponding file and only the parts (e.g. items or sequences) that comply with the brand.</p>
<p>An [=AV1 Image File Format=] file may conform to multiple brands. Similarly, an [=AV1 Image File Format=] reader/parser or [=AV1 Image File Format=] renderer may be capable of processing the features associated with one or more brands.</p>
<p><assert>If any of the brands defined in this document is specified in the <code>[=major_brand=]</code> field of the [=FileTypeBox=], the file extension and Internet Media Type should respectively be "<code>.avif</code>" and "<code>image/avif</code>" as defined in [[#mime-registration]].</assert></p>
<h3 id="image-and-image-collection-brand">AVIF image and image collection brand</h3>
The brand to identify [=AV1 image items=] is <dfn export for="AVIF Image brand">avif</dfn>.
Files that indicate this brand in the [=compatible_brands=] field of the [=FileTypeBox=] shall comply with the following:
- <assert>The primary item shall be an [=AV1 Image Item=] or be a derived image that references directly or indirectly one or more items that all are [=AV1 Image Items=].</assert>
- [=AV1 auxiliary image items=] may be present in the file.
<assert>Files that conform with these constraints should include the brand <code>[=avif=]</code> in the [=compatible_brands=] field of the [=FileTypeBox=].</assert>
Additionally, the brand <dfn export for="AVIF Intra-only brand">avio</dfn> is defined. If the file indicates the brand <code>[=avio=]</code> in the [=compatible_brands=] field of the [=FileTypeBox=], then <assert>the primary item or all the items referenced by the primary item shall be [=AV1 image items=] made only of [=Intra Frames=]</assert>. Conversely, <assert>if the previous constraint applies, the brand <code>[=avio=]</code> should be used in the [=compatible_brands=] field of the [=FileTypeBox=]</assert>.
<h3 id="image-sequence-brand">AVIF image sequence brands</h3>
The brand to identify AVIF image sequences is <dfn export for="AVIF Image Sequence brand">avis</dfn>.
Files that indicate this brand in the [=compatible_brands=] field of the [=FileTypeBox=] shall comply with the following:
- <assert>they shall contain one or more [=AV1 image sequences=].</assert>
- they may contain [=AV1 auxiliary image sequences=].
<assert>Files that conform with these constraints should include the brand <code>[=avis=]</code> in the [=compatible_brands=] field of the [=FileTypeBox=].</assert>
Additionally, if a file contains [=AV1 image sequences=] and the brand <code>[=avio=]</code> is used in the [=compatible_brands=] field of the [=FileTypeBox=], <assert>the item constraints for this brand shall be met</assert> and <assert>at least one of the [=AV1 image sequences=] shall be made only of [=AV1 Samples=] marked as 'sync'</assert>. Conversely, <assert>if such a track exists and the constraints of the brand <code>[=avio=]</code> on [=AV1 image items=] are met, the brand should be used</assert>.
NOTE: As defined in [[!MIAF]], a file that is primarily an image sequence still has at least an image item. Hence, it can also declare brands for signaling the image item.
<h2 id="file-constraints">General constraints</h2>
The following constraints are common to files compliant with this specification:
- <assert>The file shall be compliant with the [[!MIAF]] specification and list 'miaf' in the [=compatible_brands=] field of the [=FileTypeBox=].</assert>
- <assert>The file shall list <code>'[=avif=]'</code> or <code>'[=avis=]'</code> in the [=compatible_brands=] field of the [=FileTypeBox=].</assert>
- <assert>If transformative properties are used in derivation chains (as defined in [[MIAF]]), they shall only be associated with items that are not referenced by another derived item.</assert> For example, if a file contains a grid item and its referenced coded image items, cropping, mirroring or rotation transformations are only permitted on the grid item itself.
NOTE: This constraint further restricts files compared to [[MIAF]].
<h2 id="profiles">Profiles</h2>
<h3 id="profiles-overview">Overview</h3>
The profiles defined in this section are for enabling interoperability between [=AV1 Image File Format=] files and [=AV1 Image File Format=] readers/parsers. A profile imposes a set of specific restrictions and is signaled by brands defined in this specification.
<assert>The [=FileTypeBox=] should declare at least one profile that enables decoding of the primary image item.</assert> It is not an error for the encoder to include an auxiliary image that is not allowed by the specified profile(s).
<assert>If <code>'[=avis=]'</code> is declared in the [=FileTypeBox=] and a profile is declared in the [=FileTypeBox=], the profile shall also enable decoding of at least one image sequence track.</assert> <assert>The profile should allow decoding of any associated auxiliary image sequence tracks, unless it is acceptable to decode the image sequence without its auxiliary image sequence tracks.</assert>
It is possible for a file compliant to this [=AV1 Image File Format=] to not be able to declare an AVIF profile, if the corresponding AV1 encoding characteristics do not match any of the defined profiles.
NOTE: [[!AV1]] supports 3 bit depths: 8, 10 and 12 bits, and the maximum dimensions of a coded image is 65536x65536, when [=seq_level_idx=] is set to 31 (maximum parameters level).
<div class="example">If an image is encoded with dimensions (respectively a bit depth) that exceed the maximum dimensions (respectively bit depth) required by the AV1 profile and level of the AVIF profiles defined in this specification, the file will only signal general AVIF brands.</div>
<h3 id="baseline-profile">AVIF Baseline Profile</h3>
This section defines the MIAF AV1 Baseline profile of [[!HEIF]], specifically for [[!AV1]] bitstreams, based on the constraints specified in [[!MIAF]] and identified by the brand <dfn export for="AVIF Baseline Profile">MA1B</dfn>.
If the brand <code>MA1B</code> is in the list of [=compatible_brands=] of the [=FileTypeBox=], the common constraints in the section [[#brands]] shall apply.
The following additional constraints apply to all [=AV1 Image Items=] and all [=AV1 Image Sequences=]:
- <assert>The AV1 profile shall be the Main Profile and the level shall be 5.1 or lower.</assert>
NOTE: AV1 tiers are not constrained because timing is optional in image sequences and are not relevant in image items or collections.
NOTE: Level 5.1 is chosen for the Baseline profile to ensure that no single coded image exceeds 4k resolution, as some decoder may not be able to handle larger images. More precisely, following [[!AV1]] level definitions, coded image items compliant to the AVIF Baseline profile may not have a number of pixels greater than 8912896, a width greater than 8192 or a height greater than 4352. It is still possible to use the Baseline profile to create larger images using grid derivation.
<div class="example">
A file containing items compliant with this profile is expected to list the following brands, in any order, in the [=compatible_brands=] of the [=FileTypeBox=]:
<code>avif, mif1, miaf, MA1B</code>
A file containing a 'pict' track compliant with this profile is expected to list the following brands, in any order, in the [=compatible_brands=] of the [=FileTypeBox=]:
<code>avis, msf1, miaf, MA1B</code>
A file containing a 'pict' track compliant with this profile and made only of samples marked 'sync' is expected to list the following brands, in any order, in the [=compatible_brands=] of the [=FileTypeBox=]:
<code>avis, avio, msf1, miaf, MA1B</code>
</div>
<h3 id="advanced-profile">AVIF Advanced Profile</h3>
This section defines the MIAF AV1 Advanced profile of [[!HEIF]], specifically for [[!AV1]] bitstreams, based on the constraints specified in [[!MIAF]] and identified by the brand <dfn export for="AVIF Advanced Profile">MA1A</dfn>.
If the brand <code>MA1A</code> is in the list of [=compatible_brands=] of the [=FileTypeBox=], the common constraints in the section [[#brands]] shall apply.
The following additional constraints apply to all [=AV1 Image Items=]:
- <assert>The AV1 profile shall be the High Profile and the level shall be 6.0 or lower.</assert>
NOTE: Following [[!AV1]] level definitions, coded image items compliant to the AVIF Advanced profile may not have a number of pixels greater than 35651584, a width greater than 16384 or a height greater than 8704. It is still possible to use the Advanced profile to create larger images using grid derivation.
The following additional constraints apply only to [=AV1 Image Sequences=]:
- <assert>The AV1 profile shall be either Main Profile or High Profile.</assert>
- <assert>The AV1 level for Main Profile shall be 5.1 or lower.</assert>
- <assert>The AV1 level for High Profile shall be 5.1 or lower.</assert>
<div class="example">
A file containing items compliant with this profile is expected to list the following brands, in any order, in the [=compatible_brands=] of the [=FileTypeBox=]:
<code>avif, mif1, miaf, MA1A</code>
A file containing a 'pict' track compliant with this profile is expected to list the following brands, in any order, in the [=compatible_brands=] of the [=FileTypeBox=]:
<code>avis, msf1, miaf, MA1A</code>
</div>
<h2 id="mime-registration">AVIF Media Type Registration</h2>
<p>The media type <code>"image/avif"</code> is officially registered with IANA and available at: <a href="https://www.iana.org/assignments/media-types/image/avif">https://www.iana.org/assignments/media-types/image/avif</a>.</p>
<h2 id="change-list">Changes since v1.1.0 release</h2>
- EDITORIAL: <a href="https://github.com/AOMediaCodec/av1-avif/pull/223">Stop using `dfn value` for definitions.</a>
- EDITORIAL: <a href="https://github.com/AOMediaCodec/av1-avif/pull/222">Add assert-ids in the spec for conformance file testing and ComplianceWarden</a>