What byte layout does a second independent ISO 21496-1 implementation (libavif) use for gain map metadata, and does it agree with libultrahdr's min_version 0 layout?
libavif (commit b1e4d339) and libultrahdr v2.0.2 (commit e5f5a022) write the same first four bytes of the ISO 21496-1 gain-map metadata and the same top two flag bits (bit 7 multi-channel, bit 6 use-base-colour-space, confirmed in libultrahdr's gainmapmetadata.h). libavif writes and reads the remaining six bits as reserved without checking them, while libultrahdr assigns flag values 4 (backward direction) and 8 (common denominator, which switches the body layout). Bytes match the producer pins, re-read 2026-10-22. That files written by one library could be misread by the other is an unexecuted inference.
libavif (commit b1e4d339) and libultrahdr v2.0.2 (commit e5f5a022) write the same first four bytes of the ISO 21496-1 gain-map metadata and the same top two flag bits (bit 7 multi-channel, bit 6 use-base-colour-space, confirmed in libultrahdr's gainmapmetadata.h). libavif writes and reads the remaining six bits as reserved without checking them, while libultrahdr assigns flag values 4 (backward direction) and 8 (common denominator, which switches the body layout). Bytes match the producer pins, re-read 2026-10-22. That files written by one library could be misread by the other is an unexecuted inference.
Curator qualifications: Consequence for cross-reading (mis-parse or 'remaining bytes' failure) is the producer's unexecuted inference; needs an authorised L10 fixture. Which layout the final ISO 21496-1 specifies is unknown (standard unread; libavif changelog says it followed a draft). 'Two independent code bases' is used loosely; shared organisational lineage not assessed. Static reading only; no image encoded/decoded, no library built. Amendments applied: CA-AM-0037.
Limitations: Static reading only; no image encoded/decoded, no library built.
Evidence status: statements located in the cited sources by a correlated desk review (Claude); not executed; not independently reviewed.
Structured fields
{
"citations": [
{
"url": "https://raw.githubusercontent.com/AOMediaCodec/libavif/b1e4d339c1ff5b547664c85f1713279f4997d694/CHANGELOG.md",
"note": "write.c lines 1067-1082; read.c lines 2262-2280; gainmapmetadata.cpp lines 122-162, 221, 231"
},
{
"url": "https://github.com/AOMediaCodec/libavif/blob/b1e4d339c1ff5b547664c85f1713279f4997d694/src/write.c",
"note": "write.c lines 1067-1082; read.c lines 2262-2280; gainmapmetadata.cpp lines 122-162, 221, 231"
},
{
"url": "https://github.com/AOMediaCodec/libavif/blob/b1e4d339c1ff5b547664c85f1713279f4997d694/src/read.c",
"note": "write.c lines 1067-1082; read.c lines 2262-2280; gainmapmetadata.cpp lines 122-162, 221, 231"
},
{
"url": "https://github.com/google/libultrahdr/blob/e5f5a022fe96fc4dc2ee35c19f733a50df807abe/lib/src/gainmapmetadata.cpp",
"note": "write.c lines 1067-1082; read.c lines 2262-2280; gainmapmetadata.cpp lines 122-162, 221, 231"
},
{
"url": "https://developer.android.com/media/platform/hdr-image-format",
"note": "write.c lines 1067-1082; read.c lines 2262-2280; gainmapmetadata.cpp lines 122-162, 221, 231"
}
]
}Evidence claims
- [sourced_fact] libavif (commit b1e4d339) and libultrahdr v2.0.2 (commit e5f5a022) write the same first four bytes of the ISO 21496-1 gain-map metadata and the same top two flag bits (bit 7 multi-channel, bit 6 use-base-colour-space, confirmed in libultrahdr's gainmapmetadata.h). libavif writes and reads the remaining six bits as reserved without checking them, while libultrahdr assigns flag values 4 (backward direction) and 8 (common denominator, which switches the body layout). Bytes match the producer pins, re-read 2026-10-22. That files written by one library could be misread by the other is an unexecuted inference. · locator: write.c lines 1067-1082; read.c lines 2262-2280; gainmapmetadata.cpp lines 122-162, 221, 231 source
Rights
| component | license | hosting | redistribution | modification | training | Evidence and notes |
|---|---|---|---|---|---|---|
| documentation | unknown | permitted | permitted | unknown | unknown | Applies to this original summary only, not to the cited sources. |
Linked records
- cites → https://developer.android.com/media/platform/hdr-image-format
- cites → https://github.com/AOMediaCodec/libavif/blob/b1e4d339c1ff5b547664c85f1713279f4997d694/src/read.c
- cites → https://github.com/AOMediaCodec/libavif/blob/b1e4d339c1ff5b547664c85f1713279f4997d694/src/write.c
- cites → https://github.com/google/libultrahdr/blob/e5f5a022fe96fc4dc2ee35c19f733a50df807abe/lib/src/gainmapmetadata.cpp
- cites → https://raw.githubusercontent.com/AOMediaCodec/libavif/b1e4d339c1ff5b547664c85f1713279f4997d694/CHANGELOG.md