Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Decompression of MP3s (Read 5449 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Decompression of MP3s

Hi,

I downloaded a podcast from the BBC website in mp3 format, and discovered that the following programs
all produce different WAV files when it is decompressed:

a) EAC (I burned the mp3 straight to CD in EAC, and then ripped the single-track with EAC to WAV)
b) Winamp (playing mp3 with output plug-in "diskwriter")
c) LAME 3.98.4
d) LAME 3.99.5

It is not just a case of some WAVS having a few more milliseconds of silence at the start, or different headers.
When comparing the audio data of the WAVs in EAC ("compare wavs"), they all contain different samples.

I am puzzled, as I thought there was only one way to decompress an mp3 to WAV format, and that it didn't
matter which software was used. (I do, of course, understand that compressing WAV to mp3 depends on the
acoustic algorithm used.)

Please could someone explain in layman's terms why mp3 decompression is not unique?
This seems to imply that some mp3 players may sound better than others (assuming the audio differences
are big enough to be audible, which they probably aren't).

Thanks!
Bluto

Decompression of MP3s

Reply #1
MP3 files are generally decoded using floating point numbers which are subject to rounding error.  Differences in the order of mathematical operations will slightly change the value of their results.

For this reason the mp3 specification does require that all decoders produce the same output, just that the error in their output be within some small bounds.  Assuming none of the decoders you used are broken, and that you used gapless decoding, if you look at the residual between decoders it will be quite small relative to the signal as required per the specification.

Decompression of MP3s

Reply #2
MP3 files are generally decoded using floating point numbers which are subject to rounding error.  Differences in the order of mathematical operations will slightly change the value of their results.

For this reason the mp3 specification does require that all decoders produce the same output, just that the error in their output be within some small bounds.  Assuming none of the decoders you used are broken, and that you used gapless decoding, if you look at the residual between decoders it will be quite small relative to the signal as required per the specification.


Thank you for the speedy reply. Does this mean that if the WAVs are aligned (i.e. any offsets due to tiny silent gaps at the start are corrected), then the difference between the bytes should be small?
So one WAV might be, say, 40, 67, 253, 27, 5, ... and the other one, say, 39, 67, 254, 29, 5, ...?

Bluto

Decompression of MP3s

Reply #3
Quote
Does this mean that if the WAVs are aligned (i.e. any offsets due to tiny silent gaps at the start are corrected), then the difference between the bytes should be small?
So one WAV might be, say, 40, 67, 253, 27, 5, ... and the other one, say, 39, 67, 254, 29, 5, ...?
Yes...  Sort-of...  Typically you are decoding to 16-bit words (not 8-bit bytes).  If you look at the file with a hex editor, you'll see bytes and the most significant byte should match exactly with any variations only in the least significant byte (except where there is a "carry" into the MSB.) 

I'm just guessing, but I would expect the results to match to better than 1% and if you can time-align to the exact sample, I would expect subtraction (which you can do with an audio editor) to yield a silent file (inaudible without "artificial" amplification).

In any case, the differences should be insignificant if everything is working correctly.  Any quality loss happens during compression when you "throw-away" about 80-90 percent of the information.

Decompression of MP3s

Reply #4
Sure, decode to 24 bit wav and see for yourself.

Decompression of MP3s

Reply #5
Thank you both!
Bluto

Decompression of MP3s

Reply #6
It puzzles me that mp3 files are offset. If they are aligned, however, you might bitcompare them with foobar2000 and the foo_bitcompare component, and notice the peak of the diff. I've seen roundoff errors cause differences in the -150 dB order of magnitude - it doesn't bother me :-)