[Matroska-devel] CRC-32

Pavel Koshevoy pkoshevoy at sorensonmedia.com
Tue Apr 20 16:46:40 CEST 2010


Hi,

I am working on an EBML/Matroska SDK, and I am at the
stage where I need to add CRC-32 element support, both
for reading and writing.

I am quiet confused on the spec for CRC-32 use in
Matroska/EBML.  Quoting from various specs on the subject:

1. http://ebml.sourceforge.net/specs/
   CRC-32  	1+  	[BF]

   The CRC is computed on all the data from the last
   CRC element (or start of the upper level element),
   up to the CRC element, including other previous
   CRC elements. All level 1 elements should
   include a CRC-32.

2. http://www.matroska.org/technical/specs/rfc/index.html

    The CRC32 container can be placed around any
    EBML element or elements. The value stored in
    CRC32Value is the result of the CRC-32 [CRC32]
    checksum performed on the other child elements.

      CRC32 := c3 container [ level:1..; card:*; ] {
        %children;
        CRC32Value := 42fe binary [ size:4; ]
      }

3. http://www.matroska.org/technical/specs/index.html

     CRC-32 	1+ 	[BF]

     The CRC is computed on all the data of the
     Master element it's in, regardless of its position.
     It's recommended to put the CRC value at the
     beggining of the Master element for easier reading.
     All level 1 elements should include a CRC-32.


Which of these specifications is the correct one?
Is there a small sample matroska file with CRC-32
elements (preferably at segment, cluster, and
SimpleBlock/BlockGroup levels) that I could take
a look at?  Is there a tool that produces
matroska files with nested CRC-32 elements?

Thank you,
	Pavel.



More information about the Matroska-devel mailing list