Skip to main content

Topic: Bit-perfect AAC/MP3/etc decoding? (Read 4743 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • mavere
  • [*]
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?
  • Last Edit: 04 January, 2013, 06:51:29 PM by mavere

  • DVDdoug
  • [*][*][*][*][*]
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.
  • Last Edit: 04 January, 2013, 07:06:00 PM by DVDdoug

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
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.

  • saratoga
  • [*][*][*][*][*]
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.

  • mjb2006
  • [*][*][*][*][*]
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.
  • Last Edit: 04 January, 2013, 09:54:21 PM by mjb2006

  • benski
  • [*][*][*][*][*]
  • Developer
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.


  • IgorC
  • [*][*][*][*][*]
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
  • Last Edit: 05 January, 2013, 02:43:20 PM by IgorC

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
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?
  • Last Edit: 05 January, 2013, 04:56:23 PM by db1989

  • Soap
  • [*][*][*][*][*]
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?
  • Last Edit: 05 January, 2013, 04:13:08 PM by Soap
Creature of habit.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
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. :/

  • Soap
  • [*][*][*][*][*]
Bit-perfect AAC/MP3/etc decoding?
Reply #10
I apologise for talking nonsense. :/


No, no.  My reading and math both fail me at times.
Creature of habit.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
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.
  • Last Edit: 05 January, 2013, 06:14:56 PM by db1989

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.

  • saratoga
  • [*][*][*][*][*]
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.