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

Markus Multrus markus at multrus.com
Sun Aug 17 13:52:16 PDT 2008


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.
"

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



More information about the ID3v2 mailing list