View Single Post
Old 6th November 2003, 08:13   #16  |  Link
Atamido
Seņor Member
 
Atamido's Avatar
 
Join Date: May 2002
Location: Austin, Texas
Posts: 915
Quote:
Originally posted by Liisachan
I should soon love the new lacing too if it makes files more compact and functional, and I always admir their (dev ppl's) creativity.

That said, I really do hope that coming newer filters (1.0.1.9+) and all the related components can parse the old files too forever, because I already have some MKV files that have "the old structure" and I already , ah, presented some of my MKV files to...somone else, so I can't remux all the files to let them have the new lacing sysytem...I mean, what I really fear is hearing someday "the system in libmatroska 0.5.x is obsolete and playing back such old MKV files will be no more supported." But maybe only a few ppl think that way.
A quick explanation of the way that lacing worked will show that old files are fine. Originally the lacing system used by Matroska was the lacing system designed by Xiph for Vorbis. You have a normal Block with a timecode. There is a bit set in the Block that indicates lacing is being used. Next you have the number of laced packets. (The spec allows for up to 255, but libmatroska only writes up to 8.) Next you have the size of each laced packet, and then the packets themselves to the end of the block. It actually turned out to be only slightly more efficient for a lot of codecs and not really worth the hassle. Recently a few ideas were tossed around such as storing the the size of the packets as an EBML number as it would be more efficient for larger packet sizes.

Also, there was an idea to set a flag if all of the packets were the same size. This would mean a single bit and the number of packets in the lace. Then all of the sizes are known because you know the total size and the number of equal size packets.

Some tests were performed and it was discovered that codecs with larger packets were more efficient with the EBML numbers. And codecs with fixed packet sizes, like AC3, were super efficient with the fixed size flag.

So, three settings were made for lacing. The original setting is still the Xiph lacing. This means that all of the old files that were made with Xiph lacing are still valid and this lacing is still being used. The next is for EBML lacing, and the last is for fixed size lacing.

When muxing, the muxer automatically determines for each block which lacing scheme would be most efficient. So most streams will likely have a mix of all three. See here for a list of different overheads and see how much of a difference the new system made from the Xiph-only system that was used previously.
Atamido is offline