draft-ietf-cellar-ebml-14.txt   draft-ietf-cellar-ebml-15.txt 
cellar S. Lhomme cellar S. Lhomme
Internet-Draft Internet-Draft
Intended status: Standards Track D. Rice Intended status: Standards Track D. Rice
Expires: 3 June 2020 Expires: 18 June 2020
M. Bunkus M. Bunkus
1 December 2019 16 December 2019
Extensible Binary Meta Language Extensible Binary Meta Language
draft-ietf-cellar-ebml-14 draft-ietf-cellar-ebml-15
Abstract Abstract
This document defines the Extensible Binary Meta Language (EBML) This document defines the Extensible Binary Meta Language (EBML)
format as a generalized file format for any type of data in a format as a generalized file format for any type of data in a
hierarchical form. EBML is designed as a binary equivalent to XML hierarchical form. EBML is designed as a binary equivalent to XML
and uses a storage-efficient approach to build nested Elements with and uses a storage-efficient approach to build nested Elements with
identifiers, lengths, and values. Similar to how an XML Schema identifiers, lengths, and values. Similar to how an XML Schema
defines the structure and semantics of an XML Document, this document defines the structure and semantics of an XML Document, this document
defines how EBML Schemas are created to convey the semantics of an defines how EBML Schemas are created to convey the semantics of an
skipping to change at page 1, line 39 skipping to change at page 1, line 39
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 3 June 2020. This Internet-Draft will expire on 18 June 2020.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2019 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/ Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document. license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
skipping to change at page 2, line 22 skipping to change at page 2, line 22
2. Notation and Conventions . . . . . . . . . . . . . . . . . . 4 2. Notation and Conventions . . . . . . . . . . . . . . . . . . 4
3. Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3. Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4. Variable Size Integer . . . . . . . . . . . . . . . . . . . . 7 4. Variable Size Integer . . . . . . . . . . . . . . . . . . . . 7
4.1. VINT_WIDTH . . . . . . . . . . . . . . . . . . . . . . . 7 4.1. VINT_WIDTH . . . . . . . . . . . . . . . . . . . . . . . 7
4.2. VINT_MARKER . . . . . . . . . . . . . . . . . . . . . . . 7 4.2. VINT_MARKER . . . . . . . . . . . . . . . . . . . . . . . 7
4.3. VINT_DATA . . . . . . . . . . . . . . . . . . . . . . . . 8 4.3. VINT_DATA . . . . . . . . . . . . . . . . . . . . . . . . 8
4.4. VINT Examples . . . . . . . . . . . . . . . . . . . . . . 8 4.4. VINT Examples . . . . . . . . . . . . . . . . . . . . . . 8
5. Element ID . . . . . . . . . . . . . . . . . . . . . . . . . 9 5. Element ID . . . . . . . . . . . . . . . . . . . . . . . . . 9
6. Element Data Size . . . . . . . . . . . . . . . . . . . . . . 11 6. Element Data Size . . . . . . . . . . . . . . . . . . . . . . 11
6.1. Data Size Format . . . . . . . . . . . . . . . . . . . . 11 6.1. Data Size Format . . . . . . . . . . . . . . . . . . . . 11
6.2. Unknown Data Size . . . . . . . . . . . . . . . . . . . . 11 6.2. Unknown Data Size . . . . . . . . . . . . . . . . . . . . 12
6.3. Data Size Values . . . . . . . . . . . . . . . . . . . . 14 6.3. Data Size Values . . . . . . . . . . . . . . . . . . . . 14
7. EBML Element Types . . . . . . . . . . . . . . . . . . . . . 15 7. EBML Element Types . . . . . . . . . . . . . . . . . . . . . 15
7.1. Signed Integer Element . . . . . . . . . . . . . . . . . 15 7.1. Signed Integer Element . . . . . . . . . . . . . . . . . 15
7.2. Unsigned Integer Element . . . . . . . . . . . . . . . . 16 7.2. Unsigned Integer Element . . . . . . . . . . . . . . . . 16
7.3. Float Element . . . . . . . . . . . . . . . . . . . . . . 16 7.3. Float Element . . . . . . . . . . . . . . . . . . . . . . 16
7.4. String Element . . . . . . . . . . . . . . . . . . . . . 16 7.4. String Element . . . . . . . . . . . . . . . . . . . . . 16
7.5. UTF-8 Element . . . . . . . . . . . . . . . . . . . . . . 16 7.5. UTF-8 Element . . . . . . . . . . . . . . . . . . . . . . 16
7.6. Date Element . . . . . . . . . . . . . . . . . . . . . . 17 7.6. Date Element . . . . . . . . . . . . . . . . . . . . . . 17
7.7. Master Element . . . . . . . . . . . . . . . . . . . . . 17 7.7. Master Element . . . . . . . . . . . . . . . . . . . . . 17
7.8. Binary Element . . . . . . . . . . . . . . . . . . . . . 17 7.8. Binary Element . . . . . . . . . . . . . . . . . . . . . 17
8. EBML Document . . . . . . . . . . . . . . . . . . . . . . . . 17 8. EBML Document . . . . . . . . . . . . . . . . . . . . . . . . 18
8.1. EBML Header . . . . . . . . . . . . . . . . . . . . . . . 18 8.1. EBML Header . . . . . . . . . . . . . . . . . . . . . . . 18
8.2. EBML Body . . . . . . . . . . . . . . . . . . . . . . . . 18 8.2. EBML Body . . . . . . . . . . . . . . . . . . . . . . . . 18
9. EBML Stream . . . . . . . . . . . . . . . . . . . . . . . . . 18 9. EBML Stream . . . . . . . . . . . . . . . . . . . . . . . . . 18
10. EBML Versioning . . . . . . . . . . . . . . . . . . . . . . . 18 10. EBML Versioning . . . . . . . . . . . . . . . . . . . . . . . 19
10.1. EBML Header Version . . . . . . . . . . . . . . . . . . 19 10.1. EBML Header Version . . . . . . . . . . . . . . . . . . 19
10.2. EBML Document Version . . . . . . . . . . . . . . . . . 19 10.2. EBML Document Version . . . . . . . . . . . . . . . . . 19
11. Elements semantic . . . . . . . . . . . . . . . . . . . . . . 19 11. Elements semantic . . . . . . . . . . . . . . . . . . . . . . 19
11.1. EBML Schema . . . . . . . . . . . . . . . . . . . . . . 19 11.1. EBML Schema . . . . . . . . . . . . . . . . . . . . . . 19
11.1.1. EBML Schema Example . . . . . . . . . . . . . . . . 20 11.1.1. EBML Schema Example . . . . . . . . . . . . . . . . 20
11.1.2. <EBMLSchema> Element . . . . . . . . . . . . . . . . 21 11.1.2. <EBMLSchema> Element . . . . . . . . . . . . . . . . 21
11.1.3. <EBMLSchema> Attributes . . . . . . . . . . . . . . 21 11.1.3. <EBMLSchema> Attributes . . . . . . . . . . . . . . 21
11.1.4. <element> Element . . . . . . . . . . . . . . . . . 22 11.1.4. <element> Element . . . . . . . . . . . . . . . . . 22
11.1.5. <element> Attributes . . . . . . . . . . . . . . . . 22 11.1.5. <element> Attributes . . . . . . . . . . . . . . . . 22
11.1.6. <documentation> Element . . . . . . . . . . . . . . 29 11.1.6. <documentation> Element . . . . . . . . . . . . . . 29
11.1.7. <documentation> Attributes . . . . . . . . . . . . . 29 11.1.7. <documentation> Attributes . . . . . . . . . . . . . 29
11.1.8. <implementation_note> Element . . . . . . . . . . . 30 11.1.8. <implementation_note> Element . . . . . . . . . . . 30
11.1.9. <implementation_note> Attributes . . . . . . . . . . 30 11.1.9. <implementation_note> Attributes . . . . . . . . . . 31
11.1.10. <restriction> Element . . . . . . . . . . . . . . . 31 11.1.10. <restriction> Element . . . . . . . . . . . . . . . 32
11.1.11. <enum> Element . . . . . . . . . . . . . . . . . . . 32 11.1.11. <enum> Element . . . . . . . . . . . . . . . . . . . 32
11.1.12. <enum> Attributes . . . . . . . . . . . . . . . . . 32 11.1.12. <enum> Attributes . . . . . . . . . . . . . . . . . 33
11.1.13. <extension> Element . . . . . . . . . . . . . . . . 32 11.1.13. <extension> Element . . . . . . . . . . . . . . . . 33
11.1.14. <extension> Attributes . . . . . . . . . . . . . . . 32 11.1.14. <extension> Attributes . . . . . . . . . . . . . . . 33
11.1.15. XML Schema for EBML Schema . . . . . . . . . . . . . 33 11.1.15. XML Schema for EBML Schema . . . . . . . . . . . . . 34
11.1.16. Identically Recurring Elements . . . . . . . . . . . 37 11.1.16. Identically Recurring Elements . . . . . . . . . . . 37
11.1.17. Textual expression of floats . . . . . . . . . . . . 37 11.1.17. Textual expression of floats . . . . . . . . . . . . 38
11.1.18. Note on the use of default attributes to define 11.1.18. Note on the use of default attributes to define
Mandatory EBML Elements . . . . . . . . . . . . . . . 38 Mandatory EBML Elements . . . . . . . . . . . . . . . 39
11.2. EBML Header Elements . . . . . . . . . . . . . . . . . . 39 11.2. EBML Header Elements . . . . . . . . . . . . . . . . . . 39
11.2.1. EBML Element . . . . . . . . . . . . . . . . . . . . 39 11.2.1. EBML Element . . . . . . . . . . . . . . . . . . . . 40
11.2.2. EBMLVersion Element . . . . . . . . . . . . . . . . 39 11.2.2. EBMLVersion Element . . . . . . . . . . . . . . . . 40
11.2.3. EBMLReadVersion Element . . . . . . . . . . . . . . 40 11.2.3. EBMLReadVersion Element . . . . . . . . . . . . . . 40
11.2.4. EBMLMaxIDLength Element . . . . . . . . . . . . . . 40 11.2.4. EBMLMaxIDLength Element . . . . . . . . . . . . . . 41
11.2.5. EBMLMaxSizeLength Element . . . . . . . . . . . . . 41 11.2.5. EBMLMaxSizeLength Element . . . . . . . . . . . . . 41
11.2.6. DocType Element . . . . . . . . . . . . . . . . . . 41 11.2.6. DocType Element . . . . . . . . . . . . . . . . . . 42
11.2.7. DocTypeVersion Element . . . . . . . . . . . . . . . 42 11.2.7. DocTypeVersion Element . . . . . . . . . . . . . . . 42
11.2.8. DocTypeReadVersion Element . . . . . . . . . . . . . 42 11.2.8. DocTypeReadVersion Element . . . . . . . . . . . . . 43
11.2.9. DocTypeExtension Element . . . . . . . . . . . . . . 43 11.2.9. DocTypeExtension Element . . . . . . . . . . . . . . 43
11.2.10. DocTypeExtensionName Element . . . . . . . . . . . . 43 11.2.10. DocTypeExtensionName Element . . . . . . . . . . . . 44
11.2.11. DocTypeExtensionVersion Element . . . . . . . . . . 44 11.2.11. DocTypeExtensionVersion Element . . . . . . . . . . 44
11.3. Global Elements . . . . . . . . . . . . . . . . . . . . 44 11.3. Global Elements . . . . . . . . . . . . . . . . . . . . 45
11.3.1. CRC-32 Element . . . . . . . . . . . . . . . . . . . 44 11.3.1. CRC-32 Element . . . . . . . . . . . . . . . . . . . 45
11.3.2. Void Element . . . . . . . . . . . . . . . . . . . . 45 11.3.2. Void Element . . . . . . . . . . . . . . . . . . . . 46
12. Considerations for Reading EBML Data . . . . . . . . . . . . 45 12. Considerations for Reading EBML Data . . . . . . . . . . . . 46
13. Terminating Elements . . . . . . . . . . . . . . . . . . . . 46 13. Terminating Elements . . . . . . . . . . . . . . . . . . . . 47
14. Guidelines for Updating Elements . . . . . . . . . . . . . . 47 14. Guidelines for Updating Elements . . . . . . . . . . . . . . 48
14.1. Reducing a Element Data in Size . . . . . . . . . . . . 47 14.1. Reducing a Element Data in Size . . . . . . . . . . . . 48
14.1.1. Adding a Void Element . . . . . . . . . . . . . . . 47 14.1.1. Adding a Void Element . . . . . . . . . . . . . . . 48
14.1.2. Extending the Element Data Size . . . . . . . . . . 47 14.1.2. Extending the Element Data Size . . . . . . . . . . 48
14.1.3. Terminating Element Data . . . . . . . . . . . . . . 49 14.1.3. Terminating Element Data . . . . . . . . . . . . . . 49
14.2. Considerations when Updating Elements with Cyclic 14.2. Considerations when Updating Elements with Cyclic
Redundancy Check (CRC) . . . . . . . . . . . . . . . . . 49 Redundancy Check (CRC) . . . . . . . . . . . . . . . . . 50
15. Backward and Forward Compatibility . . . . . . . . . . . . . 49 15. Backward and Forward Compatibility . . . . . . . . . . . . . 50
15.1. Backward Compatibility . . . . . . . . . . . . . . . . . 49 15.1. Backward Compatibility . . . . . . . . . . . . . . . . . 50
15.2. Forward Compatibility . . . . . . . . . . . . . . . . . 50 15.2. Forward Compatibility . . . . . . . . . . . . . . . . . 51
16. Security Considerations . . . . . . . . . . . . . . . . . . . 50 16. Security Considerations . . . . . . . . . . . . . . . . . . . 51
17. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 51 17. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 52
17.1. CELLAR EBML Element ID Registry . . . . . . . . . . . . 52 17.1. CELLAR EBML Element ID Registry . . . . . . . . . . . . 52
17.2. CELLAR EBML DocType Registry . . . . . . . . . . . . . . 55 17.2. CELLAR EBML DocType Registry . . . . . . . . . . . . . . 56
18. Normative References . . . . . . . . . . . . . . . . . . . . 55 18. Normative References . . . . . . . . . . . . . . . . . . . . 56
19. Informative References . . . . . . . . . . . . . . . . . . . 57 19. Informative References . . . . . . . . . . . . . . . . . . . 58
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 57 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 58
1. Introduction 1. Introduction
EBML, short for Extensible Binary Meta Language, specifies a binary EBML, short for Extensible Binary Meta Language, specifies a binary
and octet (byte) aligned format inspired by the principle of XML (a and octet (byte) aligned format inspired by the principle of XML (a
framework for structuring data). framework for structuring data).
The goal of this document is to define a generic, binary, space- The goal of this document is to define a generic, binary, space-
efficient format that can be used to define more complex formats efficient format that can be used to define more complex formats
using an EBML Schema. EBML is used by the multimedia container using an EBML Schema. EBML is used by the multimedia container,
Matroska (https://github.com/Matroska-Org/matroska-specification/). Matroska [Matroska]. The applicability of EBML for other use cases
The applicability of EBML for other use cases is beyond the scope of is beyond the scope of this document.
this document.
The definition of the EBML format recognizes the idea behind HTML and The definition of the EBML format recognizes the idea behind HTML and
XML as a good one: separate structure and semantics allowing the same XML as a good one: separate structure and semantics allowing the same
structural layer to be used with multiple, possibly widely differing structural layer to be used with multiple, possibly widely differing
semantic layers. Except for the EBML Header and a few Global semantic layers. Except for the EBML Header and a few Global
Elements this specification does not define particular EBML format Elements this specification does not define particular EBML format
semantics; however this specification is intended to define how other semantics; however this specification is intended to define how other
EBML-based formats can be defined, such as the audio-video container EBML-based formats can be defined, such as the audio-video container
formats Matroska and WebM. formats Matroska and WebM [WebM].
EBML uses a simple approach of building Elements upon three pieces of EBML uses a simple approach of building Elements upon three pieces of
data (tag, length, and value) as this approach is well known, easy to data (tag, length, and value) as this approach is well known, easy to
parse, and allows selective data parsing. The EBML structure parse, and allows selective data parsing. The EBML structure
additionally allows for hierarchical arrangement to support complex additionally allows for hierarchical arrangement to support complex
structural formats in an efficient manner. structural formats in an efficient manner.
A typical EBML file has the following structure: A typical EBML file has the following structure:
EBML Header (master) EBML Header (master)
skipping to change at page 5, line 46 skipping to change at page 5, line 46
"VINT": Also known as "Variable Size Integer". "VINT": Also known as "Variable Size Integer".
"EBML Element": A foundation block of data that contains three parts: "EBML Element": A foundation block of data that contains three parts:
an "Element ID", an "Element Data Size", and "Element Data". an "Element ID", an "Element Data Size", and "Element Data".
"Element ID": The "Element ID" is a binary value, encoded as a "Element ID": The "Element ID" is a binary value, encoded as a
"Variable Size Integer", used to uniquely identify a defined "EBML "Variable Size Integer", used to uniquely identify a defined "EBML
Element" within a specific "EBML Schema". Element" within a specific "EBML Schema".
"EBML Class": A representation of the octet length of an "Element
ID".
"Element Data Size": An expression, encoded as a "Variable Size "Element Data Size": An expression, encoded as a "Variable Size
Integer", of the length in octets of "Element Data". Integer", of the length in octets of "Element Data".
"VINTMAX": The maximum possible value that can be stored as "Element "VINTMAX": The maximum possible value that can be stored as "Element
Data Size". Data Size".
"Unknown-Sized Element": An "Element" with an unknown "Element Data "Unknown-Sized Element": An "Element" with an unknown "Element Data
Size". Size".
"Element Data": The value(s) of the "EBML Element" which is "Element Data": The value(s) of the "EBML Element" which is
skipping to change at page 8, line 21 skipping to change at page 8, line 21
of every eight bits of the total length of the Variable Size Integer. of every eight bits of the total length of the Variable Size Integer.
Thus a Variable Size Integer of 1 octet length supplies 7 bits for Thus a Variable Size Integer of 1 octet length supplies 7 bits for
VINT_DATA, a 2 octet length supplies 14 bits for VINT_DATA, and a 3 VINT_DATA, a 2 octet length supplies 14 bits for VINT_DATA, and a 3
octet length supplies 21 bits for VINT_DATA. If the number of bits octet length supplies 21 bits for VINT_DATA. If the number of bits
required for VINT_DATA are less than the bit size of VINT_DATA, then required for VINT_DATA are less than the bit size of VINT_DATA, then
VINT_DATA MUST be zero-padded to the left to a size that fits. The VINT_DATA MUST be zero-padded to the left to a size that fits. The
VINT_DATA value MUST be expressed as a big-endian unsigned integer. VINT_DATA value MUST be expressed as a big-endian unsigned integer.
4.4. VINT Examples 4.4. VINT Examples
This table shows examples of Variable Size Integers with lengths from Table 1 shows examples of Variable Size Integers with lengths from 1
1 to 5 octets. The Usable Bits column refers to the number of bits to 5 octets. The Usable Bits column refers to the number of bits
that can be used in the VINT_DATA. The Representation column depicts that can be used in the VINT_DATA. The Representation column depicts
a binary expression of Variable Size Integers where VINT_WIDTH is a binary expression of Variable Size Integers where VINT_WIDTH is
depicted by "0", the VINT_MARKER as "1", and the VINT_DATA as "x". depicted by "0", the VINT_MARKER as "1", and the VINT_DATA as "x".
+--------------+-------------+-------------------------------+ +--------------+-------------+-------------------------------+
| Octet Length | Usable Bits | Representation | | Octet Length | Usable Bits | Representation |
+==============+=============+===============================+ +==============+=============+===============================+
| 1 | 7 | 1xxx xxxx | | 1 | 7 | 1xxx xxxx |
+--------------+-------------+-------------------------------+ +--------------+-------------+-------------------------------+
| 2 | 14 | 01xx xxxx xxxx xxxx | | 2 | 14 | 01xx xxxx xxxx xxxx |
+--------------+-------------+-------------------------------+ +--------------+-------------+-------------------------------+
| 3 | 21 | 001x xxxx xxxx xxxx xxxx xxxx | | 3 | 21 | 001x xxxx xxxx xxxx xxxx xxxx |
+--------------+-------------+-------------------------------+ +--------------+-------------+-------------------------------+
| 4 | 28 | 0001 xxxx xxxx xxxx xxxx xxxx | | 4 | 28 | 0001 xxxx xxxx xxxx xxxx xxxx |
| | | xxxx xxxx | | | | xxxx xxxx |
+--------------+-------------+-------------------------------+ +--------------+-------------+-------------------------------+
| 5 | 35 | 0000 1xxx xxxx xxxx xxxx xxxx | | 5 | 35 | 0000 1xxx xxxx xxxx xxxx xxxx |
| | | xxxx xxxx xxxx xxxx | | | | xxxx xxxx xxxx xxxx |
+--------------+-------------+-------------------------------+ +--------------+-------------+-------------------------------+
Table 1 Table 1: VINT examples depicting usable bits
Data encoded as a Variable Size Integer may be rendered at octet Data encoded as a Variable Size Integer may be rendered at octet
lengths larger than needed to store the data in order to facilitate lengths larger than needed to store the data in order to facilitate
overwriting it at a later date, e.g. when its final size isn't known overwriting it at a later date, e.g. when its final size isn't known
in advance. In this table a binary value of 0b10 is shown encoded as in advance. In Table 2 a binary value of 0b10 is shown encoded as
different Variable Size Integers with lengths from one octet to four different Variable Size Integers with lengths from one octet to four
octets. All four encoded examples have identical semantic meaning octets. All four encoded examples have identical semantic meaning
though the VINT_WIDTH and the padding of the VINT_DATA vary. though the VINT_WIDTH and the padding of the VINT_DATA vary.
+--------------+--------------+-----------------------+ +--------------+--------------+-----------------------+
| Binary Value | Octet Length | As Represented in | | Binary Value | Octet Length | As Represented in |
| | | Variable Size Integer | | | | Variable Size Integer |
+==============+==============+=======================+ +==============+==============+=======================+
| 10 | 1 | 1000 0010 | | 10 | 1 | 1000 0010 |
+--------------+--------------+-----------------------+ +--------------+--------------+-----------------------+
| 10 | 2 | 0100 0000 0000 0010 | | 10 | 2 | 0100 0000 0000 0010 |
+--------------+--------------+-----------------------+ +--------------+--------------+-----------------------+
| 10 | 3 | 0010 0000 0000 0000 | | 10 | 3 | 0010 0000 0000 0000 |
| | | 0000 0010 | | | | 0000 0010 |
+--------------+--------------+-----------------------+ +--------------+--------------+-----------------------+
| 10 | 4 | 0001 0000 0000 0000 | | 10 | 4 | 0001 0000 0000 0000 |
| | | 0000 0000 0000 0010 | | | | 0000 0000 0000 0010 |
+--------------+--------------+-----------------------+ +--------------+--------------+-----------------------+
Table 2 Table 2: VINT examples depicting the same integer
value rendered at different VINT sizes
5. Element ID 5. Element ID
The Element ID is encoded as a Variable Size Integer. By default, The Element ID is encoded as a Variable Size Integer. By default,
Element IDs are encoded in lengths from one octet to four octets, Element IDs are encoded in lengths from one octet to four octets,
although Element IDs of greater lengths MAY be used if the although Element IDs of greater lengths MAY be used if the
EBMLMaxIDLength Element of the EBML Header is set to a value greater EBMLMaxIDLength Element of the EBML Header is set to a value greater
than four (see Section 11.2.4). The VINT_DATA component of the than four (see Section 11.2.4). The VINT_DATA component of the
Element ID MUST NOT be either defined or written as either all zero Element ID MUST NOT be either defined or written as either all zero
values or all one values. Any Element ID with the VINT_DATA values or all one values. Any Element ID with the VINT_DATA
skipping to change at page 9, line 43 skipping to change at page 9, line 44
shortest valid length. For example, an Element ID with binary shortest valid length. For example, an Element ID with binary
encoding of "1011 1111" is valid, whereas an Element ID with binary encoding of "1011 1111" is valid, whereas an Element ID with binary
encoding of "0100 0000 0011 1111" stores a semantically equal encoding of "0100 0000 0011 1111" stores a semantically equal
VINT_DATA but is invalid because a shorter VINT encoding is possible. VINT_DATA but is invalid because a shorter VINT encoding is possible.
Additionally, an Element ID with binary encoding of "1111 1111" is Additionally, an Element ID with binary encoding of "1111 1111" is
invalid since the VINT_DATA section is set to all one values, whereas invalid since the VINT_DATA section is set to all one values, whereas
an Element ID with binary encoding of "0100 0000 0111 1111" stores a an Element ID with binary encoding of "0100 0000 0111 1111" stores a
semantically equal VINT_DATA and is the shortest possible VINT semantically equal VINT_DATA and is the shortest possible VINT
encoding. encoding.
The following table details these specific examples further: Table 3 details these specific examples further:
+------------+-------------+----------------+--------------------+ +------------+-------------+----------------+--------------------+
| VINT_WIDTH | VINT_MARKER | VINT_DATA | Element ID Status | | VINT_WIDTH | VINT_MARKER | VINT_DATA | Element ID Status |
+============+=============+================+====================+ +============+=============+================+====================+
| | 1 | 0000000 | Invalid: VINT_DATA | | | 1 | 0000000 | Invalid: VINT_DATA |
| | | | MUST NOT be set to | | | | | MUST NOT be set to |
| | | | all 0 | | | | | all 0 |
+------------+-------------+----------------+--------------------+ +------------+-------------+----------------+--------------------+
| 0 | 1 | 00000000000000 | Invalid: VINT_DATA | | 0 | 1 | 00000000000000 | Invalid: VINT_DATA |
| | | | MUST NOT be set to | | | | | MUST NOT be set to |
skipping to change at page 10, line 35 skipping to change at page 10, line 35
| | | | VINT_DATA encoding | | | | | VINT_DATA encoding |
| | | | is available. | | | | | is available. |
+------------+-------------+----------------+--------------------+ +------------+-------------+----------------+--------------------+
| | 1 | 1111111 | Invalid: VINT_DATA | | | 1 | 1111111 | Invalid: VINT_DATA |
| | | | MUST NOT be set to | | | | | MUST NOT be set to |
| | | | all 1 | | | | | all 1 |
+------------+-------------+----------------+--------------------+ +------------+-------------+----------------+--------------------+
| 0 | 1 | 00000001111111 | Valid | | 0 | 1 | 00000001111111 | Valid |
+------------+-------------+----------------+--------------------+ +------------+-------------+----------------+--------------------+
Table 3 Table 3: Examples of valid and invalid VINTs
The octet length of an Element ID determines its EBML Class. The range and count of VINT_DATA values is determined by the octet
length of the VINT. Examples of this are provided in Table 4.
+------------+--------+-------------------------+---------------+ +-----------------------+-------------------------+---------------+
| EBML Class | Length | Possible IDs | Number of IDs | | VINT Length in octets | Range of Possible IDs | Number of IDs |
+============+========+=========================+===============+ +=======================+=========================+===============+
| Class A | 1 | 0x81 - 0xFE | 126 | | 1 | 0x81 - 0xFE | 126 |
+------------+--------+-------------------------+---------------+ +-----------------------+-------------------------+---------------+
| Class B | 2 | 0x407F - 0x7FFE | 16,256 | | 2 | 0x407F - 0x7FFE | 16,256 |
+------------+--------+-------------------------+---------------+ +-----------------------+-------------------------+---------------+
| Class C | 3 | 0x203FFF - 0x3FFFFE | 2,080,768 | | 3 | 0x203FFF - 0x3FFFFE | 2,080,768 |
+------------+--------+-------------------------+---------------+ +-----------------------+-------------------------+---------------+
| Class D | 4 | 0x101FFFFF - 0x1FFFFFFE | 268,338,304 | | 4 | 0x101FFFFF - 0x1FFFFFFE | 268,338,304 |
+------------+--------+-------------------------+---------------+ +-----------------------+-------------------------+---------------+
Table 4 Table 4: Examples of count and range for VINT_DATA per VINT
length in octets
6. Element Data Size 6. Element Data Size
6.1. Data Size Format 6.1. Data Size Format
The Element Data Size expresses the length in octets of Element Data. The Element Data Size expresses the length in octets of Element Data.
The Element Data Size itself is encoded as a Variable Size Integer. The Element Data Size itself is encoded as a Variable Size Integer.
By default, Element Data Sizes can be encoded in lengths from one By default, Element Data Sizes can be encoded in lengths from one
octet to eight octets, although Element Data Sizes of greater lengths octet to eight octets, although Element Data Sizes of greater lengths
MAY be used if the octet length of the longest Element Data Size of MAY be used if the octet length of the longest Element Data Size of
skipping to change at page 11, line 51 skipping to change at page 12, line 19
only reserved value for the VINT_DATA of Element Data Size is all only reserved value for the VINT_DATA of Element Data Size is all
bits set to one. An EBML Element with an unknown Element Data Size bits set to one. An EBML Element with an unknown Element Data Size
is referred to as an Unknown-Sized Element. A Master Element MAY be is referred to as an Unknown-Sized Element. A Master Element MAY be
an Unknown-Sized Element; however an EBML Element that is not a an Unknown-Sized Element; however an EBML Element that is not a
Master Element MUST NOT be an Unknown-Sized Element. Master Elements Master Element MUST NOT be an Unknown-Sized Element. Master Elements
MUST NOT use an unknown size unless the unknownsizeallowed attribute MUST NOT use an unknown size unless the unknownsizeallowed attribute
of their EBML Schema is set to true (see Section 11.1.5.10). of their EBML Schema is set to true (see Section 11.1.5.10).
The use of Unknown-Sized Elements allows for an EBML Element to be The use of Unknown-Sized Elements allows for an EBML Element to be
written and read before the size of the EBML Element is known. written and read before the size of the EBML Element is known.
Unknown-Sized Element MUST NOT be used or defined unnecessarily; Unknown-Sized Elements MUST only be used if the Element Data Size is
however if the Element Data Size is not known before the Element Data not known before the Element Data is written, such as in some cases
is written, such as in some cases of data streaming, then Unknown- of data streaming. The end of an Unknown-Sized Element is determined
Sized Elements MAY be used. The end of an Unknown-Sized Element is by whichever comes first:
determined by whichever comes first:
* Any EBML Element that is a valid Parent Element of the Unknown- * Any EBML Element that is a valid Parent Element of the Unknown-
Sized Element according to the EBML Schema, Global Elements Sized Element according to the EBML Schema, Global Elements
excluded. excluded.
* Any valid EBML Element according to the EBML Schema, Global * Any valid EBML Element according to the EBML Schema, Global
Elements excluded, that is not a Descendant Element of the Elements excluded, that is not a Descendant Element of the
Unknown-Sized Element but share a common direct parent, such as a Unknown-Sized Element but share a common direct parent, such as a
Top-Level Element. Top-Level Element.
skipping to change at page 13, line 45 skipping to change at page 13, line 45
+------------------------------------+----------------------------+ +------------------------------------+----------------------------+
| "\root\level1\level2\elt\<global>" | Global Element is valid, | | "\root\level1\level2\elt\<global>" | Global Element is valid, |
| | it's a child of "elt" | | | it's a child of "elt" |
+------------------------------------+----------------------------+ +------------------------------------+----------------------------+
| "\root\level1\level2\<global>" | Global Element cannot be | | "\root\level1\level2\<global>" | Global Element cannot be |
| | assumed to have this path, | | | assumed to have this path, |
| | while parsing "elt" it can | | | while parsing "elt" it can |
| | only be a child of "elt" | | | only be a child of "elt" |
+------------------------------------+----------------------------+ +------------------------------------+----------------------------+
Table 5 Table 5: Examples of determining the end of an Unknown-Sized
Element
6.3. Data Size Values 6.3. Data Size Values
For Element Data Sizes encoded at octet lengths from one to eight, For Element Data Sizes encoded at octet lengths from one to eight,
this table depicts the range of possible values that can be encoded Table 6 depicts the range of possible values that can be encoded as
as an Element Data Size. An Element Data Size with an octet length an Element Data Size. An Element Data Size with an octet length of 8
of 8 is able to express a size of 2^56-2 or 72,057,594,037,927,934 is able to express a size of 2^56-2 or 72,057,594,037,927,934 octets
octets (or about 72 petabytes). The maximum possible value that can (or about 72 petabytes). The maximum possible value that can be
be stored as Element Data Size is referred to as VINTMAX. stored as Element Data Size is referred to as VINTMAX.
+--------------+----------------------+ +--------------+----------------------+
| Octet Length | Possible Value Range | | Octet Length | Possible Value Range |
+==============+======================+ +==============+======================+
| 1 | 0 to 2^(7-2) | | 1 | 0 to 2^(7-2) |
+--------------+----------------------+ +--------------+----------------------+
| 2 | 0 to 2^(14-2) | | 2 | 0 to 2^(14-2) |
+--------------+----------------------+ +--------------+----------------------+
| 3 | 0 to 2^(21-2) | | 3 | 0 to 2^(21-2) |
+--------------+----------------------+ +--------------+----------------------+
skipping to change at page 14, line 34 skipping to change at page 14, line 34
+--------------+----------------------+ +--------------+----------------------+
| 5 | 0 to 2^(35-2) | | 5 | 0 to 2^(35-2) |
+--------------+----------------------+ +--------------+----------------------+
| 6 | 0 to 2^(42-2) | | 6 | 0 to 2^(42-2) |
+--------------+----------------------+ +--------------+----------------------+
| 7 | 0 to 2^(49-2) | | 7 | 0 to 2^(49-2) |
+--------------+----------------------+ +--------------+----------------------+
| 8 | 0 to 2^(56-2) | | 8 | 0 to 2^(56-2) |
+--------------+----------------------+ +--------------+----------------------+
Table 6 Table 6: Possible range of values
that can be stored in VINTs by
octet length.
If the length of Element Data equals 2^(n*7)-1 then the octet length If the length of Element Data equals 2^(n*7)-1 then the octet length
of the Element Data Size MUST be at least n+1. This rule prevents an of the Element Data Size MUST be at least n+1. This rule prevents an
Element Data Size from being expressed as the unknown size value. Element Data Size from being expressed as the unknown size value.
The following table clarifies this rule by showing a valid and Table 7 clarifies this rule by showing a valid and invalid expression
invalid expression of an Element Data Size with a VINT_DATA of 127 of an Element Data Size with a VINT_DATA of 127 (which is equal to
(which is equal to 2^(1*7)-1) and 16,383 (which is equal to 2^((2*7)- 2^(1*7)-1) and 16,383 (which is equal to 2^((2*7)-1).)
1).)
+------------+-------------+-----------------------+--------------+ +------------+-------------+-----------------------+--------------+
| VINT_WIDTH | VINT_MARKER | VINT_DATA | Element Data | | VINT_WIDTH | VINT_MARKER | VINT_DATA | Element Data |
| | | | Size Status | | | | | Size Status |
+============+=============+=======================+==============+ +============+=============+=======================+==============+
| | 1 | 1111111 | Reserved | | | 1 | 1111111 | Reserved |
| | | | (meaning | | | | | (meaning |
| | | | Unknown) | | | | | Unknown) |
+------------+-------------+-----------------------+--------------+ +------------+-------------+-----------------------+--------------+
| 0 | 1 | 00000001111111 | Valid | | 0 | 1 | 00000001111111 | Valid |
| | | | (meaning 127 | | | | | (meaning 127 |
skipping to change at page 15, line 29 skipping to change at page 15, line 29
+------------+-------------+-----------------------+--------------+ +------------+-------------+-----------------------+--------------+
| 0 | 1 | 11111111111111 | Reserved | | 0 | 1 | 11111111111111 | Reserved |
| | | | (meaning | | | | | (meaning |
| | | | Unknown) | | | | | Unknown) |
+------------+-------------+-----------------------+--------------+ +------------+-------------+-----------------------+--------------+
| 00 | 1 | 000000011111111111111 | Valid | | 00 | 1 | 000000011111111111111 | Valid |
| | | | (16,383 | | | | | (16,383 |
| | | | octets) | | | | | octets) |
+------------+-------------+-----------------------+--------------+ +------------+-------------+-----------------------+--------------+
Table 7 Table 7: Demonstration of VINT_DATA reservation for VINTs of
unknown size.
7. EBML Element Types 7. EBML Element Types
EBML Elements are defined by an EBML Schema (see Section 11.1) which EBML Elements are defined by an EBML Schema (see Section 11.1) which
MUST declare one of the following EBML Element Types for each EBML MUST declare one of the following EBML Element Types for each EBML
Element. An EBML Element Type defines a concept of storing data Element. An EBML Element Type defines a concept of storing data
within an EBML Element that describes such characteristics as length, within an EBML Element that describes such characteristics as length,
endianness, and definition. endianness, and definition.
EBML Elements which are defined as a Signed Integer Element, Unsigned EBML Elements which are defined as a Signed Integer Element, Unsigned
skipping to change at page 22, line 37 skipping to change at page 22, line 41
Within an EBML Schema the "<element>" uses the following attributes Within an EBML Schema the "<element>" uses the following attributes
to define an EBML Element: to define an EBML Element:
11.1.5.1. name 11.1.5.1. name
Within an EBML Schema, the XPath of "@name" attribute is Within an EBML Schema, the XPath of "@name" attribute is
"/EBMLSchema/element/@name". "/EBMLSchema/element/@name".
The name provides the human-readable name of the EBML Element. The The name provides the human-readable name of the EBML Element. The
value of the name MUST be in the form of characters "A" to "Z", "a" value of the name MUST be in the form of characters "A" to "Z", "a"
to "z", "0" to "9", "-" and ".". to "z", "0" to "9", "-" and ".". The first character of the name
MUST be in the form of an "A" to "Z", "a" to "z", "0" to "9"
character.
The name attribute is REQUIRED. The name attribute is REQUIRED.
11.1.5.2. path 11.1.5.2. path
Within an EBML Schema, the XPath of "@path" attribute is Within an EBML Schema, the XPath of "@path" attribute is
"/EBMLSchema/element/@path". "/EBMLSchema/element/@path".
The path defines the allowed storage locations of the EBML Element The path defines the allowed storage locations of the EBML Element
within an EBML Document. This path MUST be defined with the full within an EBML Document. This path MUST be defined with the full
skipping to change at page 30, line 7 skipping to change at page 30, line 14
The lang attribute is OPTIONAL. The lang attribute is OPTIONAL.
11.1.7.2. purpose 11.1.7.2. purpose
Within an EBML Schema, the XPath of "@purpose" attribute is Within an EBML Schema, the XPath of "@purpose" attribute is
"/EBMLSchema/element/documentation/@purpose". "/EBMLSchema/element/documentation/@purpose".
A purpose attribute distinguishes the meaning of the documentation. A purpose attribute distinguishes the meaning of the documentation.
Values for the "<documentation>" sub-element's purpose attribute MUST Values for the "<documentation>" sub-element's purpose attribute MUST
include one of the following: "definition", "rationale", "usage include one of the values listed in Table 8.
notes", and "references".
+------------+-------------------------------------------------+
| value of | definition |
| purpose | |
| attribute | |
+============+=================================================+
| definition | A 'definition' is recommended for every defined |
| | EBML Element. This documentation explains the |
| | semantic meaning of the EBML Element. |
+------------+-------------------------------------------------+
| rationale | An explanation about the reason or catalyst for |
| | the definition of the Element. |
+------------+-------------------------------------------------+
| usage | Recommended practices or guideline for both |
| notes | reading, writing, or interpreting the Element. |
+------------+-------------------------------------------------+
| references | Informational references to support the |
| | contextualization and understanding of the |
| | value of the Element. |
+------------+-------------------------------------------------+
Table 8: Definitions of the permitted values for the purpose
attribute of the documentation Element.
The purpose attribute is REQUIRED. The purpose attribute is REQUIRED.
11.1.8. <implementation_note> Element 11.1.8. <implementation_note> Element
Within an EBML Schema, the XPath of "<implementation_note>" attribute Within an EBML Schema, the XPath of "<implementation_note>" attribute
is "/EBMLSchema/element/implementation_note". is "/EBMLSchema/element/implementation_note".
In some cases within an EBML Document Type, the attributes of the In some cases within an EBML Document Type, the attributes of the
"<element>" element are not sufficient to clearly communicate how the "<element>" element are not sufficient to clearly communicate how the
skipping to change at page 37, line 34 skipping to change at page 38, line 20
CRC-32 Element or if CRC-32 Elements are present but none are valid CRC-32 Element or if CRC-32 Elements are present but none are valid
then the first instance of the Identically Recurring Element should then the first instance of the Identically Recurring Element should
be used for interpretation. be used for interpretation.
11.1.17. Textual expression of floats 11.1.17. Textual expression of floats
When a float value is represented textually in an EBML Schema, such When a float value is represented textually in an EBML Schema, such
as within a default or range value, the float values MUST be as within a default or range value, the float values MUST be
expressed as Hexadecimal Floating-Point Constants as defined in the expressed as Hexadecimal Floating-Point Constants as defined in the
C11 standard [ISO.9899.2011] (see section 6.4.4.2 on Floating C11 standard [ISO.9899.2011] (see section 6.4.4.2 on Floating
Constants). The following table provides examples of expressions of Constants). Table 9 provides examples of expressions of float
float ranges. ranges.
+-------------------+-----------------------------------------+ +-------------------+-----------------------------------------+
| as decimal | as Hexadecimal Floating-Point Constants | | as decimal | as Hexadecimal Floating-Point Constants |
+===================+=========================================+ +===================+=========================================+
| 0.0 | "0x0p+1" | | 0.0 | "0x0p+1" |
+-------------------+-----------------------------------------+ +-------------------+-----------------------------------------+
| 0.0-1.0 | "0x0p+1-0x1p+0" | | 0.0-1.0 | "0x0p+1-0x1p+0" |
+-------------------+-----------------------------------------+ +-------------------+-----------------------------------------+
| 1.0-256.0 | "0x1p+0-0x1p+8" | | 1.0-256.0 | "0x1p+0-0x1p+8" |
+-------------------+-----------------------------------------+ +-------------------+-----------------------------------------+
| 0.857421875 | "0x1.b7p-1" | | 0.857421875 | "0x1.b7p-1" |
+-------------------+-----------------------------------------+ +-------------------+-----------------------------------------+
| -1.0--0.857421875 | "-0x1p+0--0x1.b7p-1" | | -1.0--0.857421875 | "-0x1p+0--0x1.b7p-1" |
+-------------------+-----------------------------------------+ +-------------------+-----------------------------------------+
Table 8 Table 9: Example of floating point values and ranges as
decimal and as Hexadecimal Floating-Point Constants.
Within an expression of a float range, as in an integer range, the - Within an expression of a float range, as in an integer range, the -
(hyphen) character is the separator between the minimal and maximum (hyphen) character is the separator between the minimal and maximum
value permitted by the range. Hexadecimal Floating-Point Constants value permitted by the range. Hexadecimal Floating-Point Constants
also use a - (hyphen) when indicating a negative binary power. also use a - (hyphen) when indicating a negative binary power.
Within a float range, when a - (hyphen) is immediately preceded by a Within a float range, when a - (hyphen) is immediately preceded by a
letter p, then the - (hyphen) is a part of the Hexadecimal Floating- letter p, then the - (hyphen) is a part of the Hexadecimal Floating-
Point Constant which notes negative binary power. Within a float Point Constant which notes negative binary power. Within a float
range, when a - (hyphen) is not immediately preceded by a letter p, range, when a - (hyphen) is not immediately preceded by a letter p,
then the - (hyphen) represents the separator between the minimal and then the - (hyphen) represents the separator between the minimal and
skipping to change at page 38, line 34 skipping to change at page 39, line 23
the EBML Reader although the EBML Element is not present within its the EBML Reader although the EBML Element is not present within its
Parent Element. Parent Element.
If a Mandatory EBML Element has no default value declared by an EBML If a Mandatory EBML Element has no default value declared by an EBML
Schema and its Parent Element is present then the EBML Element MUST Schema and its Parent Element is present then the EBML Element MUST
be present as well. If a Mandatory EBML Element has a default value be present as well. If a Mandatory EBML Element has a default value
declared by an EBML Schema and its Parent Element is present and the declared by an EBML Schema and its Parent Element is present and the
value of the EBML Element is NOT equal to the declared default value value of the EBML Element is NOT equal to the declared default value
then the EBML Element MUST be present. then the EBML Element MUST be present.
This table clarifies if a Mandatory EBML Element MUST be written, Table 10 clarifies if a Mandatory EBML Element MUST be written,
according to if the default value is declared, if the value of the according to if the default value is declared, if the value of the
EBML Element is equal to the declared default value, and if the EBML Element is equal to the declared default value, and if the
Parent Element is used. Parent Element is used.
+-----------------+-------------+---------------+------------------+ +-----------------+-------------+---------------+------------------+
| Is the default | Is the | Is the Parent | Then is storing | | Is the default | Is the | Is the Parent | Then is storing |
| value declared? | value equal | Element | the EBML Element | | value declared? | value equal | Element | the EBML Element |
| | to default? | present? | REQUIRED? | | | to default? | present? | REQUIRED? |
+=================+=============+===============+==================+ +=================+=============+===============+==================+
| Yes | Yes | Yes | No | | Yes | Yes | Yes | No |
skipping to change at page 39, line 23 skipping to change at page 39, line 46
+-----------------+-------------+---------------+------------------+ +-----------------+-------------+---------------+------------------+
| Yes | No | Yes | Yes | | Yes | No | Yes | Yes |
+-----------------+-------------+---------------+------------------+ +-----------------+-------------+---------------+------------------+
| Yes | No | No | No | | Yes | No | No | No |
+-----------------+-------------+---------------+------------------+ +-----------------+-------------+---------------+------------------+
| No | n/a | Yes | Yes | | No | n/a | Yes | Yes |
+-----------------+-------------+---------------+------------------+ +-----------------+-------------+---------------+------------------+
| No | n/a | No | No | | No | n/a | No | No |
+-----------------+-------------+---------------+------------------+ +-----------------+-------------+---------------+------------------+
Table 9 Table 10: Demonstration of the conditional requirements of VINT
Storage.
11.2. EBML Header Elements 11.2. EBML Header Elements
This document contains definitions of all EBML Elements of the EBML This document contains definitions of all EBML Elements of the EBML
Header. Header.
11.2.1. EBML Element 11.2.1. EBML Element
name: EBML name: EBML
skipping to change at page 47, line 8 skipping to change at page 47, line 46
new value of lesser length while maintaining the same Element Data new value of lesser length while maintaining the same Element Data
Size (this can prevent the need to rewrite large portions of an EBML Size (this can prevent the need to rewrite large portions of an EBML
Document); otherwise the use of Null Octets within a String Element Document); otherwise the use of Null Octets within a String Element
or UTF-8 Element is NOT RECOMMENDED. An EBML Reader MUST consider or UTF-8 Element is NOT RECOMMENDED. An EBML Reader MUST consider
the value of the String Element or UTF-8 Element to be terminated the value of the String Element or UTF-8 Element to be terminated
upon the first read Null Octet and MUST ignore any data following the upon the first read Null Octet and MUST ignore any data following the
first Null Octet within that Element. A string value and a copy of first Null Octet within that Element. A string value and a copy of
that string value terminated by one or more Null Octets are that string value terminated by one or more Null Octets are
semantically equal. semantically equal.
The following table shows examples of semantics and validation for Table 11 shows examples of semantics and validation for the use of
the use of Null Octets. Values to represent Stored Values and the Null Octets. Values to represent Stored Values and the Semantic
Semantic Meaning as represented as hexadecimal values. Meaning as represented as hexadecimal values.
+---------------------+---------------------+ +---------------------+---------------------+
| Stored Value | Semantic Meaning | | Stored Value | Semantic Meaning |
+=====================+=====================+ +=====================+=====================+
| 0x65 0x62 0x6D 0x6C | 0x65 0x62 0x6D 0x6C | | 0x65 0x62 0x6D 0x6C | 0x65 0x62 0x6D 0x6C |
+---------------------+---------------------+ +---------------------+---------------------+
| 0x65 0x62 0x00 0x6C | 0x65 0x62 | | 0x65 0x62 0x00 0x6C | 0x65 0x62 |
+---------------------+---------------------+ +---------------------+---------------------+
| 0x65 0x62 0x00 0x00 | 0x65 0x62 | | 0x65 0x62 0x00 0x00 | 0x65 0x62 |
+---------------------+---------------------+ +---------------------+---------------------+
| 0x65 0x62 | 0x65 0x62 | | 0x65 0x62 | 0x65 0x62 |
+---------------------+---------------------+ +---------------------+---------------------+
Table 10 Table 11: Exmaples of semantics for Null
Octets in VINT_DATA.
14. Guidelines for Updating Elements 14. Guidelines for Updating Elements
An EBML Document can be updated without requiring that the entire An EBML Document can be updated without requiring that the entire
EBML Document be rewritten. These recommendations describe EBML Document be rewritten. These recommendations describe
strategies to change the Element Data of a written EBML Element with strategies to change the Element Data of a written EBML Element with
minimal disruption to the rest of the EBML Document. minimal disruption to the rest of the EBML Document.
14.1. Reducing a Element Data in Size 14.1. Reducing a Element Data in Size
skipping to change at page 47, line 50 skipping to change at page 48, line 44
When an EBML Element is changed to reduce its total length by more When an EBML Element is changed to reduce its total length by more
than one octet, an EBML Writer SHOULD fill the freed space with a than one octet, an EBML Writer SHOULD fill the freed space with a
Void Element. Void Element.
14.1.2. Extending the Element Data Size 14.1.2. Extending the Element Data Size
The same value for Element Data Size MAY be written in variable The same value for Element Data Size MAY be written in variable
lengths, so for minor reductions in octet length the Element Data lengths, so for minor reductions in octet length the Element Data
Size MAY be written to a longer octet length to fill the freed space. Size MAY be written to a longer octet length to fill the freed space.
For example, the first row of the following table depicts a String For example, the first row of Table 12 depicts a String Element that
Element that stores an Element ID (3 octets), Element Data Size (1 stores an Element ID (3 octets), Element Data Size (1 octet), and
octet), and Element Data (4 octets). If the Element Data is changed Element Data (4 octets). If the Element Data is changed to reduce
to reduce the length by one octet and if the current length of the the length by one octet and if the current length of the Element Data
Element Data Size is less than its maximum permitted length, then the Size is less than its maximum permitted length, then the Element Data
Element Data Size of that Element MAY be rewritten to increase its Size of that Element MAY be rewritten to increase its length by one
length by one octet. Thus before and after the change the EBML octet. Thus before and after the change the EBML Element maintains
Element maintains the same length of 8 octets and data around the the same length of 8 octets and data around the Element does not need
Element does not need to be moved. to be moved.
+-------------+------------+-------------------+--------------+ +-------------+------------+-------------------+--------------+
| Status | Element ID | Element Data Size | Element Data | | Status | Element ID | Element Data Size | Element Data |
+=============+============+===================+==============+ +=============+============+===================+==============+
| Before edit | 0x3B4040 | 0x84 | 0x65626D6C | | Before edit | 0x3B4040 | 0x84 | 0x65626D6C |
+-------------+------------+-------------------+--------------+ +-------------+------------+-------------------+--------------+
| After edit | 0x3B4040 | 0x4003 | 0x6D6B76 | | After edit | 0x3B4040 | 0x4003 | 0x6D6B76 |
+-------------+------------+-------------------+--------------+ +-------------+------------+-------------------+--------------+
Table 11 Table 12: Example of editing a VINT to reduce VINT_DATA
length by one octet.
This method is RECOMMENDED when the Element Data is reduced by a This method is RECOMMENDED when the Element Data is reduced by a
single octet; for reductions by two or more octets it is RECOMMENDED single octet; for reductions by two or more octets it is RECOMMENDED
to fill the freed space with a Void Element. to fill the freed space with a Void Element.
Note that if the Element Data length needs to be rewritten as Note that if the Element Data length needs to be rewritten as
shortened by one octet and the Element Data Size could be rewritten shortened by one octet and the Element Data Size could be rewritten
as a shorter VINT then it is RECOMMENDED to rewrite the Element Data as a shorter VINT then it is RECOMMENDED to rewrite the Element Data
Size as one octet shorter, shorten the Element Data by one octet, and Size as one octet shorter, shorten the Element Data by one octet, and
follow that Element with a Void Element. For example, the following follow that Element with a Void Element. For example, Table 13
table depicts a String Element that stores an Element ID (3 octets), depicts a String Element that stores an Element ID (3 octets),
Element Data Size (2 octets, but could be rewritten in one octet), Element Data Size (2 octets, but could be rewritten in one octet),
and Element Data (3 octets). If the Element Data is to be rewritten and Element Data (3 octets). If the Element Data is to be rewritten
to a two octet length, then another octet can be taken from Element to a two octet length, then another octet can be taken from Element
Data Size so that there is enough space to add a two octet Void Data Size so that there is enough space to add a two octet Void
Element. Element.
+--------+------------+-------------------+--------------+---------+ +--------+------------+-------------------+--------------+---------+
| Status | Element ID | Element Data Size | Element Data | Void | | Status | Element ID | Element Data Size | Element Data | Void |
| | | | | Element | | | | | | Element |
+========+============+===================+==============+=========+ +========+============+===================+==============+=========+
| Before | 0x3B4040 | 0x4003 | 0x6D6B76 | | | Before | 0x3B4040 | 0x4003 | 0x6D6B76 | |
+--------+------------+-------------------+--------------+---------+ +--------+------------+-------------------+--------------+---------+
| After | 0x3B4040 | 0x82 | 0x6869 | 0xEC80 | | After | 0x3B4040 | 0x82 | 0x6869 | 0xEC80 |
+--------+------------+-------------------+--------------+---------+ +--------+------------+-------------------+--------------+---------+
Table 12 Table 13: Example of editing a VINT to reduce VINT_DATA length
by more than one octet.
14.1.3. Terminating Element Data 14.1.3. Terminating Element Data
For String Elements and UTF-8 Elements the length of Element Data MAY For String Elements and UTF-8 Elements the length of Element Data MAY
be reduced by adding Null Octets to terminate the Element Data (see be reduced by adding Null Octets to terminate the Element Data (see
Section 13). Section 13).
In the following table, a four octets long Element Data is changed to In Table 14, a four octets long Element Data is changed to a three
a three octet long value followed by a Null Octet; the Element Data octet long value followed by a Null Octet; the Element Data Size
Size includes any Null Octets used to terminate Element Data so includes any Null Octets used to terminate Element Data so remains
remains unchanged. unchanged.
+-------------+------------+-------------------+--------------+ +-------------+------------+-------------------+--------------+
| Status | Element ID | Element Data Size | Element Data | | Status | Element ID | Element Data Size | Element Data |
+=============+============+===================+==============+ +=============+============+===================+==============+
| Before edit | 0x3B4040 | 0x84 | 0x65626D6C | | Before edit | 0x3B4040 | 0x84 | 0x65626D6C |
+-------------+------------+-------------------+--------------+ +-------------+------------+-------------------+--------------+
| After edit | 0x3B4040 | 0x84 | 0x6D6B7600 | | After edit | 0x3B4040 | 0x84 | 0x6D6B7600 |
+-------------+------------+-------------------+--------------+ +-------------+------------+-------------------+--------------+
Table 13 Table 14: Example of terminating VINT_DATA with a Null
Octet when reducing VINT length during an edit.
Note that this method is NOT RECOMMENDED. For reductions of one Note that this method is NOT RECOMMENDED. For reductions of one
octet, the method for Extending the Element Data Size SHOULD be used. octet, the method for Extending the Element Data Size SHOULD be used.
For reduction by more than one octet, the method for Adding a Void For reduction by more than one octet, the method for Adding a Void
Element SHOULD be used. Element SHOULD be used.
14.2. Considerations when Updating Elements with Cyclic Redundancy 14.2. Considerations when Updating Elements with Cyclic Redundancy
Check (CRC) Check (CRC)
If the Element to be changed is a Descendant Element of any Master If the Element to be changed is a Descendant Element of any Master
skipping to change at page 54, line 48 skipping to change at page 55, line 48
| 0x4284 | DocTypeExtensionVersion | Described in | | 0x4284 | DocTypeExtensionVersion | Described in |
| | | Section 11.2.11 | | | | Section 11.2.11 |
+------------+-------------------------+-----------------+ +------------+-------------------------+-----------------+
| 0xBF | CRC-32 | Described in | | 0xBF | CRC-32 | Described in |
| | | Section 11.3.1 | | | | Section 11.3.1 |
+------------+-------------------------+-----------------+ +------------+-------------------------+-----------------+
| 0xEC | Void | Described in | | 0xEC | Void | Described in |
| | | Section 11.3.2 | | | | Section 11.3.2 |
+------------+-------------------------+-----------------+ +------------+-------------------------+-----------------+
Table 14 Table 15: IDs and Names for EBML Elements assigned by
this document.
17.2. CELLAR EBML DocType Registry 17.2. CELLAR EBML DocType Registry
This document creates a new IANA Registry called "CELLAR EBML DocType This document creates a new IANA Registry called "CELLAR EBML DocType
Registry". Registry".
To register a new DocType in this registry one needs a DocType name, To register a new DocType in this registry one needs a DocType name,
a Description of the DocType, a Change Controller (IESG or email of a Description of the DocType, a Change Controller (IESG or email of
registrant) and an optional Reference to a document describing the registrant) and an optional Reference to a document describing the
DocType. DocType.
skipping to change at page 55, line 29 skipping to change at page 56, line 29
The use of ASCII corresponds to the types and code already in use, The use of ASCII corresponds to the types and code already in use,
the value is not meant to be visible to the user. the value is not meant to be visible to the user.
DocType string values of "matroska" and "webm" are RESERVED to the DocType string values of "matroska" and "webm" are RESERVED to the
IETF for future use. These can be assigned via the "IESG Approval" IETF for future use. These can be assigned via the "IESG Approval"
or "RFC Required" policies [RFC8126]. or "RFC Required" policies [RFC8126].
18. Normative References 18. Normative References
[RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: [RFC0020] Cerf, V., "ASCII format for network interchange", STD 80,
Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, RFC 20, DOI 10.17487/RFC0020, October 1969,
<https://www.rfc-editor.org/info/rfc3339>. <https://www.rfc-editor.org/info/rfc20>.
[RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF",
RFC 7405, DOI 10.17487/RFC7405, December 2014,
<https://www.rfc-editor.org/info/rfc7405>.
[W3C.REC-xmlschema-0-20041028] [W3C.REC-xmlschema-0-20041028]
Fallside, D. and P. Walmsley, "XML Schema Part 0: Primer Fallside, D. and P. Walmsley, "XML Schema Part 0: Primer
Second Edition", World Wide Web Consortium Recommendation Second Edition", World Wide Web Consortium Recommendation
REC-xmlschema-0-20041028, 28 October 2004, REC-xmlschema-0-20041028, 28 October 2004,
<http://www.w3.org/TR/2004/REC-xmlschema-0-20041028>. <http://www.w3.org/TR/2004/REC-xmlschema-0-20041028>.
[W3C.SPSD-xhtml-basic-20180327] [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
McCarron, S., "XHTML(tm) Basic 1.1 - Second Edition", 27 Specifications: ABNF", STD 68, RFC 5234,
March 2018. DOI 10.17487/RFC5234, January 2008,
<https://www.rfc-editor.org/info/rfc5234>.
[ISO.9899.2011]
International Organization for Standardization,
"Programming languages - C", 2011.
[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for
Writing an IANA Considerations Section in RFCs", BCP 26,
RFC 8126, DOI 10.17487/RFC8126, June 2017,
<https://www.rfc-editor.org/info/rfc8126>.
[W3C.REC-xml-20081126] [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and Requirement Levels", BCP 14, RFC 2119,
F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth DOI 10.17487/RFC2119, March 1997,
Edition)", World Wide Web Consortium Recommendation REC- <https://www.rfc-editor.org/info/rfc2119>.
xml-20081126, 26 November 2008,
<http://www.w3.org/TR/2008/REC-xml-20081126>.
[IEEE.754.1985] [IEEE.754.1985]
Institute of Electrical and Electronics Engineers, Institute of Electrical and Electronics Engineers,
"Standard for Binary Floating-Point Arithmetic", August "Standard for Binary Floating-Point Arithmetic", August
1985. 1985.
[RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF", [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet:
RFC 7405, DOI 10.17487/RFC7405, December 2014, Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002,
<https://www.rfc-editor.org/info/rfc7405>. <https://www.rfc-editor.org/info/rfc3339>.
[RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying
Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646,
September 2009, <https://www.rfc-editor.org/info/rfc5646>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC0020] Cerf, V., "ASCII format for network interchange", STD 80, [ITU.V42.1994]
RFC 20, DOI 10.17487/RFC0020, October 1969, International Telecommunications Union, "Error-correcting
<https://www.rfc-editor.org/info/rfc20>. Procedures for DCEs Using Asynchronous-to-Synchronous
Conversion", 1994.
[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November
2003, <https://www.rfc-editor.org/info/rfc3629>. 2003, <https://www.rfc-editor.org/info/rfc3629>.
[ISO.3309.1979] [ISO.3309.1979]
International Organization for Standardization, "Data International Organization for Standardization, "Data
communication - High-level data link control procedures - communication - High-level data link control procedures -
Frame structure", 1979. Frame structure", 1979.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [W3C.SPSD-xhtml-basic-20180327]
Requirement Levels", BCP 14, RFC 2119, McCarron, S., "XHTML(tm) Basic 1.1 - Second Edition", 27
DOI 10.17487/RFC2119, March 1997, March 2018.
<https://www.rfc-editor.org/info/rfc2119>.
[ITU.V42.1994] [RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying
International Telecommunications Union, "Error-correcting Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646,
Procedures for DCEs Using Asynchronous-to-Synchronous September 2009, <https://www.rfc-editor.org/info/rfc5646>.
Conversion", 1994.
[RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax [ISO.9899.2011]
Specifications: ABNF", STD 68, RFC 5234, International Organization for Standardization,
DOI 10.17487/RFC5234, January 2008, "Programming languages - C", 2011.
<https://www.rfc-editor.org/info/rfc5234>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[W3C.REC-xml-20081126]
Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and
F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth
Edition)", World Wide Web Consortium Recommendation REC-
xml-20081126, 26 November 2008,
<http://www.w3.org/TR/2008/REC-xml-20081126>.
[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for
Writing an IANA Considerations Section in RFCs", BCP 26,
RFC 8126, DOI 10.17487/RFC8126, June 2017,
<https://www.rfc-editor.org/info/rfc8126>.
19. Informative References 19. Informative References
[W3C.REC-xpath-19991116] [W3C.REC-xpath-19991116]
Clark, J. and S. DeRose, "XML Path Language (XPath) Clark, J. and S. DeRose, "XML Path Language (XPath)
Version 1.0", World Wide Web Consortium Recommendation Version 1.0", World Wide Web Consortium Recommendation
REC-xpath-19991116, 16 November 1999, REC-xpath-19991116, 16 November 1999,
<http://www.w3.org/TR/1999/REC-xpath-19991116>. <http://www.w3.org/TR/1999/REC-xpath-19991116>.
[Matroska] IETF, "Matroska Specifications", 2019,
<https://datatracker.ietf.org/doc/draft-ietf-cellar-
matroska/>.
[WebM] The WebM Project, "WebM Container Guidelines", November
2017, <https://www.webmproject.org/docs/container/>.
Authors' Addresses Authors' Addresses
Steve Lhomme Steve Lhomme
Email: slhomme@matroska.org Email: slhomme@matroska.org
Dave Rice Dave Rice
Email: dave@dericed.com Email: dave@dericed.com
 End of changes. 61 change blocks. 
163 lines changed or deleted 202 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/