[Matroska-devel] Re: DRAFT: new elements for compression/encryption

Steve Lhomme steve.lhomme at free.fr
Fri Oct 17 11:36:08 CEST 2003


Ronald Bultje wrote:

> On Fri, 2003-10-17 at 10:56, Steve Lhomme wrote:
> 
>>In other words, a bitfield contains many different "data", unlike an 
>>uint/sint which contains linear values.
> 
> 
> No, differently: how, in code, differs an EbmlUint from a EbmlBitfield?
> A sint/uint differ in binary. A uint/bitfield will not differ in binary,
> and their interpretation will not differ either. At best, you would
> provide a macro set like set_bit() and get_bit(). Apart from that,
> they're exactly the same.
> 
> Or maybe I'm thinking too much in terms of C. In my C lib, EbmlDate and
> EbmlSint or EbmlAscii and EbmlUTF8 are aliases of each other. They're
> the same.

OK, so in your code, the bitfield handling would just be a new alias. 
But that doesn't mean EbmlUTF8 is the same as EbmlDate :)

The difference between an EbmlUint and EbmlBitfield would be the way to 
retrieve/store data from it. As, so far in libebml, the reader/writer 
doesn't need to care of how data are stored in the field, it should have 
no way/need of knowing the position of some bits in the bitfield. It 
should just require the name of a bit section (one or more bits) and the 
number of bits to set (with values in local endianess).




More information about the Matroska-devel mailing list