[ID3 Dev] v2.4 frame syntax: compression and data length indication

Timothy Reaves treaves at silverfieldstech.com
Mon Dec 1 10:36:09 PST 2008


On Aug 17, 2008, at 4:52 PM, Markus Multrus wrote:

> Hi,
>
> I'm trying to understand the correct syntax in v2.4 with regards to
> compression and data length indication. In section 4.1 is written:
>
> "
> Some frame format flags indicate that additional information fields
> are added to the frame. This information is added after the frame
> header and before the frame data in the same order as the flags that
> indicates them. I.e. the four bytes of decompressed size will precede
> the encryption method byte. These additions affects the 'frame size'
> field, but are not subject to encryption or compression.
> "

	This means that every flag that is set in the frame header flags,  
that requires additional data, will have it's data after the frame  
header but before the frame payload.  Each one of the flags requiring  
extra storage are:
h - one byte for the group ID
k - indirectly, as it then REQUIRES p to be set.
m - one byte to connote encryption method
p - a four byte sync safe integer.  This value differs from the size  
in that this value does not take into account the possible six bytes  
for [h,m,p], and the payload being non-compressed, and non-encrypted.

	If encryption or compression is used, it is applied to the payload  
only.  Not to the header and the possible extra data outlined above.


>
>
> But in section 4.1.2 is written:
>
> "
> k - Compression
>
> This flag indicates whether or not the frame is compressed.
> A 'Data Length Indicator' byte MUST be included in the frame.
>
> 0     Frame is not compressed.
> 1     Frame is compressed using zlib [zlib] deflate method.
> If set, this requires the 'Data Length Indicator' bit
> to be set as well.
> "
>
> There are several things I do not understand:
>
> 1) What is a "'Data Length Indicator' byte"? Should this not read as
> something like "4 bytes indication data length"?

>
>
> 2) There is written that the 'Data Length Indicator' bit should be  
> set.
> As I understand this, I would ad the data length indication only once,
> i.e. at the very end of the additional payload, where it corresponds  
> to
> the data length indicator bit.
> In case for a frame format flag like '01001111' (which complies to the
> requirement above) I would add the following data right after the  
> frame
> header (and before the real frame payload):
>
> 1 byte grouping id
> 1 byte encryption method
> 4 byte data length indication (32 bit synchsafe)
>
> But this contradicts to the above cited section 4.1:
> "(...) I.e. the four bytes of decompressed size will precede
> the encryption method byte. (...)"
>
> Can anybody tell me, what is the correct implementation?
>
> Best,
>
> Markus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: id3v2-unsubscribe at id3.org
> For additional commands, e-mail: id3v2-help at id3.org
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.id3.org/pipermail/id3v2/attachments/20081201/b3edc844/attachment.html>


More information about the ID3v2 mailing list