An AVIF file is a HEIF file, and also a MIAF file, whose images are coded with AV1. The box layout, item information, locations, references and grids are exactly those of HEIF, described on the HEIC pages: Boxes and items and Derived images and metadata. This page covers what AVIF adds, from the AVIF specification version 1.2.0 and the AV1 ISOBMFF binding; its properties are on Item properties.
Brands
| Brand | Meaning |
|---|---|
avif | Image or collection: the primary item is an AV1 image item, or a derived image (such as a grid) built from AV1 image items. |
avis | Image sequence: the file holds one or more AV1 image sequences, and may hold auxiliary sequences. |
avio | Intra-only: the primary item and every item it uses are made only of intra frames; with sequences, at least one sequence is all sync samples. |
MA1B | The AVIF Baseline profile. |
MA1A | The AVIF Advanced profile. |
A still image should list avif, mif1,
miaf and a profile brand; a sequence avis,
msf1, miaf and a profile brand. With avif or
avis as the major brand the extension should be .avif and
the media type image/avif. A file might start
00 00 00 1C 66 74 79 70 61 76 69 66 00 00 00 00 61 76 69 66 6D 69 66 31 6D 69 61 66:
ftyp, major brand avif, minor version 0, compatible
avif, mif1, miaf.
Profiles
| Profile | Images | Sequences | Largest coded image |
|---|---|---|---|
Baseline (MA1B) | AV1 Main profile, level 5.1 or lower | Main profile, level 5.1 or lower | 8,912,896 pixels, at most 8192 wide and 4352 high |
Advanced (MA1A) | AV1 High profile, level 6.0 or lower | Main or High profile, level 5.1 or lower | 35,651,584 pixels, at most 16384 wide and 8704 high |
The pixel limits are informative and come from the levels. Larger pictures are
stored as a grid of smaller AV1 items. AV1 itself carries 8, 10 or 12
bits per sample; deeper images use a Sample Transform derived item (below).
av01: the AV1 image item
- Item type
av01. It must have exactly oneav1Cproperty, which should be marked essential. - Its data is exactly what an AV1 sync sample would be: one temporal unit holding
exactly one Sequence Header OBU and the frame. Setting
still_pictureandreduced_still_picture_headerto 1 is recommended where possible. - Each OBU carries its size (
obu_has_size_field1), except that the last may leave it out and fill the rest of the data. - Tile list OBUs are not allowed; temporal delimiters, padding and redundant frame headers should not be used.
ispegives the upscaled width and frame height of the output frame.
OBU header
From the AV1 bitstream specification, section 5.3.
| Bits | Name | Description |
|---|---|---|
| 1 | obu_forbidden_bit | 0. |
| 4 | obu_type | From the table below. |
| 1 | obu_extension_flag | 1 when an extension byte follows. |
| 1 | obu_has_size_field | 1 when a size follows. |
| 1 | obu_reserved_1bit | 0. |
| 3 + 2 + 3 | temporal_id, spatial_id, reserved | The extension byte, when present: which temporal and spatial layer the OBU belongs to. |
| leb128 | obu_size | Payload bytes, as little-endian base-128: 7 bits per byte, high bit set on every byte but the last. |
| obu_type | OBU |
|---|---|
| 1 | Sequence header |
| 2 | Temporal delimiter |
| 3 | Frame header |
| 4 | Tile group |
| 5 | Metadata |
| 6 | Frame (frame header and tile group together) |
| 7 | Redundant frame header |
| 8 | Tile list |
| 15 | Padding |
Types 0 and 9 to 14 are reserved. A sequence header OBU usually starts
0A: type 1, size field present.
Alpha and depth
- Alpha is an auxiliary AV1 item with an
auxlreference to the colour item andauxCtypeurn:mpeg:mpegB:cicp:systems:auxiliary:alpha. Its sequence header hasmono_chrome1 andcolor_range1 (full range), and its bit depth matches the colour item. It should have nocolr, and readers ignore one if present. - A
premreference from the colour item to the alpha item says the colour is premultiplied. - Depth uses type
urn:mpeg:mpegB:cicp:systems:auxiliary:depth, with the same constraints. - Animated alpha is an auxiliary track alongside the colour track.
Image sequences
An animated AVIF holds AV1 tracks as in MP4: a moov box whose track
handler is pict, with exactly one av01 sample entry holding
av1C. Each sample is one temporal unit. Several sequence header OBUs are
allowed only if they are identical. A still primary item is usually stored as well,
for readers that do not play sequences.
Grids, gain maps and sample transforms
- Grids work as in HEIF. Transformative properties
(
clap,irot,imir) may sit only on the grid item, not on the tiles it is built from. - Gain maps: a
tmapderived item (defined in ISO 21496-1) combines a base image with a gain map image to give an alternative rendition, usually HDR. The base image and thetmapitem should be in analtrgroup, and the gain map item should be hidden. - Sample transform (
sato, version 0) derives an image from others by an expression on their samples, for bit depths above 12. Its bit_depth field, 0 to 3, selects 8-, 16-, 32- or 64-bit arithmetic; expression tokens 0 are constants, 1 to 32 input images, 64 to 67 unary operators and 128 to 137 binary operators. The full operator list is in the AVIF specification and is not repeated here.