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: Comparator—differences between lossy file and pre-decoded version—why? (Read 2372 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Comparator—differences between lossy file and pre-decoded version—why?

Hello,

I got problem with official Binary Comparator component. There's something I can't understand. I decoded several AAC and MP3 files to PCM/WAV. Then I've made bit-comparison between encoded and decoded versions. And unfortunately component reports differences between them :/ . Why? When I compare WAV with FLAC made from this WAV everything works OK - both decoded streams are identical. Then why stream decoded directly from mp3/aac is different than decoded from wave made of this mp3/aac? I thought that I can use Binary Comparator to detect weather FLAC was made from iTunes AAC or MP3 with lowpass filtering disabled while encoding but it's impossible... Why?

Comparator—differences between lossy file and pre-decoded version—why?

Reply #1
The Binary Comparator works best for lossless file. The most likely reason why a lossless file may differ from the lossy file from which it was created is that the conversion introduced clipping. Lossy encodings like MP3 and AAC encode the frequency content of the audio. When this is converted to samples, some sample amplitudes may exceed digitial full scale. These samples will be clipped when encoded in WAV or FLAC. Another reason might be the quantization in the lossless version.

Comparator—differences between lossy file and pre-decoded version—why?

Reply #2
Thanks for the info... Is there anything that I can do to bit-compare lossy with lossless ? Change bit-depth of decoded .wav to 32 bit? Source files are "16 bit-like" (I mean - AAC and MP3 were originally 16 bit before they were encoded).

Comparator—differences between lossy file and pre-decoded version—why?

Reply #3
OK - when I use 32-bit WAVE file as output file, then both AAC/MP3 and decoded WAV are identical for Binary Comparator component - tested.
Simple question - is there a way to distinguish pure FLAC from FLAC encoded from iTunes AAC? Not necesarilly based on foobar? As far as I know (from my experience) auCDtect isn't capable to properly distinguish them...

Comparator—differences between lossy file and pre-decoded version—why?

Reply #4
Bit-compare means to compare the exact decoded sample values.

If they're lossy, they're different from the lossless files they were encoded from. If they were the same, they'd have been lossless.

You could try to decode your lossy to WAV or, say FLAC and compare that to another decode to WAV or FLAC at the same bit depth but you might still expect to find differences in random dither noise used properly to accomplish the bit-depth reduction.
Dynamic – the artist formerly known as DickD