Re: EBML specification component for review - Element Data Size

Moritz Bunkus <[email protected]>
Newsgroups gmane.comp.multimedia.matroska.devel
Message-ID <[email protected]>
Hey,

I'm fine with using »length« instead of »width«. We should use it not
only in the element names, though, but also in the explanations (the
text you, Dave, have proposed still contains »widths«).

> > Right. So perhaps we need a specific constraints on the use of VOID
> > and CRC within an element of unknown size. It's hard to imagine the
> > use case of a CRC sub-element within an element of unknown size,
> > perhaps this can CRC within an unknown length element can simply be
> > forbidden.
> >
> > Would there be an issue with SimpleTag in the case of an unknown
> > size parent? SimpleTag can appear at several different levels.

Basically any multi-level EBML or DocType-specific element (EbmlVoid,
EbmlCrc, Matroska SimpleTag…) cannot be handled properly if its parent's
size is unknown as a parser cannot unambiguously determine its place in
the hierarchy. Therefore forbidding them sounds good to me.

By now I'm also in favor of restricting »unknown size« to a few cases at
most. The problem with detecting the next element unambiguously is one
of escaping. For example, if a cluster has an unknown length then a
parser would assume that any level 1 element (other cluster, tracks,
chapters, attachments, cues…) would signal the cluster's end. However,
such an ID may very well occur in e.g. the content of a KaxSimpleBlock.

If I remember correctly then libEBML contains some code for dealing with
this heuristically by reading the supposed next element's size field as
well and determining whether or not that seems plausible. I may be wrong
here.

Anyway, as wm4 said, this is very difficult at best for a
parser. Segments with an unknown size should be fine, but even clusters
don't strike me as a good candidate. Sure, a parser could improve that
heuristic further by not only reading the supposed element's ID and size
but also the next element's ID or something like that…

> It gets messy fast, which I think the use of elements with unknown
> length should be severely restricted.

Yep. Going out for a bike ride helps clear things up sometimes ;)

> > Doesn't it? If EBMLMaxSizeWidth=12 or EBMLMaxSizeWidth=8 then the
> > length of the 1-filled unknown size value changes accordingly,
> > right?

This is wrong. wm4 is right:

> In my understanding, there are multiple ways to encode the unknown
> size, and 0xFF is the shortest one. It's independent of
> EBMLMaxSizeWidth (it just restricts the maximum byte size you can use
> to encode the unknown size).

A size field (no matter how many bytes it's encoded with) whose bits are
all set to 1 signals an unknown size. 0xff does, as does 0x7f ff, 0x3f
ff ff etc.

Kind regards,
mosu

_______________________________________________
Matroska-devel mailing list
[email protected]
http://lists.matroska.org/cgi-bin/mailman/listinfo/matroska-devel
Read Matroska-Devel on GMane: http://dir.gmane.org/gmane.comp.multimedia.matroska.devel
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAABCAAGBQJVQ6CuAAoJEHSvAK3y4yyF5JAP/3+wZkuHFHUAS1lYIqQ939ir
nsLP+2PRRi4kejfNsuf5ZT3uPvHFU114O3Mk9iDR9mHqloJxP8e3SXOXTCEiZeze
wU2ej01JZfvJUzG3P6bxRtunDhESHTgQ/ZsU5KaNM+HYTqMev0Z7GfrNIPFG9RiX
Kr5QW9yxq9cykEC8tg7E/FM35F3OBe7U+FZ6cRHhayB+8lNrmI6gEfrxMiplzrPB
A2d1OZEQThPdG9Hd/I5D2ApkizXX9wABBUj63U8YyQ5nGvahnOkCE5LFPgHh3ECV
Ax+0KlExMwBZhqQC7K9mF8LOyHnHrZjE1mxtIMogzuPqKo05ybyydyAR+BkzlWVF
Z1W40w68gCiiel4bfcrO1opHmj2ysexFZNNUAib/sdyc9M3BGNIVgO2LoXR2E3Xv
Wob/vMqqX7aBvcDmpFT7LqCK4FRFEcouklMd4LOlVOFDvbRSoS9AsYn+Lm+vT3k7
/C1Z/S8hb/1fmBT2T8pPgtlydiDhAU4LAvpsg/Wu1Kuj6ZJav0OQr9WrLQea6QvD
qsdwJw6Zdr3GxjgERL5F5voCadEw7x3BrgXXG5nqI3LD5ZSTW+k6ewmWIYQ8Gwq4
S+rSDd0zsz8uR0sbodCmGs5seKO4KHS8xBpBaqYt6vHo2CGg/xR6zxcJ7KfVwbAb
zE1wVPxxqHpbvaOGH11L
=IBvJ
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.