[ID3 Dev] synchsafe integers

Mark Smith mark at maseurope.net
Mon Sep 15 07:26:20 PDT 2008


It helped me to consider that a sync-safe integer is a 28 bit int,  
that is stored in a 32 bit container, such that bits 7, 15, 23 and 31  
are always cleared, and not used in the representation of the number.

Best,

Mark
On 15 Sep 2008, at 13:46, Ben Bennett wrote:

> On Mon, Sep 15, 2008 at 01:35:01PM +0530, Dhanraj Birader wrote:
>>  If bit 7 is zero then keep it as it is.
>
> No!  Otherwise you can not correctly convert back since multiple
> synchsafe ints would map to the same number.
>
>
>> On Sat, Sep 13, 2008 at 1:43 PM, Daniel Wechsler  
>> <daaaaaaniel at gmx.de> wrote:
>>> Bit 7 must always be 0, so 1111 1111 becomes 0000 0001  0111 1111.
>>>
>>> But what is if bit 7 is already 0? Do I have to add a 0, too?  
>>> [0000 0001
>>>  0111 1111 -> 0000 0010  0111 1111]
>
> Yes.  That is correct.
>
> Before Conversion      After Conversion
> --------------------   --------------------
> 0000 0000  1111 1111   0000 0001  0111 1111
> 0000 0001  0111 1111   0000 0010  0111 1111
>
> If you did not convert the second one, then you would be unable to
> tell what '0000 0001  0111 1111' mapped to.
>
>      	  Hope that helps.
>
>      	  	      -ben
>
> ---------------------------------------------------------------------
> 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