[ID3 Dev] [OT] Sync-safe sizes?
Mike van Bokhoven
mike at ambientdesign.com
Wed May 16 22:09:33 PDT 2007
I mean word in this sense:
http://www.webopedia.com/TERM/w/word2.html
http://www.computeruser.com/resources/dictionary/dictionary.html
In this case, as I'm writing for 32-bit platforms only, I mean 32 bits, but
I guess it could mean pretty much any size that could be argued to be native
to a given platform in some way. e.g. if I were writing for a PDP8, I'd mean
12 bits. So, I should have been more specific!
Mike.
----- Original Message -----
From: "Jim" <jmartin92 at comcast.net>
To: <id3v2 at id3.org>
Sent: Thursday, May 17, 2007 4:50 PM
Subject: Re: [ID3 Dev] Sync-safe sizes?
> This is a little off-topic, but why are you reading in a word for the
frame
> size? (Does word in this context mean 16 bits or 32 bits?)
>
> ----- Original Message -----
> From: "Mike van Bokhoven" <mike at ambientdesign.com>
> To: <id3v2 at id3.org>
> Sent: Thursday, May 17, 2007 12:04 AM
> Subject: [ID3 Dev] Sync-safe sizes?
>
>
> > Hi! New list member here.
> >
> > I'm just writing in the hope of a bit of clarification regarding
sync-safe
> > words, mainly the sizes of the tag and frames. The 2.3 spec says:
> >
> > -------------------------------------------------------
> > ID3v2 size 4 * %0xxxxxxx
> > The ID3v2 tag size is encoded with four bytes where the most significant
> bit
> > (bit 7) is set to zero in every byte, making a total of 28 bits. The
> zeroed
> > bits are ignored, so a 257 bytes long tag is represented as $00 00 02
01.
> > -------------------------------------------------------
> >
> > The 2.4 spec says:
> >
> > -------------------------------------------------------
> > ID3v2 size 4 * %0xxxxxxx
> > The ID3v2 tag size is stored as a 32 bit synchsafe integer (section
6.2),
> > making a total of 28 effective bits (representing up to 256MB).
> >
> > -------------------------------------------------------
> >
> > As far as I can see, these two specs are identical with regards to these
> > fields. When I'm reading frames, I read in a word for the size.
Originally
> I
> > was compressing that value to ignore the missing bit. I found that that
> > didn't seem to work for any APIC frame (and I expect any frame with size
> > >127 bytes). On a little investigation, I discovered that the raw value
I
> > read in already represented the correct size, before the adjustment! But
> the
> > specs seem clear - both tag and frame sizes are represented by expanded,
> > sync-safe words.
> >
> > All the tags I'm looking at are version 3 (2.3). Doing some research, I
> > found one person claiming that 2.3 and earlier don't use sync-safe
words,
> > which disagrees with the spec, but agrees with my observations. I
haven't
> > been able to find out much more.
> >
> > My question is - what am I missing here? I can't believe that pretty
much
> > everyone who writes APIC frames is getting the encoding wrong...
> >
> > Thanks,
> >
> > Mike.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: id3v2-unsubscribe at id3.org
> > For additional commands, e-mail: id3v2-help at id3.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: id3v2-unsubscribe at id3.org
> For additional commands, e-mail: id3v2-help at id3.org
>
---------------------------------------------------------------------
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