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: Bit-perfect AAC/MP3/etc decoding? (Read 6934 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Bit-perfect AAC/MP3/etc decoding?

Sorry if this is easily answered elsewhere.

My question is that in a comparison of lossy-format decoders between, let's say, iTunes and Foobar and Winamp, will the output (edit: of a single source file) vary between decoding implementations?

Or is it that once a decoder follows a specified format, all output is equal assuming there are no bugs?

Bit-perfect AAC/MP3/etc decoding?

Reply #1
Unlike encoding, I believe all decoders are supposed to be the same.

The decoder has a lot simpler task of decoding & reconstructing a wavefrom from whatever data is present.  The encoder has to decide what data to throw-away.

Bit-perfect AAC/MP3/etc decoding?

Reply #2
Quote
Unlike encoding, I believe all decoders are supposed to be the same.
Within some aurally insignificant reference range. Beyond that, I don’t think differences are uncommon, albeit slight.

Decodes can differ due to differences in rounding between CPUs, programming implementations, dither, etc.

Will the outputs be equal? Perhaps not. Does it matter? Not unless something is broken.

Bit-perfect AAC/MP3/etc decoding?

Reply #3
My question is that in a comparison of lossy-format decoders between, let's say, iTunes and Foobar and Winamp, will the output vary between decoding implementations?


Yes.  Lossy formats rarely specify a bit perfect output.  Instead a series of test tracks is usually provided with a maximum allowable error for each track.  All compliant implementations should produce output within this specification.

In practice, most software running on PC will be using 32 bit floating point and so will tend to have much greater accuracy then is required.  Some embedded implementations may be less accurate, particularly on 16/24 bit processors and DSPs.

Bit-perfect AAC/MP3/etc decoding?

Reply #4
In AAC there can be Perceptual Noise Substitution, so I'm not sure I could expect identical output even from the same decoder.

Bit-perfect AAC/MP3/etc decoding?

Reply #5
In AAC there can be Perceptual Noise Substitution, so I'm not sure I could expect identical output even from the same decoder.


The random number generator is seeded at the start of the stream from a fixed value, so it is deterministic and repeatable.  That being said, seeking or starting mid-stream will cause differences.


Bit-perfect AAC/MP3/etc decoding?

Reply #6
Related topics

Updated compliance testing for Winamp and Foobar

MP3 decoding differences, foobar2000 1.2

Even if hardware would be perfectly ideal and considering best human hearing abilities, still the precision of MP3 decoding (24 bits) is excessively high.

P.S. The last Apollo player has a ridiculously precise MP3 decoder in 24 bits mode.  http://koti.welho.com/hylinen/apollo/FAQ.html

Bit-perfect AAC/MP3/etc decoding?

Reply #7
…in which the author claims that differences that at most represent fluctuations in the least-significant of 24-bits are the answer to the question “Why does Apollo sound so good?”. Should we be directing traffic towards such nonsense?

Bit-perfect AAC/MP3/etc decoding?

Reply #8
…in which the author claims that differences that at most represent fluctuations in the least-significant of 24-bits are the answer to the question “Why does Apollo sound so good?”. Should we be directing traffic towards such nonsense?


Isn't he saying his error is in the 24th bit while others are 100x worse - ie. 17 bits down?  Or is my math horrid?
Creature of habit.

Bit-perfect AAC/MP3/etc decoding?

Reply #9
Sorry, I did read it wrongly.

Quote
RMS level [of the then-latest version of MAD] is over a hundred times the one produced by Apollo 37zm and the maximum difference is four times the one by Apollo (interestingly the results for MAD 0.11.4b seem to be somewhat better than for the latest one but they are still worse than Apollo's). Actually, the maximum difference of Apollo's output is the smallest possible deviation in 24-bit data, the only smaller possible value would be zero.

So, you’re right; this suggests that MAD produced an RMS between 6–7 bits larger in magnitude than Apollo did, and (I guess) a maximal difference 2 bits larger in magnitude.

I apologise for talking nonsense. :/


Bit-perfect AAC/MP3/etc decoding?

Reply #11
Heh, I’m glad it’s not just me.

Although I welcome higher precision, I still take issue with descriptions like these:
Quote
Why does Apollo sound so good?

The sound quality has always been an important factor when making decisions in the decoder code. Recent addition of 32-bit and 24-bit output has resulted in further improvements in the quality. To prove this, I measured the difference of Apollo 37zm 24-bit output to the MPEG-1 audio layer 3 compliance test reference signal […] Of course, this only goes for the provided test signal, but it should give some picture about the sound quality.

Logic that extrapolates conclusions about sound quality from measurements is not in line with TOS #8 – especially when the reported differences lie beyond the 16th bit – so I’d advise readers not to take this seriously.

Bit-perfect AAC/MP3/etc decoding?

Reply #12
Unlike encoding, I believe all decoders are supposed to be the same.


The operation of decoders is generally well-known and well-defined.

Evens so, bit perfect can be tough because different hardware implements arithmetic with subtle differences and at the LSB level insignificant variations in things like order of operations can lead to tiny differences.

Bit-perfect AAC/MP3/etc decoding?

Reply #13
Evens so, bit perfect can be tough because different hardware implements arithmetic with subtle differences and at the LSB level insignificant variations in things like order of operations can lead to tiny differences.


For mp3 its even more complex because the specification provides filter constants to specified precisions, but does not define the precision of the actual filterbank operations nor their precise implementation.  Thus there is no "exact" value to compare to, only a range of values you should not exceed.

Of course as Arnold points out, these differences are incredibly small and completely irrelevant to audio quality when implemented on modern 32 or 64 bit machines.  They mostly only matter when using 16 bit DSP cores.