draft-ietf-cellar-ebml-08.txt   draft-ietf-cellar-ebml-09.txt 
cellar S. Lhomme cellar S. Lhomme
Internet-Draft Internet-Draft
Intended status: Standards Track D. Rice Intended status: Standards Track D. Rice
Expires: May 31, 2019 Expires: July 28, 2019
M. Bunkus M. Bunkus
November 27, 2018 January 24, 2019
Extensible Binary Meta Language Extensible Binary Meta Language
draft-ietf-cellar-ebml-08 draft-ietf-cellar-ebml-09
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 May 31, 2019. This Internet-Draft will expire on July 28, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2018 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 Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Notation and Conventions . . . . . . . . . . . . . . . . . . 4 2. Notation and Conventions . . . . . . . . . . . . . . . . . . 4
3. Security Considerations . . . . . . . . . . . . . . . . . . . 6 3. Security Considerations . . . . . . . . . . . . . . . . . . . 6
4. Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4. Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5. Variable Size Integer . . . . . . . . . . . . . . . . . . . . 7 5. Variable Size Integer . . . . . . . . . . . . . . . . . . . . 8
5.1. VINT_WIDTH . . . . . . . . . . . . . . . . . . . . . . . 8 5.1. VINT_WIDTH . . . . . . . . . . . . . . . . . . . . . . . 8
5.2. VINT_MARKER . . . . . . . . . . . . . . . . . . . . . . . 8 5.2. VINT_MARKER . . . . . . . . . . . . . . . . . . . . . . . 8
5.3. VINT_DATA . . . . . . . . . . . . . . . . . . . . . . . . 8 5.3. VINT_DATA . . . . . . . . . . . . . . . . . . . . . . . . 8
5.4. VINT Examples . . . . . . . . . . . . . . . . . . . . . . 9 5.4. VINT Examples . . . . . . . . . . . . . . . . . . . . . . 9
6. Element ID . . . . . . . . . . . . . . . . . . . . . . . . . 9 6. Element ID . . . . . . . . . . . . . . . . . . . . . . . . . 10
7. Element Data Size . . . . . . . . . . . . . . . . . . . . . . 11 7. Element Data Size . . . . . . . . . . . . . . . . . . . . . . 11
8. EBML Element Types . . . . . . . . . . . . . . . . . . . . . 12 8. EBML Element Types . . . . . . . . . . . . . . . . . . . . . 13
8.1. Signed Integer Element . . . . . . . . . . . . . . . . . 13 8.1. Signed Integer Element . . . . . . . . . . . . . . . . . 13
8.2. Unsigned Integer Element . . . . . . . . . . . . . . . . 13 8.2. Unsigned Integer Element . . . . . . . . . . . . . . . . 14
8.3. Float Element . . . . . . . . . . . . . . . . . . . . . . 13 8.3. Float Element . . . . . . . . . . . . . . . . . . . . . . 14
8.4. String Element . . . . . . . . . . . . . . . . . . . . . 14 8.4. String Element . . . . . . . . . . . . . . . . . . . . . 14
8.5. UTF-8 Element . . . . . . . . . . . . . . . . . . . . . . 14 8.5. UTF-8 Element . . . . . . . . . . . . . . . . . . . . . . 14
8.6. Date Element . . . . . . . . . . . . . . . . . . . . . . 14 8.6. Date Element . . . . . . . . . . . . . . . . . . . . . . 15
8.7. Master Element . . . . . . . . . . . . . . . . . . . . . 14 8.7. Master Element . . . . . . . . . . . . . . . . . . . . . 15
8.8. Binary Element . . . . . . . . . . . . . . . . . . . . . 15 8.8. Binary Element . . . . . . . . . . . . . . . . . . . . . 15
9. Terminating Elements . . . . . . . . . . . . . . . . . . . . 15 9. Terminating Elements . . . . . . . . . . . . . . . . . . . . 16
10. Guidelines for Updating Elements . . . . . . . . . . . . . . 16 10. Guidelines for Updating Elements . . . . . . . . . . . . . . 16
10.1. Reducing a Element Data in Size . . . . . . . . . . . . 16 10.1. Reducing a Element Data in Size . . . . . . . . . . . . 16
10.1.1. Adding a Void Element . . . . . . . . . . . . . . . 16 10.1.1. Adding a Void Element . . . . . . . . . . . . . . . 16
10.1.2. Extending the Element Data Size . . . . . . . . . . 16 10.1.2. Extending the Element Data Size . . . . . . . . . . 17
10.1.3. Terminating Element Data . . . . . . . . . . . . . . 17 10.1.3. Terminating Element Data . . . . . . . . . . . . . . 18
10.2. Considerations when Updating Elements with CRC . . . . . 17 10.2. Considerations when Updating Elements with CRC . . . . . 18
11. EBML Document . . . . . . . . . . . . . . . . . . . . . . . . 18 11. EBML Document . . . . . . . . . . . . . . . . . . . . . . . . 18
11.1. EBML Header . . . . . . . . . . . . . . . . . . . . . . 18 11.1. EBML Header . . . . . . . . . . . . . . . . . . . . . . 18
11.2. EBML Body . . . . . . . . . . . . . . . . . . . . . . . 18 11.2. EBML Body . . . . . . . . . . . . . . . . . . . . . . . 19
12. EBML Stream . . . . . . . . . . . . . . . . . . . . . . . . . 19 12. EBML Stream . . . . . . . . . . . . . . . . . . . . . . . . . 19
13. Elements semantic . . . . . . . . . . . . . . . . . . . . . . 19 13. Elements semantic . . . . . . . . . . . . . . . . . . . . . . 19
13.1. EBML Schema . . . . . . . . . . . . . . . . . . . . . . 19 13.1. EBML Schema . . . . . . . . . . . . . . . . . . . . . . 19
13.1.1. <EBMLSchema> Element . . . . . . . . . . . . . . . . 20 13.1.1. EBML Schema Example . . . . . . . . . . . . . . . . 20
13.1.2. <EBMLSchema> Attributes . . . . . . . . . . . . . . 20 13.1.2. <EBMLSchema> Element . . . . . . . . . . . . . . . . 21
13.1.3. <element> Element . . . . . . . . . . . . . . . . . 20 13.1.3. <EBMLSchema> Attributes . . . . . . . . . . . . . . 21
13.1.4. <element> Attributes . . . . . . . . . . . . . . . . 21 13.1.4. <element> Element . . . . . . . . . . . . . . . . . 22
13.1.5. <documentation> Element . . . . . . . . . . . . . . 26 13.1.5. <element> Attributes . . . . . . . . . . . . . . . . 22
13.1.6. <documentation> Attributes . . . . . . . . . . . . . 26 13.1.6. <documentation> Element . . . . . . . . . . . . . . 28
13.1.7. <restriction> Element . . . . . . . . . . . . . . . 26 13.1.7. <documentation> Attributes . . . . . . . . . . . . . 28
13.1.8. <enum> Element . . . . . . . . . . . . . . . . . . . 26 13.1.8. <restriction> Element . . . . . . . . . . . . . . . 28
13.1.9. <enum> Attributes . . . . . . . . . . . . . . . . . 26 13.1.9. <enum> Element . . . . . . . . . . . . . . . . . . . 28
13.1.10. XML Schema for EBML Schema . . . . . . . . . . . . . 27 13.1.10. <enum> Attributes . . . . . . . . . . . . . . . . . 28
13.1.11. EBML Schema Example . . . . . . . . . . . . . . . . 28 13.1.11. XML Schema for EBML Schema . . . . . . . . . . . . . 29
13.1.12. Identically Recurring Elements . . . . . . . . . . . 29 13.1.12. Identically Recurring Elements . . . . . . . . . . . 30
13.1.13. Expression of range . . . . . . . . . . . . . . . . 30 13.1.13. Textual expression of floats . . . . . . . . . . . . 30
13.1.14. Textual expression of floats . . . . . . . . . . . . 30 13.1.14. Note on the use of default attributes to define
13.1.15. Note on the use of default attributes to define
Mandatory EBML Elements . . . . . . . . . . . . . . 31 Mandatory EBML Elements . . . . . . . . . . . . . . 31
13.2. EBML Header Elements . . . . . . . . . . . . . . . . . . 32 13.2. EBML Header Elements . . . . . . . . . . . . . . . . . . 32
13.2.1. EBML Element . . . . . . . . . . . . . . . . . . . . 32 13.2.1. EBML Element . . . . . . . . . . . . . . . . . . . . 32
13.2.2. EBMLVersion Element . . . . . . . . . . . . . . . . 32 13.2.2. EBMLVersion Element . . . . . . . . . . . . . . . . 32
13.2.3. EBMLReadVersion Element . . . . . . . . . . . . . . 33 13.2.3. EBMLReadVersion Element . . . . . . . . . . . . . . 33
13.2.4. EBMLMaxIDLength Element . . . . . . . . . . . . . . 33 13.2.4. EBMLMaxIDLength Element . . . . . . . . . . . . . . 33
13.2.5. EBMLMaxSizeLength Element . . . . . . . . . . . . . 34 13.2.5. EBMLMaxSizeLength Element . . . . . . . . . . . . . 34
13.2.6. DocType Element . . . . . . . . . . . . . . . . . . 34 13.2.6. DocType Element . . . . . . . . . . . . . . . . . . 34
13.2.7. DocTypeVersion Element . . . . . . . . . . . . . . . 35 13.2.7. DocTypeVersion Element . . . . . . . . . . . . . . . 35
13.2.8. DocTypeReadVersion Element . . . . . . . . . . . . . 35 13.2.8. DocTypeReadVersion Element . . . . . . . . . . . . . 35
skipping to change at page 3, line 35 skipping to change at page 3, line 34
13.3. Global Elements . . . . . . . . . . . . . . . . . . . . 37 13.3. Global Elements . . . . . . . . . . . . . . . . . . . . 37
13.3.1. CRC-32 Element . . . . . . . . . . . . . . . . . . . 37 13.3.1. CRC-32 Element . . . . . . . . . . . . . . . . . . . 37
13.3.2. Void Element . . . . . . . . . . . . . . . . . . . . 38 13.3.2. Void Element . . . . . . . . . . . . . . . . . . . . 38
14. Considerations for Reading EBML Data . . . . . . . . . . . . 38 14. Considerations for Reading EBML Data . . . . . . . . . . . . 38
15. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 38 15. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 38
15.1. CELLAR EBML Element ID Registry . . . . . . . . . . . . 38 15.1. CELLAR EBML Element ID Registry . . . . . . . . . . . . 38
15.2. CELLAR EBML DocType Registry . . . . . . . . . . . . . . 40 15.2. CELLAR EBML DocType Registry . . . . . . . . . . . . . . 40
16. References . . . . . . . . . . . . . . . . . . . . . . . . . 41 16. References . . . . . . . . . . . . . . . . . . . . . . . . . 41
16.1. Normative References . . . . . . . . . . . . . . . . . . 41 16.1. Normative References . . . . . . . . . . . . . . . . . . 41
16.2. Informative References . . . . . . . . . . . . . . . . . 42 16.2. Informative References . . . . . . . . . . . . . . . . . 42
16.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 42 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 42
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
(such as containers for multimedia content) using an "EBML Schema". using an "EBML Schema". "EBML" is used by the multimedia container
Matroska [1]. It MAY be used for use cases similar to those. The
applicability of "EBML" for other use cases is beyond the scope of
this document.
The definition of the "EBML" format recognizes the idea behind HTML The definition of the "EBML" format recognizes the idea behind HTML
and XML as a good one: separate structure and semantics allowing the and XML as a good one: separate structure and semantics allowing the
same structural layer to be used with multiple, possibly widely same structural layer to be used with multiple, possibly widely
differing semantic layers. Except for the "EBML Header" and a few differing semantic layers. Except for the "EBML Header" and a few
"Global Elements" this specification does not define particular "Global Elements" this specification does not define particular
"EBML" format semantics; however this specification is intended to "EBML" format semantics; however this specification is intended to
define how other "EBML"-based formats can be defined. define how other "EBML"-based formats can be defined.
"EBML" uses a simple approach of building "Elements" upon three "EBML" uses a simple approach of building "Elements" upon three
pieces of data (tag, length, and value) as this approach is well pieces of data (tag, length, and value) as this approach is well
known, easy to parse, and allows selective data parsing. The "EBML" known, easy to parse, and allows selective data parsing. The "EBML"
structure additionally allows for hierarchical arrangement to support structure additionally allows for hierarchical arrangement to support
complex structural formats in an efficient manner. complex structural formats in an efficient manner.
2. Notation and Conventions 2. Notation and Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
document are to be interpreted as described in [RFC2119]. "OPTIONAL" in this document are to be interpreted as described in BCP
14 [2] [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here.
This document defines specific terms in order to define the format This document defines specific terms in order to define the format
and application of "EBML". Specific terms are defined below: and application of "EBML". Specific terms are defined below:
"EBML": Extensible Binary Meta Language "EBML": Extensible Binary Meta Language
"EBML Document Type": A name provided by an "EBML Schema" to "EBML Document Type": A name provided by an "EBML Schema" to
designate a particular implementation of "EBML" for a data format designate a particular implementation of "EBML" for a data format
(e.g.: matroska and webm). (e.g.: matroska and webm).
skipping to change at page 4, line 41 skipping to change at page 4, line 46
"EBML Document": A datastream comprised of only two components, an "EBML Document": A datastream comprised of only two components, an
"EBML Header" and an "EBML Body". "EBML Header" and an "EBML Body".
"EBML Reader": A data parser that interprets the semantics of an "EBML Reader": A data parser that interprets the semantics of an
"EBML Document" and creates a way for programs to use "EBML". "EBML Document" and creates a way for programs to use "EBML".
"EBML Stream": A file that consists of one or more "EBML Documents" "EBML Stream": A file that consists of one or more "EBML Documents"
that are concatenated together. that are concatenated together.
"EBML Header": A declaration that provides processing instructions "EBML Header": A declaration that provides processing instructions
and identification of the "EBML Body". The "EBML Header" may be and identification of the "EBML Body". The "EBML Header" is
considered as analogous to an XML Declaration [W3C.REC-xml-20081126] analogous to an XML Declaration [W3C.REC-xml-20081126] (see section
(see section 2.8 on Prolog and Document Type Declaration). 2.8 on Prolog and Document Type Declaration).
"EBML Body": All data of an "EBML Document" following the "EBML "EBML Body": All data of an "EBML Document" following the "EBML
Header". Header".
"Variable Size Integer": A compact variable-length binary value which "Variable Size Integer": A compact variable-length binary value which
defines its own length. defines its own length.
"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:
skipping to change at page 6, line 37 skipping to change at page 6, line 39
authorization. "EBML" only offers marginally useful and effective authorization. "EBML" only offers marginally useful and effective
data integrity options, such as CRC elements. data integrity options, such as CRC elements.
Even if the semantic layer offers any kind of encryption, "EBML" Even if the semantic layer offers any kind of encryption, "EBML"
itself could leak information at both the semantic layer (as declared itself could leak information at both the semantic layer (as declared
via the "DocType Element") and within the "EBML" structure (the via the "DocType Element") and within the "EBML" structure (the
presence of "EBML Elements" can be derived even with an unknown presence of "EBML Elements" can be derived even with an unknown
semantic layer using a heuristic approach; not without errors, of semantic layer using a heuristic approach; not without errors, of
course, but with a certain degree of confidence). course, but with a certain degree of confidence).
Attacks on an "EBML Reader" could include: An "EBML Document" that has the following issues may still be handled
by the "EBML Reader" and the data accepted as such:
o Invalid "Element IDs" that are longer than the limit stated in the o Invalid "Element IDs" that are longer than the limit stated in the
"EBMLMaxIDLength Element" of the "EBML Header". "EBMLMaxIDLength Element" of the "EBML Header".
o Invalid "Element IDs" that are not encoded in the shortest- o Invalid "Element IDs" that are not encoded in the shortest-
possible way. possible way.
o Invalid "Element IDs" comprised of reserved values. o Invalid "Element IDs" comprised of reserved values.
o Invalid "Element Data Size" values that are longer than the limit o Invalid "Element Data Size" values that are longer than the limit
stated in the "EBMLMaxSizeLength Element" of the "EBML Header". stated in the "EBMLMaxSizeLength Element" of the "EBML Header".
o Usage of "0x00" octets in "EBML Elements" with a string type.
An "EBML Reader" may discard some or all data if the following errors
are found in the "EBML Document":
o Invalid "Element Data Size" values (e.g. extending the length of o Invalid "Element Data Size" values (e.g. extending the length of
the "EBML Element" beyond the scope of the "Parent Element"; the "EBML Element" beyond the scope of the "Parent Element";
possibly triggering access-out-of-bounds issues). possibly triggering access-out-of-bounds issues).
o Very high lengths in order to force out-of-memory situations o Very high lengths in order to force out-of-memory situations
resulting in a denial of service, access-out-of-bounds issues etc. resulting in a denial of service, access-out-of-bounds issues etc.
o Missing "EBML Elements" that are mandatory and have no declared o Missing "EBML Elements" that are mandatory and have no declared
default value. default value.
o Usage of "0x00" octets in "EBML Elements" with a string type.
o Usage of invalid UTF-8 encoding in "EBML Elements" of UTF-8 type o Usage of invalid UTF-8 encoding in "EBML Elements" of UTF-8 type
(e.g. in order to trigger access-out-of-bounds or buffer overflow (e.g. in order to trigger access-out-of-bounds or buffer overflow
issues). issues).
o Usage of invalid data in "EBML Elements" with a date type. o Usage of invalid data in "EBML Elements" with a date type.
Side channel attacks could exploit: Side channel attacks could exploit:
o The semantic equivalence of the same string stored in a "String o The semantic equivalence of the same string stored in a "String
Element" or "UTF-8 Element" with and without zero-bit padding. Element" or "UTF-8 Element" with and without zero-bit padding.
o The semantic equivalence of "VINT_DATA" within "Element Data Size" o The semantic equivalence of "VINT_DATA" within "Element Data Size"
with to different lengths due to left-padding zero bits. with two different lengths due to left-padding zero bits.
o Data contained within a "Master Element" which is not itself part o Data contained within a "Master Element" which is not itself part
of an "EBML Element". of an "EBML Element".
o Extraneous copies of "Identically Recurring Element". o Extraneous copies of "Identically Recurring Element".
o Copies of "Identically Recurring Element" within a "Parent o Copies of "Identically Recurring Element" within a "Parent
Element" that contain invalid "CRC-32 Elements". Element" that contain invalid "CRC-32 Elements".
o Use of "Void Elements". o Use of "Void Elements".
An "EBML Reader" MAY use the data if it considers it doesn't create
any security issue.
4. Structure 4. Structure
"EBML" uses a system of "Elements" to compose an "EBML Document". "EBML" uses a system of "Elements" to compose an "EBML Document".
"EBML Elements" incorporate three parts: an "Element ID", an "Element "EBML Elements" incorporate three parts: an "Element ID", an "Element
Data Size", and "Element Data". The "Element Data", which is Data Size", and "Element Data". The "Element Data", which is
described by the "Element ID", includes either binary data, one or described by the "Element ID", includes either binary data, one or
many other "EBML Elements", or both. more other "EBML Elements", or both.
5. Variable Size Integer 5. Variable Size Integer
The "Element ID" and "Element Data Size" are both encoded as a The "Element ID" and "Element Data Size" are both encoded as a
"Variable Size Integer", developed according to a UTF-8 like system. "Variable Size Integer". The "Variable Size Integer" is composed of
The "Variable Size Integer" is composed of a "VINT_WIDTH", a "VINT_WIDTH", "VINT_MARKER", and "VINT_DATA", in that order.
"VINT_MARKER", and "VINT_DATA", in that order. "Variable Size "Variable Size Integers" MUST left-pad the "VINT_DATA" value with
Integers" MUST left-pad the "VINT_DATA" value with zero bits so that zero bits so that the whole "Variable Size Integer" is octet-aligned.
the whole "Variable Size Integer" is octet-aligned. "Variable Size "Variable Size Integer" will be referred to as "VINT" for shorthand.
Integer" will be referred to as "VINT" for shorthand.
5.1. VINT_WIDTH 5.1. VINT_WIDTH
Each "Variable Size Integer" begins with a "VINT_WIDTH" which Each "Variable Size Integer" begins with a "VINT_WIDTH" which
consists of zero or many zero-value bits. The count of consecutive consists of zero or many zero-value bits. The count of consecutive
zero-values of the "VINT_WIDTH" plus one equals the length in octets zero-values of the "VINT_WIDTH" plus one equals the length in octets
of the "Variable Size Integer". For example, a "Variable Size of the "Variable Size Integer". For example, a "Variable Size
Integer" that starts with a "VINT_WIDTH" which contains zero Integer" that starts with a "VINT_WIDTH" which contains zero
consecutive zero-value bits is one octet in length and a "Variable consecutive zero-value bits is one octet in length and a "Variable
Size Integer" that starts with one consecutive zero-value bit is two Size Integer" that starts with one consecutive zero-value bit is two
skipping to change at page 8, line 33 skipping to change at page 8, line 42
"VINT_WIDTH" is one less than the value set in the "EBMLMaxIDLength "VINT_WIDTH" is one less than the value set in the "EBMLMaxIDLength
Element". Within the "EBML Body", when a "VINT" is used to express Element". Within the "EBML Body", when a "VINT" is used to express
an "Element Data Size", the maximum length allowed for the an "Element Data Size", the maximum length allowed for the
"VINT_WIDTH" is one less than the value set in the "EBMLMaxSizeLength "VINT_WIDTH" is one less than the value set in the "EBMLMaxSizeLength
Element". Element".
5.2. VINT_MARKER 5.2. VINT_MARKER
The "VINT_MARKER" serves as a separator between the "VINT_WIDTH" and The "VINT_MARKER" serves as a separator between the "VINT_WIDTH" and
"VINT_DATA". Each "Variable Size Integer" MUST contain exactly one "VINT_DATA". Each "Variable Size Integer" MUST contain exactly one
"VINT_MARKER". The "VINT_MARKER" MUST be one bit in length and "VINT_MARKER". The "VINT_MARKER" is one bit in length and contain a
contain a bit with a value of one. The first bit with a value of one bit with a value of one. The first bit with a value of one within
within the "Variable Size Integer" is the "VINT_MARKER". the "Variable Size Integer" is the "VINT_MARKER".
5.3. VINT_DATA 5.3. VINT_DATA
The "VINT_DATA" portion of the "Variable Size Integer" includes all The "VINT_DATA" portion of the "Variable Size Integer" includes all
data that follows (but not including) the "VINT_MARKER" until end of data that follows (but not including) the "VINT_MARKER" until end of
the "Variable Size Integer" whose length is derived from the the "Variable Size Integer" whose length is derived from the
"VINT_WIDTH". The bits required for the "VINT_WIDTH" and the "VINT_WIDTH". The bits required for the "VINT_WIDTH" and the
"VINT_MARKER" combined use one out of eight bits of the total length "VINT_MARKER" use one out of every eight bits of the total length of
of the "Variable Size Integer". Thus a "Variable Size Integer" of 1 the "Variable Size Integer". Thus a "Variable Size Integer" of 1
octet length supplies 7 bits for "VINT_DATA", a 2 octet length octet length supplies 7 bits for "VINT_DATA", a 2 octet length
supplies 14 bits for "VINT_DATA", and a 3 octet length supplies 21 supplies 14 bits for "VINT_DATA", and a 3 octet length supplies 21
bits for "VINT_DATA". If the number of bits required for "VINT_DATA" bits for "VINT_DATA". If the number of bits required for "VINT_DATA"
are less than the bit size of "VINT_DATA", then "VINT_DATA" SHOULD be 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" value zero-padded to the left to a size that fits. The "VINT_DATA" value
MUST be expressed as a big-endian unsigned integer. MUST be expressed as a big-endian unsigned integer.
5.4. VINT Examples 5.4. VINT Examples
This table shows examples of "Variable Size Integers" with lengths This table shows examples of "Variable Size Integers" with lengths
from 1 to 5 octets. The Size column refers to the size of the from 1 to 5 octets. The Size column refers to the size of the
"VINT_DATA" in bits. The Representation column depicts a binary "VINT_DATA" in bits. The Representation column depicts a binary
expression of "Variable Size Integers" where "VINT_WIDTH" is depicted expression of "Variable Size Integers" where "VINT_WIDTH" is depicted
by '0', the "VINT_MARKER" as '1', and the "VINT_DATA" as 'x'. by '0', the "VINT_MARKER" as '1', and the "VINT_DATA" as 'x'.
skipping to change at page 9, line 26 skipping to change at page 9, line 34
+-------------+------+----------------------------------------------+ +-------------+------+----------------------------------------------+
| 1 | 2^7 | 1xxx xxxx | | 1 | 2^7 | 1xxx xxxx |
| 2 | 2^14 | 01xx xxxx xxxx xxxx | | 2 | 2^14 | 01xx xxxx xxxx xxxx |
| 3 | 2^21 | 001x xxxx xxxx xxxx xxxx xxxx | | 3 | 2^21 | 001x xxxx xxxx xxxx xxxx xxxx |
| 4 | 2^28 | 0001 xxxx xxxx xxxx xxxx xxxx xxxx xxxx | | 4 | 2^28 | 0001 xxxx xxxx xxxx xxxx xxxx xxxx xxxx |
| 5 | 2^35 | 0000 1xxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx | | 5 | 2^35 | 0000 1xxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx |
| | | xxxx | | | | xxxx |
+-------------+------+----------------------------------------------+ +-------------+------+----------------------------------------------+
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 this table a binary lengths larger than needed to store the data in order to facilitate
value of "0b10" is shown encoded as different "Variable Size overwriting it at a later date, e.g. when its final size isn't known
Integers" with lengths from one octet to four octet. All four in advance. In this table a binary value of "0b10" is shown encoded
encoded examples have identical semantic meaning though the as different "Variable Size Integers" with lengths from one octet to
"VINT_WIDTH" and the padding of the "VINT_DATA" vary. four octet. All four encoded examples have identical semantic
meaning though the "VINT_WIDTH" and the padding of the "VINT_DATA"
vary.
+--------------+--------------+-------------------------------------+ +--------------+--------------+-------------------------------------+
| Binary Value | Octet Length | As Represented in Variable Size | | Binary Value | Octet Length | As Represented in Variable Size |
| | | Integer | | | | 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 0000 0010 | | 10 | 3 | 0010 0000 0000 0000 0000 0010 |
| 10 | 4 | 0001 0000 0000 0000 0000 0000 0000 | | 10 | 4 | 0001 0000 0000 0000 0000 0000 0000 |
| | | 0010 | | | | 0010 |
+--------------+--------------+-------------------------------------+ +--------------+--------------+-------------------------------------+
6. Element ID 6. Element ID
The "Element ID" MUST be encoded as a "Variable Size Integer". By The "Element ID" is encoded as a "Variable Size Integer". By
default, "Element IDs" are encoded in lengths from one octet to four default, "Element IDs" are encoded in lengths from one octet to four
octets, although "Element IDs" of greater lengths are used if the octets, although "Element IDs" of greater lengths are used if the
octet length of the longest "Element ID" of the "EBML Document" is octet length of the longest "Element ID" of the "EBML Document" is
declared in the "EBMLMaxIDLength Element" of the "EBML Header" (see declared in the "EBMLMaxIDLength Element" of the "EBML Header" (see
Section 13.2.4). The "VINT_DATA" component of the "Element ID" MUST Section 13.2.4). The "VINT_DATA" component of the "Element ID" MUST
NOT be either defined or written as either all zero values or all one NOT be either defined or written as either all zero values or all one
values. Any "Element ID" with the "VINT_DATA" component set as all values. Any "Element ID" with the "VINT_DATA" component set as all
zero values or all one values MUST be ignored and MUST NOT be zero values or all one values MUST be ignored. The "VINT_DATA"
considered an error in the "EBML Document". The "VINT_DATA"
component of the "Element ID" MUST be encoded at the shortest valid component of the "Element ID" MUST be encoded at the shortest valid
length. For example, an "Element ID" with binary encoding of "1011 length. For example, an "Element ID" with binary encoding of "1011
1111" is valid, whereas an "Element ID" with binary encoding of "0100 1111" is valid, whereas an "Element ID" with binary encoding of "0100
0000 0011 1111" stores a semantically equal "VINT_DATA" but is 0000 0011 1111" stores a semantically equal "VINT_DATA" but is
invalid because a shorter "VINT" encoding is possible. Additionally, invalid because a shorter "VINT" encoding is possible. Additionally,
an "Element ID" with binary encoding of "1111 1111" is invalid since an "Element ID" with binary encoding of "1111 1111" is invalid since
the "VINT_DATA" section is set to all one values, whereas an "Element the "VINT_DATA" section is set to all one values, whereas an "Element
ID" with binary encoding of "0100 0000 0111 1111" stores a 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.
skipping to change at page 11, line 8 skipping to change at page 11, line 17
+------------+--------------+--------------------------------+ +------------+--------------+--------------------------------+
| Class A | 1 | 2^7 - 2 = 126 | | Class A | 1 | 2^7 - 2 = 126 |
| Class B | 2 | 2^14 - 2^7 - 1 = 16,255 | | Class B | 2 | 2^14 - 2^7 - 1 = 16,255 |
| Class C | 3 | 2^21 - 2^14 - 1 = 2,080,767 | | Class C | 3 | 2^21 - 2^14 - 1 = 2,080,767 |
| Class D | 4 | 2^28 - 2^21 - 1 = 266,338,303 | | Class D | 4 | 2^28 - 2^21 - 1 = 266,338,303 |
+------------+--------------+--------------------------------+ +------------+--------------+--------------------------------+
7. Element Data Size 7. Element Data Size
The "Element Data Size" expresses the length in octets of "Element The "Element Data Size" expresses the length in octets of "Element
Data". The "Element Data Size" itself MUST be encoded as a "Variable Data". The "Element Data Size" itself is encoded as a "Variable Size
Size Integer". By default, "Element Data Sizes" can be encoded in Integer". By default, "Element Data Sizes" can be encoded in lengths
lengths from one octet to eight octets, although "Element Data Sizes" from one octet to eight octets, although "Element Data Sizes" of
of greater lengths MAY be used if the octet length of the longest greater lengths MAY be used if the octet length of the longest
"Element Data Size" of the "EBML Document" is declared in the "Element Data Size" of the "EBML Document" is declared in the
"EBMLMaxSizeLength Element" of the "EBML Header" (see "EBMLMaxSizeLength Element" of the "EBML Header" (see
Section 13.2.5). Unlike the "VINT_DATA" of the "Element ID", the Section 13.2.5). Unlike the "VINT_DATA" of the "Element ID", the
"VINT_DATA" component of the "Element Data Size" is not mandated to "VINT_DATA" component of the "Element Data Size" is not mandated to
be encoded at the shortest valid length. For example, an "Element be encoded at the shortest valid length. For example, an "Element
Data Size" with binary encoding of "1011 1111" or a binary encoding Data Size" with binary encoding of "1011 1111" or a binary encoding
of "0100 0000 0011 1111" are both valid "Element Data Sizes" and both of "0100 0000 0011 1111" are both valid "Element Data Sizes" and both
store a semantically equal value (both "0b00000000111111" and store a semantically equal value (both "0b00000000111111" and
"0b0111111", the "VINT_DATA" sections of the examples, represent the "0b0111111", the "VINT_DATA" sections of the examples, represent the
integer 63). integer 63).
skipping to change at page 11, line 40 skipping to change at page 11, line 49
Reader" MUST interpret the value of the "Empty Element" as the Reader" MUST interpret the value of the "Empty Element" as the
"default" value. If an "Empty Element" has no "default" value "default" value. If an "Empty Element" has no "default" value
declared then the "EBML Reader" MUST interpret the value of the declared then the "EBML Reader" MUST interpret the value of the
"Empty Element" as defined as part of the definition of the "Empty Element" as defined as part of the definition of the
corresponding "EBML Element Type" associated with the "Element ID". corresponding "EBML Element Type" associated with the "Element ID".
An "Element Data Size" with all "VINT_DATA" bits set to one is An "Element Data Size" with all "VINT_DATA" bits set to one is
reserved as an indicator that the size of the "EBML Element" is reserved as an indicator that the size of the "EBML Element" is
unknown. The only reserved value for the "VINT_DATA" of "Element unknown. The only reserved value for the "VINT_DATA" of "Element
Data Size" is all bits set to one. An "EBML Element" with an unknown Data Size" is all bits set to one. An "EBML Element" with an unknown
"Element Data Size" is referred to as an "Unknown-Sized Element". "Element Data Size" is referred to as an "Unknown-Sized Element". A
Only "Master Elements" SHALL be "Unknown-Sized Elements". "Master "Master Element" MAY be an "Unknown-Sized Element"; however an "EBML
Elements" MUST NOT use an unknown size unless the Element" that is not a "Master Element" MUST NOT be an "Unknown-Sized
Element". "Master Elements" MUST NOT use an unknown size unless the
"unknownsizeallowed" attribute of their "EBML Schema" is set to true "unknownsizeallowed" attribute of their "EBML Schema" is set to true
(see Section 13.1.4.10). The use of "Unknown-Sized Elements" allows (see Section 13.1.5.10). The use of "Unknown-Sized Elements" allows
for an "EBML Element" to be written and read before the size of the for an "EBML Element" to be written and read before the size of the
"EBML Element" is known. "Unknown-Sized Element" MUST NOT be used or "EBML Element" is known. "Unknown-Sized Element" MUST NOT be used or
defined unnecessarily; however if the "Element Data Size" is not defined unnecessarily; however if the "Element Data Size" is not
known before the "Element Data" is written, such as in some cases of known before the "Element Data" is written, such as in some cases of
data streaming, then "Unknown-Sized Elements" MAY be used. The end data streaming, then "Unknown-Sized Elements" MAY be used. The end
of an "Unknown-Sized Element" is determined by whichever comes first: of an "Unknown-Sized Element" is determined by whichever comes first:
the end of the file or the beginning of the next "EBML Element", the end of the file or the beginning of the next "EBML Element",
defined by this document or the corresponding "EBML Schema", that is defined by this document or the corresponding "EBML Schema", that is
not independently valid as "Descendant Element" of the "Unknown-Sized not independently valid as "Descendant Element" of the "Unknown-Sized
Element". Element".
skipping to change at page 12, line 31 skipping to change at page 12, line 41
| 4 | 0 to 2^28-2 | | 4 | 0 to 2^28-2 |
| 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 |
+--------------+----------------------+ +--------------+----------------------+
If the length of "Element Data" equals "2^(n*7)-1" then the octet 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 length of the "Element Data Size" MUST be at least "n+1". This rule
prevents an "Element Data Size" from being expressed as a reserved prevents an "Element Data Size" from being expressed as a reserved
value. For example, an "EBML Element" with an octet length of 127 value. The following table clarifies this rule by showing a valid
MUST NOT be encoded in an "Element Data Size" encoding with a one and invalid expression of an "Element Data Size" with a "VINT_DATA"
octet length. The following table clarifies this rule by showing a of 127 (which is equal to 2^(1_7)-1) and 16,383 (which is equal to
valid and invalid expression of an "Element Data Size" with a 2^(2_7)-1).
"VINT_DATA" of 127 (which is equal to 2^(1*7)-1).
+------------+-------------+----------------+-----------------------+ +------------+-------------+-----------------------+----------------+
| VINT_WIDTH | VINT_MARKER | VINT_DATA | Element Data Size | | VINT_WIDTH | VINT_MARKER | VINT_DATA | Element Data |
| | | | Status | | | | | Size Status |
+------------+-------------+----------------+-----------------------+ +------------+-------------+-----------------------+----------------+
| | 1 | 1111111 | Reserved (meaning | | | 1 | 1111111 | Reserved |
| | | | Unknown) | | | | | (meaning |
| 0 | 1 | 00000001111111 | Valid (meaning 127 | | | | | Unknown) |
| | | | octets) | | 0 | 1 | 00000001111111 | Valid (meaning |
+------------+-------------+----------------+-----------------------+ | | | | 127 octets) |
| 00 | 1 | 000000000000001111111 | Valid (meaning |
| | | | 127 octets) |
| 0 | 1 | 11111111111111 | Reserved |
| | | | (meaning |
| | | | Unknown) |
| 00 | 1 | 000000011111111111111 | Valid (16,383 |
| | | | octets) |
+------------+-------------+-----------------------+----------------+
8. EBML Element Types 8. EBML Element Types
"EBML Elements" are defined by an "EBML Schema" which MUST declare "EBML Elements" are defined by an "EBML Schema" which MUST declare
one of the following "EBML Element Types" for each "EBML Element". one of the following "EBML Element Types" for each "EBML Element".
An "EBML Element Type" defines a concept of storing data within an An "EBML Element Type" defines a concept of storing data within an
"EBML Element" that describes such characteristics as length, "EBML Element" that describes such characteristics as length,
endianness, and definition. endianness, and definition.
"EBML Elements" which are defined as a "Signed Integer Element", "EBML Elements" which are defined as a "Signed Integer Element",
skipping to change at page 13, line 20 skipping to change at page 13, line 44
8.1. Signed Integer Element 8.1. Signed Integer Element
A "Signed Integer Element" MUST declare a length from zero to eight A "Signed Integer Element" MUST declare a length from zero to eight
octets. If the "EBML Element" is not defined to have a "default" octets. If the "EBML Element" is not defined to have a "default"
value, then a "Signed Integer Element" with a zero-octet length value, then a "Signed Integer Element" with a zero-octet length
represents an integer value of zero. represents an integer value of zero.
A "Signed Integer Element" stores an integer (meaning that it can be A "Signed Integer Element" stores an integer (meaning that it can be
written without a fractional component) which could be negative, written without a fractional component) which could be negative,
positive, or zero. Signed Integers MUST be stored with two's positive, or zero. Signed Integers are stored with two's complement
complement notation with the leftmost bit being the sign bit. notation with the leftmost bit being the sign bit. Because "EBML"
Because "EBML" limits Signed Integers to 8 octets in length a "Signed limits Signed Integers to 8 octets in length a "Signed Integer
Integer Element" stores a number from -9,223,372,036,854,775,808 to Element" stores a number from -9,223,372,036,854,775,808 to
+9,223,372,036,854,775,807. +9,223,372,036,854,775,807.
8.2. Unsigned Integer Element 8.2. Unsigned Integer Element
An "Unsigned Integer Element" MUST declare a length from zero to An "Unsigned Integer Element" MUST declare a length from zero to
eight octets. If the "EBML Element" is not defined to have a eight octets. If the "EBML Element" is not defined to have a
"default" value, then an "Unsigned Integer Element" with a zero-octet "default" value, then an "Unsigned Integer Element" with a zero-octet
length represents an integer value of zero. length represents an integer value of zero.
An "Unsigned Integer Element" stores an integer (meaning that it can An "Unsigned Integer Element" stores an integer (meaning that it can
skipping to change at page 14, line 51 skipping to change at page 15, line 30
8.7. Master Element 8.7. Master Element
A "Master Element" MUST declare a length in octets from zero to A "Master Element" MUST declare a length in octets from zero to
"VINTMAX". The "Master Element" MAY also use an unknown length. See "VINTMAX". The "Master Element" MAY also use an unknown length. See
Section 7 for rules that apply to elements of unknown length. Section 7 for rules that apply to elements of unknown length.
The "Master Element" contains zero, one, or many other elements. The "Master Element" contains zero, one, or many other elements.
"EBML Elements" contained within a "Master Element" MUST have the "EBML Elements" contained within a "Master Element" MUST have the
"EBMLParentPath" of their "Element Path" equals to the "EBMLParentPath" of their "Element Path" equals to the
"EBMLReferencePath" of the "Master Element" "Element Path" (see "EBMLReferencePath" of the "Master Element" "Element Path" (see
Section 13.1.4.2). "Element Data" stored within "Master Elements" Section 13.1.5.2). "Element Data" stored within "Master Elements"
SHOULD only consist of "EBML Elements" and SHOULD NOT contain any SHOULD only consist of "EBML Elements" and SHOULD NOT contain any
data that is not part of an "EBML Element". When "EBML" is used in data that is not part of an "EBML Element". When "EBML" is used in
transmission or streaming, data that is not part of an "EBML Element" transmission or streaming, data that is not part of an "EBML Element"
is permitted to be present within a "Master Element" if is permitted to be present within a "Master Element" if
"unknownsizeallowed" is enabled within the definition for that "unknownsizeallowed" is enabled within the definition for that
"Master Element". In this case, the "EBML Reader" should skip data "Master Element". In this case, the "EBML Reader" should skip data
until a valid "Element ID" of the same "EBMLParentPath" or the next until a valid "Element ID" of the same "EBMLParentPath" or the next
upper level "Element Path" of the "Master Element" is found. What upper level "Element Path" of the "Master Element" is found. The
"Element IDs" are considered valid within a "Master Element" is "EBML Schema" identifies what "Element IDs" are valid within the
identified by the "EBML Schema" for that version of the "EBML "Master Elements" for that version of the "EBML Document Type". Any
Document Type". Any data contained within a "Master Element" that is data contained within a "Master Element" that is not part of a "Child
not part of a "Child Element" MUST be ignored. Element" MUST be ignored.
8.8. Binary Element 8.8. Binary Element
A "Binary Element" MUST declare a length in octets from zero to A "Binary Element" MUST declare a length in octets from zero to
"VINTMAX". "VINTMAX".
The contents of a "Binary Element" should not be interpreted by the The contents of a "Binary Element" should not be interpreted by the
"EBML Reader". "EBML Reader".
9. Terminating Elements 9. Terminating Elements
skipping to change at page 16, line 47 skipping to change at page 17, line 29
the "EBML Element" maintains the same length of 8 octets and data the "EBML Element" maintains the same length of 8 octets and data
around the "Element" does not need to be moved. around the "Element" does not need 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 |
+-------------+------------+-------------------+--------------+ +-------------+------------+-------------------+--------------+
This method is only RECOMMENDED for reducing "Element Data" 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 as a shorter "VINT" then it is RECOMMENDED to rewrite the "Element
Data Size" as one octet shorter, shorten the "Element Data" by one Data Size" as one octet shorter, shorten the "Element Data" by one
octet, and follow that "Element" with a "Void Element". For example, octet, and follow that "Element" with a "Void Element". For example,
the following table depicts a "String Element" that stores an the following table depicts a "String Element" that stores an
"Element ID" (3 octets), "Element Data Size" (2 octets, but could be "Element ID" (3 octets), "Element Data Size" (2 octets, but could be
skipping to change at page 18, line 34 skipping to change at page 19, line 16
used to write the "EBML Document" and the versions required to read used to write the "EBML Document" and the versions required to read
the "EBML Document". the "EBML Document".
The "EBML Header" MUST contain a single "Master Element" with an The "EBML Header" MUST contain a single "Master Element" with an
"Element Name" of "EBML" and "Element ID" of "0x1A45DFA3" (see "Element Name" of "EBML" and "Element ID" of "0x1A45DFA3" (see
Section 13.2.1) and any number of additional "EBML Elements" within Section 13.2.1) and any number of additional "EBML Elements" within
it. The "EBML Header" of an "EBML Document" that uses an it. The "EBML Header" of an "EBML Document" that uses an
"EBMLVersion" of "1" MUST only contain "EBML Elements" that are "EBMLVersion" of "1" MUST only contain "EBML Elements" that are
defined as part of this document. defined as part of this document.
All "EBML Elements" within the "EBML Header" MUST NOT use any "EBML Elements" within the "EBML Header" MUST NOT use any "Element
"Element ID" with a length greater than 4 octets. All "EBML ID" with a length greater than 4 octets. All "EBML Elements" within
Elements" within the "EBML Header" MUST NOT use any "Element Data the "EBML Header" MUST NOT use any "Element Data Size" with a length
Size" with a length greater than 4 octets. greater than 4 octets.
11.2. EBML Body 11.2. EBML Body
All data of an "EBML Document" following the "EBML Header" is the All data of an "EBML Document" following the "EBML Header" is the
"EBML Body". The end of the "EBML Body", as well as the end of the "EBML Body". The end of the "EBML Body", as well as the end of the
"EBML Document" that contains the "EBML Body", is considered as "EBML Document" that contains the "EBML Body", is reached at
whichever comes first: the beginning of a new "EBML Header" at the whichever comes first: the beginning of a new "EBML Header" at the
"Root Level" or the end of the file. The "EBML Body" MUST consist "Root Level" or the end of the file. The "EBML Body" MUST consist
only of "EBML Elements" and MUST NOT contain any data that is not only of "EBML Elements" and MUST NOT contain any data that is not
part of an "EBML Element". This document defines precisely what part of an "EBML Element". This document defines precisely what
"EBML Elements" are to be used within the "EBML Header", but does not "EBML Elements" are to be used within the "EBML Header", but does not
name or define what "EBML Elements" are to be used within the "EBML name or define what "EBML Elements" are to be used within the "EBML
Body". The definition of what "EBML Elements" are to be used within Body". The definition of what "EBML Elements" are to be used within
the "EBML Body" is defined by an "EBML Schema". the "EBML Body" is defined by an "EBML Schema".
12. EBML Stream 12. EBML Stream
An "EBML Stream" is a file that consists of one or many "EBML An "EBML Stream" is a file that consists of one or more "EBML
Documents" that are concatenated together. An occurrence of a "EBML Documents" that are concatenated together. An occurrence of a "EBML
Header" at the "Root Level" marks the beginning of an "EBML Header" at the "Root Level" marks the beginning of an "EBML
Document". Document".
13. Elements semantic 13. Elements semantic
13.1. EBML Schema 13.1. EBML Schema
An "EBML Schema" is an XML Document that defines the properties, An "EBML Schema" is a well-formed XML Document that defines the
arrangement, and usage of "EBML Elements" that compose a specific properties, arrangement, and usage of "EBML Elements" that compose a
"EBML Document Type". The relationship of an "EBML Schema" to an specific "EBML Document Type". The relationship of an "EBML Schema"
"EBML Document" may be considered analogous to the relationship of an to an "EBML Document" is analogous to the relationship of an XML
XML Schema [W3C.REC-xmlschema-0-20010502] to an XML Document Schema [W3C.REC-xmlschema-0-20010502] to an XML Document
[W3C.REC-xml-20081126]. An "EBML Schema" MUST be clearly associated [W3C.REC-xml-20081126]. An "EBML Schema" MUST be clearly associated
with one or many "EBML Document Types". An "EBML Schema" must be with one or more "EBML Document Types". An "EBML Document Type" is
expressed as well-formed XML. An "EBML Document Type" is identified identified by a string stored within the "EBML Header" in the
by a string stored within the "EBML Header" in the "DocType Element"; "DocType Element"; for example "matroska" or "webm" (see
for example "matroska" or "webm" (see Section 13.2.6). The "DocType" Section 13.2.6). The "DocType" value for an "EBML Document Type"
value for an "EBML Document Type" SHOULD be unique and persistent. SHOULD be unique and persistent.
An "EBML Schema" MUST declare exactly one "EBML Element" at "Root An "EBML Schema" MUST declare exactly one "EBML Element" at "Root
Level" (referred to as the "Root Element") that MUST occur exactly Level" (referred to as the "Root Element") that occurs exactly once
once within an "EBML Document". The "Void Element" MAY also occur at within an "EBML Document". The "Void Element" MAY also occur at
"Root Level" but is not considered to be "Root Elements" (see "Root Level" but is not a "Root Element" (see Section 13.3.2).
Section 13.3.2).
The "EBML Schema" MUST document all Elements of the "EBML Body". The The "EBML Schema" MUST document all Elements of the "EBML Body". The
"EBML Schema" does not document "Global Elements" that are defined by "EBML Schema" does not document "Global Elements" that are defined by
this document (namely the "Void Element" and the "CRC-32 Element"). this document (namely the "Void Element" and the "CRC-32 Element").
An "EBML Schema" MAY constrain the use of "EBML Header Elements" (see An "EBML Schema" MAY constrain the use of "EBML Header Elements" (see
Section 13.2) by adding or constraining that Element's "range" Section 13.2) by adding or constraining that Element's "range"
attribute. For example, an "EBML Schema" MAY constrain the attribute. For example, an "EBML Schema" MAY constrain the
"EBMLMaxSizeLength" to a maximum value of "8" or MAY constrain the "EBMLMaxSizeLength" to a maximum value of "8" or MAY constrain the
"EBMLVersion" to only support a value of "1". If an "EBML Schema" "EBMLVersion" to only support a value of "1". If an "EBML Schema"
adopts the "EBML Header Element" as-is, then it is not REQUIRED to adopts the "EBML Header Element" as-is, then it is not required to
document that Element within the "EBML Schema". If an "EBML Schema" document that Element within the "EBML Schema". If an "EBML Schema"
constrains the range of an "EBML Header Element", then that "Element" constrains the range of an "EBML Header Element", then that "Element"
MUST be documented within an "<element>" node of the "EBML Schema". MUST be documented within an "<element>" node of the "EBML Schema".
This document provides an example of an "EBML Schema", see This document provides an example of an "EBML Schema", see
Section 13.1.11. Section 13.1.1.
13.1.1. <EBMLSchema> Element 13.1.1. EBML Schema Example
<?xml version="1.0" encoding="utf-8"?>
<EBMLSchema xmlns="https://ietf.org/cellar/ebml"
docType="files-in-ebml-demo" version="1">
<!-- constraints to the range of two EBML Header Elements -->
<element name="EBMLReadVersion" path="1*1(\EBML\EBMLReadVersion)"
id="0x42F7" minOccurs="1" maxOccurs="1" range="1" default="1"
type="uinteger"/>
<element name="EBMLMaxSizeLength" path="1*1(\EBML\EBMLMaxSizeLength)"
id="0x42F3" minOccurs="1" maxOccurs="1" range="8" default="8"
type="uinteger"/>
<!-- Root Element-->
<element name="Files" path="*1(\Files)" id="0x1946696C" type="master">
<documentation lang="en" type="definition">Container of data and
attributes representing one or many files.</documentation>
</element>
<element name="File" path="1*(\Files\File)" id="0x6146" type="master"
minOccurs="1">
<documentation lang="en" type="definition">
An attached file.
</documentation>
</element>
<element name="FileName" path="1*1(\Files\File\FileName)"
id="0x614E" type="utf-8"
minOccurs="1">
<documentation lang="en" type="definition">
Filename of the attached file.
</documentation>
</element>
<element name="MimeType" path="1*1(\Files\File\MimeType)"
id="0x464D" type="string"
minOccurs="1">
<documentation lang="en" type="definition">
MIME type of the file.
</documentation>
</element>
<element name="ModificationTimestamp"
path="1*1(\Files\File\ModificationTimestamp)" id="0x4654"
type="date" minOccurs="1">
<documentation lang="en" type="definition">
Modification timestamp of the file.
</documentation>
</element>
<element name="Data" path="1*1(\Files\File\Data)" id="0x4664"
type="binary" minOccurs="1">
<documentation lang="en" type="definition">
The data of the file.
</documentation>
</element>
</EBMLSchema>
13.1.2. <EBMLSchema> Element
As an XML Document, the "EBML Schema" MUST use "<EBMLSchema>" as the As an XML Document, the "EBML Schema" MUST use "<EBMLSchema>" as the
top level element. The "<EBMLSchema>" element MAY contain top level element. The "<EBMLSchema>" element MAY contain
"<element>" sub-elements. "<element>" sub-elements.
13.1.2. <EBMLSchema> Attributes 13.1.3. <EBMLSchema> Attributes
Within an "EBML Schema" the "<EBMLSchema>" element uses the following Within an "EBML Schema" the "<EBMLSchema>" element uses the following
attributes: attributes:
13.1.2.1. docType 13.1.3.1. docType
The "docType" lists the official name of the "EBML Document Type" The "docType" lists the official name of the "EBML Document Type"
that is defined by the "EBML Schema"; for example, "<EBMLSchema that is defined by the "EBML Schema"; for example, "<EBMLSchema
docType="matroska">". docType="matroska">".
The "docType" attribute is REQUIRED within the "<EBMLSchema>" The "docType" attribute is REQUIRED within the "<EBMLSchema>"
Element. Element.
13.1.2.2. version 13.1.3.2. version
The "version" lists an incremental non-negative integer that The "version" lists an non-negative integer that specifies the
specifies the version of the docType documented by the "EBML Schema". version of the docType documented by the "EBML Schema". Unlike XML
Unlike XML Schemas, an "EBML Schema" documents all versions of a Schemas, an "EBML Schema" documents all versions of a docType's
docType's definition rather than using separate "EBML Schemas" for definition rather than using separate "EBML Schemas" for each version
each version of a "docType". "EBML Elements" may be introduced and of a "docType". "EBML Elements" may be introduced and deprecated by
deprecated by using the "minver" and "maxver" attributes of using the "minver" and "maxver" attributes of "<element>".
"<element>".
The "version" attribute is REQUIRED within the "<EBMLSchema>" The "version" attribute is REQUIRED within the "<EBMLSchema>"
Element. Element.
13.1.3. <element> Element 13.1.4. <element> Element
Each "<element>" defines one "EBML Element" through the use of Each "<element>" defines one "EBML Element" through the use of
several attributes that are defined in Section 13.1.2. "EBML several attributes that are defined in Section 13.1.3. "EBML
Schemas" MAY contain additional attributes to extend the semantics Schemas" MAY contain additional attributes to extend the semantics
but MUST NOT conflict with the definitions of the "<element>" but MUST NOT conflict with the definitions of the "<element>"
attributes defined within this document. attributes defined within this document.
The "<element>" nodes contain a description of the meaning and use of The "<element>" nodes contain a description of the meaning and use of
the "EBML Element" stored within one or many "<documentation>" sub- the "EBML Element" stored within one or more "<documentation>" sub-
elements and zero or one "<restriction>" sub-element. All elements and zero or one "<restriction>" sub-element. All
"<element>" nodes MUST be sub-elements of the "<EBMLSchema>". "<element>" nodes MUST be sub-elements of the "<EBMLSchema>".
13.1.4. <element> Attributes 13.1.5. <element> Attributes
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":
13.1.4.1. name 13.1.5.1. name
The "name" provides the official human-readable name of the "EBML The "name" provides the official human-readable name of the "EBML
Element". The value of the name MUST be in the form of characters Element". The value of the name MUST be in the form of characters
"A" to "Z", "a" to "z", "0" to "9", "-" and ".". "A" to "Z", "a" to "z", "0" to "9", "-" and ".".
The "name" attribute is REQUIRED. The "name" attribute is REQUIRED.
13.1.4.2. path 13.1.5.2. 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
hierarchy of "EBML Elements" separated with a "/". The top "EBML hierarchy of "EBML Elements" separated with a "/". The top "EBML
Element" in the path hierarchy being the first in the value. The Element" in the path hierarchy being the first in the value. The
syntax of the "path" attribute is defined using this Augmented syntax of the "path" attribute is defined using this Augmented
Backus-Naur Form (ABNF) [RFC5234] with the case sensitive update Backus-Naur Form (ABNF) [RFC5234] with the case sensitive update
[RFC7405] notation: [RFC7405] notation:
The "path" attribute is REQUIRED. The "path" attribute is REQUIRED.
skipping to change at page 21, line 49 skipping to change at page 23, line 28
EBMLAtomName = 1*(EBMLNameChar) EBMLAtomName = 1*(EBMLNameChar)
EBMLNameChar = ALPHA / DIGIT / "-" / "." EBMLNameChar = ALPHA / DIGIT / "-" / "."
PathDelimiter = "\" PathDelimiter = "\"
EBMLElementOccurrence = [EBMLMinOccurrence] "*" [EBMLMaxOccurrence] EBMLElementOccurrence = [EBMLMinOccurrence] "*" [EBMLMaxOccurrence]
EBMLMinOccurrence = 1*DIGIT EBMLMinOccurrence = 1*DIGIT
EBMLMaxOccurrence = 1*DIGIT EBMLMaxOccurrence = 1*DIGIT
VariableParentOccurrence = [PathMinOccurrence] "*" [PathMaxOccurrence] VariableParentOccurrence = [PathMinOccurrence] "*" [PathMaxOccurrence]
PathMinOccurrence = 1*DIGIT PathMinOccurrence = 1*DIGIT
PathMaxOccurrence = 1*DIGIT PathMaxOccurrence = 1*DIGIT
The ""*"", ""("" and "")"" symbols MUST be interpreted as they are The ""*"", ""("" and "")"" symbols are interpreted as defined in
defined in the ABNF. [RFC5234].
The "EBMLPathAtom" part of the "EBMLElementPath" MUST be equal to the The "EBMLPathAtom" part of the "EBMLElementPath" MUST be equal to the
"name" attribute of the "EBML Schema". "name" attribute of the "EBML Schema".
The starting "PathDelimiter" of the path corresponds to the root of The starting "PathDelimiter" of the path corresponds to the root of
the "EBML Document". the "EBML Document".
The "EBMLElementOccurrence" part is interpreted as an ABNF Variable The "EBMLElementOccurrence" part is interpreted as an ABNF Variable
Repetition. The repetition amounts correspond to how many times the Repetition. The repetition amounts correspond to how many times the
"EBML Element" can be found in its "Parent Element". "EBML Element" can be found in its "Parent Element".
The "EBMLMinOccurrence" represents the minimum number of occurrences The "EBMLMinOccurrence" represents the minimum number of occurrences
of this "EBML Element" within its "Parent Element". Each instance of of this "EBML Element" within its "Parent Element". Each instance of
the "Parent Element" MUST contain at least this many instances of the "Parent Element" MUST contain at least this many instances of
this "EBML Element". If the "EBML Element" has an empty this "EBML Element". If the "EBML Element" has an empty
"EBMLParentPath" then "EBMLMinOccurrence" refers to constraints on "EBMLParentPath" then "EBMLMinOccurrence" refers to constraints on
the occurrence of the "EBML Element" within the "EBML Document". If the occurrence of the "EBML Element" within the "EBML Document". If
"EBMLMinOccurrence" is not present then that "EBML Element" is "EBMLMinOccurrence" is not present then that "EBML Element" has an
considered to have a "EBMLMinOccurrence" value of 0. The semantic "EBMLMinOccurrence" value of 0. The semantic meaning of
meaning of "EBMLMinOccurrence" within an "EBML Schema" is considered "EBMLMinOccurrence" within an "EBML Schema" is analogous to the
analogous to the meaning of "minOccurs" within an "XML Schema". meaning of "minOccurs" within an "XML Schema". "EBML Elements" with
"EBML Elements" with "EBMLMinOccurrence" set to "1" that also have a "EBMLMinOccurrence" set to "1" that also have a "default" value (see
"default" value (see Section 13.1.4.8) declared are not REQUIRED to Section 13.1.5.8) declared are not REQUIRED to be stored but are
be stored but are REQUIRED to be interpreted, see Section 13.1.15. REQUIRED to be interpreted, see Section 13.1.14. An "EBML Element"
An "EBML Element" defined with a "EBMLMinOccurrence" value greater defined with a "EBMLMinOccurrence" value greater than zero is called
than zero is called a "Mandatory EBML Element". a "Mandatory EBML Element".
The "EBMLMaxOccurrence" represents the maximum number of occurrences The "EBMLMaxOccurrence" represents the maximum number of occurrences
of this "EBML Element" within its "Parent Element". Each instance of of this "EBML Element" within its "Parent Element". Each instance of
the "Parent Element" MUST contain at most this many instances of this the "Parent Element" MUST contain at most this many instances of this
"EBML Element". If the "EBML Element" has an empty "EBMLParentPath" "EBML Element". If the "EBML Element" has an empty "EBMLParentPath"
then "EBMLMaxOccurrence" refers to constraints on the occurrence of then "EBMLMaxOccurrence" refers to constraints on the occurrence of
the "EBML Element" within the "EBML Document". If the "EBML Element" within the "EBML Document". If
"EBMLMaxOccurrence" is not present then that "EBML Element" is "EBMLMaxOccurrence" is not present then that "EBML Element" has no
considered to have no maximum occurrence. The semantic meaning of maximum occurrence. The semantic meaning of "EBMLMaxOccurrence"
"EBMLMaxOccurrence" within an "EBML Schema path" is considered within an "EBML Schema path" is analogous to the meaning of
analogous to the meaning of "maxOccurs" within an "XML Schema". "maxOccurs" within an "XML Schema".
The "VariableParentOccurrence" part is interpreted as an ABNF The "VariableParentOccurrence" part is interpreted as an ABNF
Variable Repetition. The repetition amounts correspond to the amount Variable Repetition. The repetition amounts correspond to the amount
of unspecified "Parent Element" levels there can be between the of unspecified "Parent Element" levels there can be between the
"EBMLFixedParent" and the actual "EBMLElementPath". "EBMLFixedParent" and the actual "EBMLElementPath".
If the path contains an "EBMLPathAtomRecursive" part, the "EBML If the path contains an "EBMLPathAtomRecursive" part, the "EBML
Element" can occur within itself recursively (see the Element" can occur within itself recursively (see the
Section 13.1.4.11). Section 13.1.5.11).
13.1.4.3. id 13.1.5.3. id
The "Element ID" encoded as a "Variable Size Integer" expressed in The "Element ID" encoded as a "Variable Size Integer" expressed in
hexadecimal notation prefixed by a "0x" that is read and stored in hexadecimal notation prefixed by a "0x" that is read and stored in
big-endian order. To reduce the risk of false positives while big-endian order. To reduce the risk of false positives while
parsing "EBML Streams", the "Element IDs" of the "Root Element" and parsing "EBML Streams", the "Element IDs" of the "Root Element" and
"Top-Level Elements" SHOULD be at least 4 octets in length. "Element "Top-Level Elements" SHOULD be at least 4 octets in length. "Element
IDs" defined for use at "Root Level" or directly under the "Root IDs" defined for use at "Root Level" or directly under the "Root
Level" MAY use shorter octet lengths to facilitate padding and Level" MAY use shorter octet lengths to facilitate padding and
optimize edits to "EBML Documents"; for instance, the "Void Element" optimize edits to "EBML Documents"; for instance, the "Void Element"
uses an "Element ID" with a one octet length to allow its usage in uses an "Element ID" with a one octet length to allow its usage in
more writing and editing scenarios. more writing and editing scenarios.
The "id" attribute is REQUIRED. The "id" attribute is REQUIRED.
13.1.4.4. minOccurs 13.1.5.4. minOccurs
An integer expressing the minimum number of occurrences of this "EBML An integer expressing the minimum number of occurrences of this "EBML
Element" within its "Parent Element". The "minOccurs" value MUST be Element" within its "Parent Element". The "minOccurs" value MUST be
equal to the "EBMLMinOccurrence" value of the "path". equal to the "EBMLMinOccurrence" value of the "path".
The "minOccurs" attribute is OPTIONAL. If the "minOccurs" attribute The "minOccurs" attribute is OPTIONAL. If the "minOccurs" attribute
is not present then that "EBML Element" is considered to have a is not present then that "EBML Element" has a "minOccurs" value of 0.
"minOccurs" value of 0.
13.1.4.5. maxOccurs 13.1.5.5. maxOccurs
An integer expressing the maximum number of occurrences of this "EBML An integer expressing the maximum number of occurrences of this "EBML
Element" within its "Parent Element". The "maxOccurs" value MUST be Element" within its "Parent Element". The "maxOccurs" value MUST be
equal to the "EBMLMaxOccurrence" value of the "path". equal to the "EBMLMaxOccurrence" value of the "path".
The "maxOccurs" attribute is OPTIONAL. If the "maxOccurs" attribute The "maxOccurs" attribute is OPTIONAL. If the "maxOccurs" attribute
is not present then that "EBML Element" is considered to have no is not present then that "EBML Element" has no maximum occurrence,
maximum occurrence, similar to "unbounded" in the XML world. similar to "unbounded" in the XML world.
13.1.4.6. range 13.1.5.6. range
A numerical range for "EBML Elements" which are of numerical types A numerical range for "EBML Elements" which are of numerical types
(Unsigned Integer, Signed Integer, Float, and Date). If specified (Unsigned Integer, Signed Integer, Float, and Date). If specified
the value of the "EBML Element" MUST be within the defined range. the value of the "EBML Element" MUST be within the defined range.
See Section 13.1.13 for rules applied to expression of range values. See Section 13.1.5.6.1 for rules applied to expression of range
values.
The "range" attribute is OPTIONAL. If the "range" attribute is not The "range" attribute is OPTIONAL. If the "range" attribute is not
present then any value legal for the "type" attribute is valid. present then any value legal for the "type" attribute is valid.
13.1.4.7. size 13.1.5.6.1. Expression of range
The "range" attribute MUST only be used with "EBML Elements" that are
either "signed integer", "unsigned integer", "float", or "date". The
"range" expression may contain whitespace for readability but
whitespace within a "range" expression MUST NOT convey meaning. The
expression of the "range" MUST adhere to one of the following forms:
o "x-y" where x and y are integers or floats and "y" MUST be greater
than "x", meaning that the value MUST be greater than or equal to
"x" and less than or equal to "y". "x" MUST be less than "y".
o ">x" where "x" is an integer or float, meaning that the value MUST
be greater than "x".
o ">=x" where "x" is an integer or float, meaning that the value
MUST be greater than or equal to "x".
o "<x" where "x" is an integer or float, meaning that the value MUST
be less than "x".
o "<=x" where "x" is an integer or float, meaning that the value
MUST be less than or equal to "x".
o "x" where "x" is an integer or float, meaning that the value MUST
be equal "x".
The "range" may use the prefix "not" to indicate that the expressed
range is negated. Please also see Section 13.1.13.
13.1.5.7. size
A value to express the valid length of the "Element Data" as written A value to express the valid length of the "Element Data" as written
measured in octets. The "size" provides a constraint in addition to measured in octets. The "size" provides a constraint in addition to
the Length value of the definition of the corresponding "EBML Element the Length value of the definition of the corresponding "EBML Element
Type". This "size" MUST be expressed as either a non-negative Type". This "size" MUST be expressed as either a non-negative
integer or a range (see Section 13.1.13) that consists of only non- integer or a range (see Section 13.1.5.6.1) that consists of only
negative integers and valid operators. non-negative integers and valid operators.
The "size" attribute is OPTIONAL. If the "size" attribute is not The "size" attribute is OPTIONAL. If the "size" attribute is not
present for that "EBML Element" then that "EBML Element" is only present for that "EBML Element" then that "EBML Element" is only
limited in size by the definition of the associated "EBML Element limited in size by the definition of the associated "EBML Element
Type". Type".
13.1.4.8. default 13.1.5.8. default
If an "Element" is mandatory (has a "EBMLMinOccurrence" value greater If an "Element" is mandatory (has a "EBMLMinOccurrence" value greater
than zero) but not written within its "Parent Element" or stored as than zero) but not written within its "Parent Element" or stored as
an "Empty Element", then the "EBML Reader" of the "EBML Document" an "Empty Element", then the "EBML Reader" of the "EBML Document"
MUST semantically interpret the "EBML Element" as present with this MUST semantically interpret the "EBML Element" as present with this
specified default value for the "EBML Element". "EBML Elements" that specified default value for the "EBML Element". "EBML Elements" that
are "Master Elements" MUST NOT declare a "default" value. "EBML are "Master Elements" MUST NOT declare a "default" value. "EBML
Elements" with a "minOccurs" value greater than 1 MUST NOT declare a Elements" with a "minOccurs" value greater than 1 MUST NOT declare a
"default" value. "default" value.
The "default" attribute is OPTIONAL. The "default" attribute is OPTIONAL.
13.1.4.9. type 13.1.5.9. type
The "type" MUST be set to one of the following values: 'integer' The "type" MUST be set to one of the following values: 'integer'
(signed integer), 'uinteger' (unsigned integer), 'float', 'string', (signed integer), 'uinteger' (unsigned integer), 'float', 'string',
'date', 'utf-8', 'master', or 'binary'. The content of each "type" 'date', 'utf-8', 'master', or 'binary'. The content of each "type"
is defined within Section 8. is defined within Section 8.
The "type" attribute is REQUIRED. The "type" attribute is REQUIRED.
13.1.4.10. unknownsizeallowed 13.1.5.10. unknownsizeallowed
A boolean to express if an "EBML Element" MAY be used as an "Unknown- A boolean to express if an "EBML Element" MAY be used as an "Unknown-
Sized Element" (having all "VINT_DATA" bits of "Element Data Size" Sized Element" (having all "VINT_DATA" bits of "Element Data Size"
set to 1). "EBML Elements" that are not "Master Elements" MUST NOT set to 1). "EBML Elements" that are not "Master Elements" MUST NOT
set "unknownsizeallowed" to true. An "EBML Element" that is defined set "unknownsizeallowed" to true. An "EBML Element" that is defined
with an "unknownsizeallowed" attribute set to 1 MUST also have the with an "unknownsizeallowed" attribute set to 1 MUST also have the
"unknownsizeallowed" attribute of its "Parent Element" set to 1. "unknownsizeallowed" attribute of its "Parent Element" set to 1.
The "unknownsizeallowed" attribute is OPTIONAL. If the The "unknownsizeallowed" attribute is OPTIONAL. If the
"unknownsizeallowed" attribute is not used then that "EBML Element" "unknownsizeallowed" attribute is not used then that "EBML Element"
is not allowed to use an unknown "Element Data Size". is not allowed to use an unknown "Element Data Size".
13.1.4.11. recursive 13.1.5.11. recursive
A boolean to express if an "EBML Element" MAY be stored recursively. A boolean to express if an "EBML Element" MAY be stored recursively.
In this case the "EBML Element" MAY be stored within another "EBML In this case the "EBML Element" MAY be stored within another "EBML
Element" that has the same "Element ID". Which itself can be stored Element" that has the same "Element ID". Which itself can be stored
in an "EBML Element" that has the same "Element ID", and so on. in an "EBML Element" that has the same "Element ID", and so on.
"EBML Elements" that are not "Master Elements" MUST NOT set "EBML Elements" that are not "Master Elements" MUST NOT set
"recursive" to true. "recursive" to true.
If the "path" contains an "EBMLPathAtomRecursive" part then the If the "path" contains an "EBMLPathAtomRecursive" part then the
"recursive" value MUST be true and false otherwise. "recursive" value MUST be true and false otherwise.
The "recursive" attribute is OPTIONAL. If the "recursive" attribute The "recursive" attribute is OPTIONAL. If the "recursive" attribute
is not present then the "EBML Element" MUST NOT be used recursively. is not present then the "EBML Element" MUST NOT be used recursively.
13.1.4.12. recurring 13.1.5.12. recurring
A boolean to express if an "EBML Element" is defined as an A boolean to express if an "EBML Element" is defined as an
"Identically Recurring Element" or not. "Identically Recurring Element" or not.
The "recurring" attribute is OPTIONAL. If the "recurring" attribute The "recurring" attribute is OPTIONAL. If the "recurring" attribute
is not present then the "EBML Element" MUST be considered to NOT be is not present then the "EBML Element" is not a "Identically
an "Identically Recurring Element". Recurring Element".
13.1.4.13. minver 13.1.5.13. minver
The "minver" (minimum version) attribute stores a non-negative The "minver" (minimum version) attribute stores a non-negative
integer that represents the first version of the "docType" to support integer that represents the first version of the "docType" to support
the "EBML Element". the "EBML Element".
The "minver" attribute is OPTIONAL. If the "minver" attribute is not The "minver" attribute is OPTIONAL. If the "minver" attribute is not
present, then the "EBML Element" has a minimum version of "1". present, then the "EBML Element" has a minimum version of "1".
13.1.4.14. maxver 13.1.5.14. maxver
The "maxver" (maximum version) attribute stores a non-negative The "maxver" (maximum version) attribute stores a non-negative
integer that represents the last or most recent version of the integer that represents the last or most recent version of the
"docType" to support the element. "maxver" MUST be greater than or "docType" to support the element. "maxver" MUST be greater than or
equal to "minver". equal to "minver".
The "maxver" attribute is OPTIONAL. If the "maxver" attribute is not The "maxver" attribute is OPTIONAL. If the "maxver" attribute is not
present then the "EBML Element" has a maximum version equal to the present then the "EBML Element" has a maximum version equal to the
value stored in the "version" attribute of "<EBMLSchema>". value stored in the "version" attribute of "<EBMLSchema>".
13.1.5. <documentation> Element 13.1.6. <documentation> Element
The "<documentation>" element provides additional information about The "<documentation>" element provides additional information about
the "EBML Element". the "EBML Element".
13.1.6. <documentation> Attributes 13.1.7. <documentation> Attributes
13.1.6.1. lang 13.1.7.1. lang
A "lang" attribute which is set to the [RFC5646] value of the A "lang" attribute which is set to the [RFC5646] value of the
language of the element's documentation. language of the element's documentation.
The "lang" attribute is OPTIONAL. The "lang" attribute is OPTIONAL.
13.1.6.2. type 13.1.7.2. type
A "type" attribute distinguishes the meaning of the documentation. A "type" attribute distinguishes the meaning of the documentation.
Values for the "<documentation>" sub-element's "type" attribute MUST Values for the "<documentation>" sub-element's "type" attribute MUST
include one of the following: "definition", "rationale", "usage include one of the following: "definition", "rationale", "usage
notes", and "references". notes", and "references".
The "type" attribute is OPTIONAL. The "type" attribute is OPTIONAL.
13.1.7. <restriction> Element 13.1.8. <restriction> Element
The "<restriction>" element provides information about restrictions The "<restriction>" element provides information about restrictions
to the allowable values for the "EBML Element" which are listed in to the allowable values for the "EBML Element" which are listed in
"<enum>" elements. "<enum>" elements.
13.1.8. <enum> Element 13.1.9. <enum> Element
The "<enum>" element stores a list of values allowed for storage in The "<enum>" element stores a list of values allowed for storage in
the "EBML Element". The values MUST match the "type" of the "EBML the "EBML Element". The values MUST match the "type" of the "EBML
Element" (for example "<enum value="Yes">" cannot be a valid value Element" (for example "<enum value="Yes">" cannot be a valid value
for a "EBML Element" that is defined as an unsigned integer). An for a "EBML Element" that is defined as an unsigned integer). An
"<enum>" element MAY also store "<documentation>" elements to further "<enum>" element MAY also store "<documentation>" elements to further
describe the "<enum>". describe the "<enum>".
13.1.9. <enum> Attributes 13.1.10. <enum> Attributes
13.1.9.1. label 13.1.10.1. label
The "label" provides a concise expression for human consumption that The "label" provides a concise expression for human consumption that
describes what the "value" of the "<enum>" represents. describes what the "value" of the "<enum>" represents.
The "label" attribute is OPTIONAL. The "label" attribute is OPTIONAL.
13.1.9.2. value 13.1.10.2. value
The "value" represents data that MAY be stored within the "EBML The "value" represents data that MAY be stored within the "EBML
Element". Element".
The "value" attribute is REQUIRED. The "value" attribute is REQUIRED.
13.1.10. XML Schema for EBML Schema 13.1.11. XML Schema for EBML Schema
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="https://ietf.org/cellar/ebml" <xsd:schema xmlns="https://ietf.org/cellar/ebml"
targetNamespace="https://ietf.org/cellar/ebml" targetNamespace="https://ietf.org/cellar/ebml"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" version="01"> elementFormDefault="qualified" version="01">
<xsd:element name="EBMLSchema" type="EBMLSchemaType"/> <xsd:element name="EBMLSchema" type="EBMLSchemaType"/>
<xsd:complexType name="EBMLSchemaType"> <xsd:complexType name="EBMLSchemaType">
<xsd:sequence> <xsd:sequence>
<xsd:element name="element" type="elementType" minOccurs="0" <xsd:element name="element" type="elementType" minOccurs="0"
skipping to change at page 28, line 24 skipping to change at page 30, line 24
</xsd:complexType> </xsd:complexType>
<xsd:complexType name="documentationType" mixed="true"> <xsd:complexType name="documentationType" mixed="true">
<xsd:sequence> <xsd:sequence>
<xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/> <xsd:any namespace="##any" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="lang"/> <xsd:attribute name="lang"/>
<xsd:attribute name="type"/> <xsd:attribute name="type"/>
</xsd:complexType> </xsd:complexType>
</xsd:schema> </xsd:schema>
13.1.11. EBML Schema Example
<?xml version="1.0" encoding="utf-8"?>
<EBMLSchema xmlns="https://ietf.org/cellar/ebml"
docType="files-in-ebml-demo" version="1">
<!-- constraints to the range of two EBML Header Elements -->
<element name="EBMLReadVersion" path="1*1(\EBML\EBMLReadVersion)"
id="0x42F7" minOccurs="1" maxOccurs="1" range="1" default="1"
type="uinteger"/>
<element name="EBMLMaxSizeLength" path="1*1(\EBML\EBMLMaxSizeLength)"
id="0x42F3" minOccurs="1" maxOccurs="1" range="8" default="8"
type="uinteger"/>
<!-- Root Element-->
<element name="Files" path="*1(\Files)" id="0x1946696C" type="master">
<documentation lang="en" type="definition">Container of data and
attributes representing one or many files.</documentation>
</element>
<element name="File" path="1*(\Files\File)" id="0x6146" type="master"
minOccurs="1">
<documentation lang="en" type="definition">
An attached file.
</documentation>
</element>
<element name="FileName" path="1*1(\Files\File\FileName)"
id="0x614E" type="utf-8"
minOccurs="1">
<documentation lang="en" type="definition">
Filename of the attached file.
</documentation>
</element>
<element name="MimeType" path="1*1(\Files\File\MimeType)"
id="0x464D" type="string"
minOccurs="1">
<documentation lang="en" type="definition">
MIME type of the file.
</documentation>
</element>
<element name="ModificationTimestamp"
path="1*1(\Files\File\ModificationTimestamp)" id="0x4654"
type="date" minOccurs="1">
<documentation lang="en" type="definition">
Modification timestamp of the file.
</documentation>
</element>
<element name="Data" path="1*1(\Files\File\Data)" id="0x4664"
type="binary" minOccurs="1">
<documentation lang="en" type="definition">
The data of the file.
</documentation>
</element>
</EBMLSchema>
13.1.12. Identically Recurring Elements 13.1.12. Identically Recurring Elements
An "Identically Recurring Element" is an "EBML Element" that MAY An "Identically Recurring Element" is an "EBML Element" that MAY
occur within its "Parent Element" more than once but that each occur within its "Parent Element" more than once but that each
recurrence within that "Parent Element" MUST be identical both in recurrence within that "Parent Element" MUST be identical both in
storage and semantics. "Identically Recurring Elements" are storage and semantics. "Identically Recurring Elements" are
permitted to be stored multiple times within the same "Parent permitted to be stored multiple times within the same "Parent
Element" in order to increase data resilience and optimize the use of Element" in order to increase data resilience and optimize the use of
"EBML" in transmission. For instance a pertinent "Top-Level Element" "EBML" in transmission. For instance a pertinent "Top-Level Element"
could be periodically resent within a data stream so that an "EBML could be periodically resent within a data stream so that an "EBML
skipping to change at page 30, line 5 skipping to change at page 30, line 48
transmission. If a "Parent Element" contains more than one copy of transmission. If a "Parent Element" contains more than one copy of
an "Identically Recurring Element" which includes a "CRC-32 Element" an "Identically Recurring Element" which includes a "CRC-32 Element"
as a "Child Element" then the first instance of the "Identically as a "Child Element" then the first instance of the "Identically
Recurring Element" with a valid CRC-32 value should be used for Recurring Element" with a valid CRC-32 value should be used for
interpretation. If a "Parent Element" contains more than one copy of interpretation. If a "Parent Element" contains more than one copy of
an "Identically Recurring Element" which does not contain a "CRC-32 an "Identically Recurring Element" which does not contain a "CRC-32
Element" or if "CRC-32 Elements" are present but none are valid then Element" or if "CRC-32 Elements" are present but none are valid then
the first instance of the "Identically Recurring Element" should be the first instance of the "Identically Recurring Element" should be
used for interpretation. used for interpretation.
13.1.13. Expression of range 13.1.13. Textual expression of floats
The "range" attribute MUST only be used with "EBML Elements" that are
either "signed integer", "unsigned integer", "float", or "date". The
"range" expression may contain whitespace for readability but
whitespace within a "range" expression MUST NOT convey meaning. The
expression of the "range" MUST adhere to one of the following forms:
o "x-y" where x and y are integers or floats and "y" MUST be greater
than "x", meaning that the value MUST be greater than or equal to
"x" and less than or equal to "y". "x" MUST be less than "y".
o ">x" where "x" is an integer or float, meaning that the value MUST
be greater than "x".
o ">=x" where "x" is an integer or float, meaning that the value
MUST be greater than or equal to "x".
o "<x" where "x" is an integer or float, meaning that the value MUST
be less than "x".
o "<=x" where "x" is an integer or float, meaning that the value
MUST be less than or equal to "x".
o "x" where "x" is an integer or float, meaning that the value MUST
be equal "x".
The "range" may use the prefix "not" to indicate that the expressed
range is negated. Please also see Section 13.1.14.
13.1.14. 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). The following table provides examples of expressions of
float ranges. float ranges.
+-------------------+-----------------------------------------+ +-------------------+-----------------------------------------+
| as decimal | as Hexadecimal Floating-Point Constants | | as decimal | as Hexadecimal Floating-Point Constants |
+-------------------+-----------------------------------------+ +-------------------+-----------------------------------------+
| 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" |
+-------------------+-----------------------------------------+ +-------------------+-----------------------------------------+
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 "-" (hyphen) character is the separator between the minimal and
maximum value permitted by the range. Hexadecimal Floating-Point maximum value permitted by the range. Hexadecimal Floating-Point
Constants also use a "-" (hyphen) when indicating a negative binary Constants also use a "-" (hyphen) when indicating a negative binary
power. Within a float range, when a "-" (hyphen) is immediately power. Within a float range, when a "-" (hyphen) is immediately
preceded by a letter "p", then the "-" (hyphen) is a part of the preceded by a letter "p", then the "-" (hyphen) is a part of the
Hexadecimal Floating-Point Constant which notes negative binary Hexadecimal Floating-Point Constant which notes negative binary
power. Within a float range, when a "-" (hyphen) is not immediately power. Within a float range, when a "-" (hyphen) is not immediately
preceded by a letter "p", then the "-" (hyphen) represents the preceded by a letter "p", then the "-" (hyphen) represents the
separator between the minimal and maximum value permitted by the separator between the minimal and maximum value permitted by the
range. range.
13.1.15. Note on the use of default attributes to define Mandatory EBML 13.1.14. Note on the use of default attributes to define Mandatory EBML
Elements Elements
If a "Mandatory EBML Element" has a default value declared by an If a "Mandatory EBML Element" has a default value declared by an
"EBML Schema" and the value of the "EBML Element" is equal to the "EBML Schema" and the value of the "EBML Element" is equal to the
declared default value then that "EBML Element" is not required to be declared default value then that "EBML Element" is not required to be
present within the "EBML Document" if its "Parent Element" is present within the "EBML Document" if its "Parent Element" is
present. In this case, the default value of the "Mandatory EBML present. In this case, the default value of the "Mandatory EBML
Element" MUST be interpreted by the "EBML Reader" although the "EBML Element" MUST be read by the "EBML Reader" although the "EBML
Element" is not present within its "Parent Element". Element" is not present within its "Parent Element".
If a "Mandatory EBML Element" has no default value declared by an If a "Mandatory EBML Element" has no default value declared by an
"EBML Schema" and its "Parent Element" is present then the "EBML "EBML Schema" and its "Parent Element" is present then the "EBML
Element" MUST be present as well. If a "Mandatory EBML Element" has Element" MUST be present as well. If a "Mandatory EBML Element" has
a default value declared by an "EBML Schema" and its "Parent Element" a default value declared by an "EBML Schema" and its "Parent Element"
is present and the value of the "EBML Element" is NOT equal to the is present and the value of the "EBML Element" is NOT equal to the
declared default value then the "EBML Element" MUST be present. declared default value then the "EBML Element" MUST be present.
This table clarifies if a "Mandatory EBML Element" MUST be written, This table clarifies if a "Mandatory EBML Element" MUST be written,
skipping to change at page 34, line 30 skipping to change at page 34, line 34
type: Unsigned Integer type: Unsigned Integer
description: The "EBMLMaxSizeLength Element" stores the maximum description: The "EBMLMaxSizeLength Element" stores the maximum
length in octets of the expression of all "Element Data Sizes" to be length in octets of the expression of all "Element Data Sizes" to be
found within the "EBML Body". To be clear the "EBMLMaxSizeLength found within the "EBML Body". To be clear the "EBMLMaxSizeLength
Element" documents the maximum 'length' of all "Element Data Size" Element" documents the maximum 'length' of all "Element Data Size"
expressions within the "EBML Body" and not the maximum 'value' of all expressions within the "EBML Body" and not the maximum 'value' of all
"Element Data Size" expressions within the "EBML Body". "EBML "Element Data Size" expressions within the "EBML Body". "EBML
Elements" that have an "Element Data Size" expression which is larger Elements" that have an "Element Data Size" expression which is larger
in octets than what is expressed by "EBMLMaxSizeLength ELEMENT" SHALL in octets than what is expressed by "EBMLMaxSizeLength ELEMENT" are
be considered invalid. invalid.
13.2.6. DocType Element 13.2.6. DocType Element
name: "DocType" name: "DocType"
path: "1*1(\EBML\DocType)" path: "1*1(\EBML\DocType)"
id "0x4282" id "0x4282"
minOccurs: 1 minOccurs: 1
skipping to change at page 38, line 19 skipping to change at page 38, line 19
name: Void name: Void
path: "*((*\)\Void)" path: "*((*\)\Void)"
id: "0xEC" id: "0xEC"
minOccurs: 0 minOccurs: 0
type: Binary type: Binary
description: Used to void damaged data, to avoid unexpected behaviors description: Used to void damaged data or to avoid unexpected
when using damaged data. The content is discarded. Also used to behaviors when using damaged data. The content is discarded. Also
reserve space in a sub-element for later use. used to reserve space in a sub-element for later use.
14. Considerations for Reading EBML Data 14. Considerations for Reading EBML Data
The following scenarios describe events to consider when reading The following scenarios describe events to consider when reading
"EBML Documents" and the recommended design of an "EBML Reader". "EBML Documents" and the recommended design of an "EBML Reader".
If a "Master Element" contains a "CRC-32 Element" that doesn't If a "Master Element" contains a "CRC-32 Element" that doesn't
validate, then the "EBML Reader" MAY ignore all contained data except validate, then the "EBML Reader" MAY ignore all contained data except
for "Descendant Elements" which contain their own valid "CRC-32 for "Descendant Elements" that contain their own valid "CRC-32
Element". Element".
If a "Master Element" contains more occurrences of a "Child Master If a "Master Element" contains more occurrences of a "Child Master
Element" than permitted according to the "maxOccurs" and "recurring" Element" than permitted according to the "maxOccurs" and "recurring"
attributes of the definition of that "Element" then the occurrences attributes of the definition of that "Element" then the occurrences
in addition to "maxOccurs" MAY be ignored. in addition to "maxOccurs" MAY be ignored.
If a "Master Element" contains more occurrences of a "Child Element" If a "Master Element" contains more occurrences of a "Child Element"
that is not a "Master Element" than permitted according to the that is not a "Master Element" than permitted according to the
"maxOccurs" attribute of the definition of that "Element" then all "maxOccurs" attribute of the definition of that "Element" then all
skipping to change at page 39, line 18 skipping to change at page 39, line 18
possible only if declared in the header. possible only if declared in the header.
This IANA Registry only applies to "Elements" contained at least in This IANA Registry only applies to "Elements" contained at least in
the "EBML Header", thus including "Global Elements". "Elements" only the "EBML Header", thus including "Global Elements". "Elements" only
found in the "EBML Body" have their own set of independent "Element found in the "EBML Body" have their own set of independent "Element
IDs" and are not part of this IANA Registry. IDs" and are not part of this IANA Registry.
The VINT Data value of one-octet Element IDs MUST be between 0x01 and The VINT Data value of one-octet Element IDs MUST be between 0x01 and
0x7E. These items are valuable because they are short, and need to 0x7E. These items are valuable because they are short, and need to
be used for commonly repeated elements. Values from 1 to 126 are to be used for commonly repeated elements. Values from 1 to 126 are to
be allocated according to RFC Required. be allocated according to the "RFC Required" policy [RFC8126].
The VINT Data value of two-octet Element IDs MUST be between 0x007F The VINT Data value of two-octet Element IDs MUST be between 0x007F
and 0x3FFE. Numbers MAY be allocated within this range according to and 0x3FFE. Numbers are be allocated within this range according to
Specification Required. the "Specification Required" policy [RFC8126].
The numbers 0x3FFF and 0x4000 are RESERVED. The numbers 0x3FFF and 0x4000 are RESERVED.
The VINT Data value of three-octet Element IDs MUST be between 0x4001 The VINT Data value of three-octet Element IDs MUST be between 0x4001
and 0x1FFFFE. Numbers may be allocated within this range according and 0x1FFFFE. Numbers may be allocated within this range according
to First Come First Served (see [RFC8126]) to the "First Come First Served" policy [RFC8126].
The numbers 0x1FFFFF and 0x200000 are RESERVED. The numbers 0x1FFFFF and 0x200000 are RESERVED.
Four octet Element IDs are numbers between 0x2000001 and 0xFFFFFFE. Four octet Element IDs are numbers between 0x2000001 and 0xFFFFFFE.
Four octet Element IDs are somewhat special in that they are useful Four octet Element IDs are somewhat special in that they are useful
for resynchronizing to major structures in the event of data for resynchronizing to major structures in the event of data
corruption or loss. As such four octet Element IDs are split into corruption or loss. As such four octet Element IDs are split into
two categories. Four octet Element IDs whose lower three octets (as two categories. Four octet Element IDs whose lower three octets (as
encoded) would make printable 7-bit ASCII values may be allocated encoded) would make printable 7-bit ASCII values MUST be allocated by
only Specification Required. Sequential allocation of values is not the "Specification Required" policy. Sequential allocation of values
required: specifications SHOULD include a specific request, and are is not required: specifications SHOULD include a specific request,
encouraged to do early allocations. and are encouraged to do early allocations.
To be clear about the above category: four octet Element IDs always To be clear about the above category: four octet Element IDs always
start with hex 0x10 to 0x1F, and that octet may be chosen so that the start with hex 0x10 to 0x1F, and that octet may be chosen so that the
entire number has some desirable property, such as a specific CRC. entire number has some desirable property, such as a specific CRC.
The other three octets, when ALL having values between 0x21 (33, The other three octets, when ALL having values between 0x21 (33,
ASCII !) and 0x7e (126, ASCII ~), fall into this category. ASCII !) and 0x7e (126, ASCII ~), fall into this category.
Other four octet Element IDs may be allocated by First Come First Other four octet Element IDs may be allocated by the "First Come
Served (see [RFC8126]). First Served" policy.
The numbers 0xFFFFFFF and 0x1000000 are RESERVED. The numbers 0xFFFFFFF and 0x1000000 are RESERVED.
Five octet Element IDs (values from 0x10000001 upwards) are reserved Five octet Element IDs (values from 0x10000001 upwards) are RESERVED
for Experimental use: they may be used by anyone at any time, but according to the "Experimental Use" policy [RFC8126]: they may be
there is no coordination. used by anyone at any time, but there is no coordination.
ID Values found in this document are assigned as initial values as ID Values found in this document are assigned as initial values as
follows: follows:
+------------+-------------------------+----------------------------+ +------------+-------------------------+----------------------------+
| ID | Element Name | Reference | | ID | Element Name | Reference |
+------------+-------------------------+----------------------------+ +------------+-------------------------+----------------------------+
| 0x1A45DFA3 | EBML | Described in Section | | 0x1A45DFA3 | EBML | Described in Section |
| | | 13.2.1 | | | | 13.2.1 |
| 0x4286 | EBMLVersion | Described in Section | | 0x4286 | EBMLVersion | Described in Section |
skipping to change at page 40, line 48 skipping to change at page 40, line 48
| | | 13.3.1 | | | | 13.3.1 |
| 0xEC | Void | Described in Section | | 0xEC | Void | Described in Section |
| | | 13.3.2 | | | | 13.3.2 |
+------------+-------------------------+----------------------------+ +------------+-------------------------+----------------------------+
15.2. CELLAR EBML DocType Registry 15.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".
DocType values are described in Section 13.1.2.1. DocTypes are ASCII DocType values are described in Section 13.1.3.1. DocTypes are ASCII
strings, defined in Section 8.4, which label the official name of the strings, defined in Section 8.4, which label the official name of the
"EBML Document Type". The strings may be allocated according to "EBML Document Type". The strings may be allocated according to the
First Come First Served (see [RFC8126]). "First Come First Served" policy.
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 IESG Approval or RFC IETF for future use. These can be assigned via the "IESG Approval"
Required. or "RFC Required" policies [RFC8126].
16. References 16. References
16.1. Normative References 16.1. Normative References
[IEEE.754.1985] [IEEE.754.1985]
Institute of Electrical and Electronics Engineers, Institute of Electrical and Electronics Engineers,
"Standard for Binary Floating-Point Arithmetic", "Standard for Binary Floating-Point Arithmetic",
IEEE Standard 754, August 1985. IEEE Standard 754, August 1985.
skipping to change at page 42, line 23 skipping to change at page 42, line 23
[RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF", [RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF",
RFC 7405, DOI 10.17487/RFC7405, December 2014, RFC 7405, DOI 10.17487/RFC7405, December 2014,
<https://www.rfc-editor.org/info/rfc7405>. <https://www.rfc-editor.org/info/rfc7405>.
[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for
Writing an IANA Considerations Section in RFCs", BCP 26, Writing an IANA Considerations Section in RFCs", BCP 26,
RFC 8126, DOI 10.17487/RFC8126, June 2017, RFC 8126, DOI 10.17487/RFC8126, June 2017,
<https://www.rfc-editor.org/info/rfc8126>. <https://www.rfc-editor.org/info/rfc8126>.
[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] [W3C.REC-xml-20081126]
Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and
F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth
Edition)", World Wide Web Consortium Recommendation REC- Edition)", World Wide Web Consortium Recommendation REC-
xml-20081126, November 2008, xml-20081126, November 2008,
<http://www.w3.org/TR/2008/REC-xml-20081126>. <http://www.w3.org/TR/2008/REC-xml-20081126>.
16.2. Informative References 16.2. Informative References
[W3C.REC-xmlschema-0-20010502] [W3C.REC-xmlschema-0-20010502]
Fallside, D., "XML Schema Part 0: Primer", World Wide Web Fallside, D., "XML Schema Part 0: Primer", World Wide Web
Consortium Recommendation REC-xmlschema-0-20010502, May Consortium Recommendation REC-xmlschema-0-20010502, May
2001, 2001,
<http://www.w3.org/TR/2001/REC-xmlschema-0-20010502>. <http://www.w3.org/TR/2001/REC-xmlschema-0-20010502>.
16.3. URIs
[1] https://github.com/Matroska-Org/matroska-specification/
[2] https://tools.ietf.org/html/bcp14
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
Moritz Bunkus Moritz Bunkus
Email: moritz@bunkus.org Email: moritz@bunkus.org
 End of changes. 110 change blocks. 
294 lines changed or deleted 323 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/