Skip to main content

Topic: Diff after decode FLAC file (Read 3835 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • evoj2
  • [*]
Diff after decode FLAC file
Hi.

I had a FLAC file which I decoded using the reference decoder. As expected, the WAV file was larger than the FLAC one: it had 51.304.506 bytes. Then, I coded this WAV file and got a FLAC file.

However, while the first one had 31.240.944 bytes, the second one had 29.144.603 bytes. After that, I decoded this final FLAC file and the resultant WAV file had 51.304.220 bytes.

So, where is the lossless compression? Curiously, when I compared these files with 'diff' command, it shows they're equal. How is this possible, if they have different sizes?

Thanks!

  • saratoga
  • [*][*][*][*][*]
Diff after decode FLAC file
Reply #1
Flag files have tags so the file sizes won't be equal.

  • pdq
  • [*][*][*][*][*]
Diff after decode FLAC file
Reply #2
Different encoder settings give different compressed file sizes.

Diff after decode FLAC file
Reply #3
Flag files have tags so the file sizes won't be equal.
That explains the  size difference between the flac files, but what about the wav files difference ? Could you elaborate ?
I've always found it strange that the wav-flac-wav process can result in non-identical wav files. The audio conversion is lossless, that's not the issue. I've found the --keep-foreign-metadata option to be the solution, especially since I mostly use BWF (broadcast wave) files with metadata that shouldn't get lost or modified. Unfortunately the decoder doesn't automatically recognize this option, so it's not completely idiot proof.
evoj2, would you be able to repeat your test with this option ? I'm curious if it solves your "problem".

  • skamp
  • [*][*][*][*][*]
  • Developer
Diff after decode FLAC file
Reply #4
Indeed, it seems that --keep-foreign-metadata was used the first time when encoding the first FLAC file. I find that surprising though: the command-line encoder/decoder doesn't use it by default (WavPack does).
  • Last Edit: 22 November, 2013, 01:51:52 PM by skamp
See my profile for measurements, tools and recommendations.

  • saratoga
  • [*][*][*][*][*]
Diff after decode FLAC file
Reply #5
Flag files have tags so the file sizes won't be equal.
That explains the  size difference between the flac files, but what about the wav files difference ? Could you elaborate ?



While tagging WAV files with album/song info is uncommon, they still have headers that contain information about the file (including in some cases actual album info).  Theres various ways you can put together a wav file, and they're not necessarily the same size.

Theres some information here if you're interested:  http://www-mmsp.ece.mcgill.ca/Documents/Au.../WAVE/WAVE.html

As you can see, even for plain 16 bit, stereo PCM there are various different ways the header can be constructed even without considering metadata.