<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 17, 2008, at 4:52 PM, Markus Multrus wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,<br><br>I'm trying to understand the correct syntax in v2.4 with regards to<br>compression and data length indication. In section 4.1 is written:<br><br>"<br>Some frame format flags indicate that additional information fields<br>are added to the frame. This information is added after the frame<br>header and before the frame data in the same order as the flags that<br>indicates them. I.e. the four bytes of decompressed size will precede<br>the encryption method byte. These additions affects the 'frame size'<br>field, but are not subject to encryption or compression.<br>"</div></blockquote><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>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:<br></div><div>h - one byte for the group ID</div><div>k - indirectly, as it then REQUIRES p to be set.</div><div>m - one byte to connote encryption method</div><div>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. </div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>If encryption or compression is used, it is applied to the payload only. Not to the header and the possible extra data outlined above.<br></div><div><br></div><br><blockquote type="cite"><div><br><br>But in section 4.1.2 is written:<br><br>"<br>k - Compression<br><br>This flag indicates whether or not the frame is compressed.<br>A 'Data Length Indicator' byte MUST be included in the frame.<br><br>0 Frame is not compressed.<br>1 Frame is compressed using zlib [zlib] deflate method.<br>If set, this requires the 'Data Length Indicator' bit<br>to be set as well.<br>"<br><br>There are several things I do not understand:<br><br>1) What is a "'Data Length Indicator' byte"? Should this not read as<br>something like "4 bytes indication data length"?</div></blockquote><br><blockquote type="cite"><div><br><br>2) There is written that the 'Data Length Indicator' bit should be set.<br>As I understand this, I would ad the data length indication only once,<br>i.e. at the very end of the additional payload, where it corresponds to<br>the data length indicator bit.<br>In case for a frame format flag like '01001111' (which complies to the<br>requirement above) I would add the following data right after the frame<br>header (and before the real frame payload):<br><br>1 byte grouping id<br>1 byte encryption method<br>4 byte data length indication (32 bit synchsafe)<br><br>But this contradicts to the above cited section 4.1:<br>"(...) I.e. the four bytes of decompressed size will precede<br>the encryption method byte. (...)"<br><br>Can anybody tell me, what is the correct implementation?<br><br>Best,<br><br>Markus<br><br>---------------------------------------------------------------------<br>To unsubscribe, e-mail: <a href="mailto:id3v2-unsubscribe@id3.org">id3v2-unsubscribe@id3.org</a><br>For additional commands, e-mail: <a href="mailto:id3v2-help@id3.org">id3v2-help@id3.org</a><br><br><br></div></blockquote></div><br></body></html>