Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#135600 - 16/01/2003 09:12 MP3 format and padding
mschrag
pooh-bah

Registered: 09/09/2000
Posts: 2303
Loc: Richmond, VA
I saw something that concerned me a little bit wrt hashing in jEmplode. I ran my MP3's through MoodLogic which fixed all my tags. One of the things I noticed is that some MP3's didn't calculate to the same hash anymore. Now remember that my method for calculating MP3's is to pop off the ID3 tags and hash only on the MP3 data. It turns out that in some cases, the MP3 data had one extra byte on the end. Does anyone know if the MP3 format specifies some sort of padding where it's trying to keep the frame data to a multiple of some fixed offset from the start of the file or something? That really sucks if that is the case.

Top
#135601 - 16/01/2003 09:17 Re: MP3 format and padding [Re: mschrag]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4180
Loc: Cambridge, England
Does anyone know if the MP3 format specifies some sort of padding where it's trying to keep the frame data to a multiple of some fixed offset from the start of the file or something?

No. The size of an MP3 frame depends only on the bitrate and layer and other fields of the header. There is no leeway for padding. If two applications disagree about the size, one of them has a bug (but note that Lame, for instance, adds an "Oooh look encoded with Lame" block after the last frame, which doesn't begin with a frame header so is interpreted by players as loss of streaming).

Peter

Top
#135602 - 16/01/2003 09:29 Re: MP3 format and padding [Re: peter]
Daria
carpal tunnel

Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
note that Lame, for instance, adds an "Oooh look encoded with Lame" block after the last frame

Which thought was pretty lame

Top
#135603 - 16/01/2003 09:33 Re: MP3 format and padding [Re: Daria]
image
old hand

Registered: 28/04/2002
Posts: 770
Loc: Los Angeles, CA
i would disagree. it let's software like encspot to identify the "superior" codec.

Top
#135604 - 17/01/2003 11:58 Re: MP3 format and padding [Re: peter]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
I'm sure one of the fields in the header is called "padding", which I thought allowed frames that could encode to 1 byte shorter than usual to be padded to the length of the other frames. ISTR having an argument with Mike about it, but can't remember the outcome

Hugo

Top
#135605 - 17/01/2003 12:11 Re: MP3 format and padding [Re: altman]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31600
Loc: Seattle, WA
I had to work around this "one byte padding" thingamajig in my GapKiller code, so I'm intimately familiar with it. It's per-frame, so each and every frame has the possibility of having the padding byte, I don't think it has anything to do with the end of the file. This Guy has a very detailed and easy to understand description of the frame headers and how the padding byte works into it.

Edit: Mike, I just re-read what you were saying, and you were talking frame-by-frame not about the end of the file. So the header spec I just linked should in fact answer your question quite well.
_________________________
Tony Fabris

Top
#135606 - 17/01/2003 12:12 Re: MP3 format and padding [Re: altman]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
ISTR having an argument with Mike about it, but can't remember the

Said argument didn't take place over a pint or three, did it?
_________________________
- Tony C
my empeg stuff

Top