Why do FLAC files vary so much in size?
Sep 20, 2013 at 11:26 PM Thread Starter Post #1 of 6

dizzyorange

500+ Head-Fier
Joined
Nov 21, 2005
Posts
720
Likes
23
I'm trying to understand how FLAC files can vary so much in size.  Some FLAC files of classical music can be in 400-500kbps, while rock tracks are often nearer to 1000kbps.  Since FLAC is lossless, no information is being thrown away, isn't FLAC pretty much like an advanced form of a ZIP file?  That is how I (probably wrongly) conceptualize it - that FLAC is basically a zipped WAV with extra optimizations.
 
So why is it that quiet acoustic tracks have much lower bitrates than "busier" tracks (just like lossy codecs)?  I realize there are different compression settings, but the file sizes still differ drastically with the same compression setting on different songs.  
 
With lossy codecs, there is much less information to encode in a (for example) solo acoustic guitar track.  So there is more information that can be discarded, making the bitrate smaller given the same VBR quality setting.  But in lossless, no information is thrown away.  That is the point that I am tripping up on.
 
Sep 21, 2013 at 1:08 AM Post #2 of 6
Well, zip 1 GB of some data and it will compress a lot, zip 1 GB of some other data, and it may not compress much at all. It's similar here.
 
For any lossless compression scheme, the goal is to find a representation of the original data that uses fewer bits (characters) than the original did. Both original and compressed data contain the same information and the same randomness. Glossing over implementation details, it's about finding patterns and representing those common patterns of a longer length with shorter strings, thereby saving space. It's like finding a shorthand description. For lossy encoding, it's similar, except we tolerate some difference in information between the original and compressed versions. There is a tradeoff between the distance (and the nature of this difference—for audio, you want something that's perceptually close, even if it may not be close in terms of raw bits) and the compression level.
 
If the data is less random and unpredictable (less patterns, etc.), it can be compressed more, so you get a lower bitrate.
 
Broadband, noiselike sounds are more random and thus require a higher bitrate. Having more sounds layered of course also makes it harder to compress. Having louder sounds also should be harder to compress I think (uh... fewer zeros padded in front for most samples, so I think that's right?).
 
Sep 21, 2013 at 1:17 AM Post #3 of 6
From my limited knowledge having more bits will only increase the dynamic range (giving no audible advantages to us as humans) because 16 bit audio gives more than enough dynamics for any genre.  
 
Simply put you can convert flac files to what ever bit rate and frequency you want if you start with a 32bit 96khz track you can rip it to 16/44.1 or 16/48 or what ever and have a much larger file. Just like with mp3 files, if you want to loose quality you can drop the bit rate to something crazy like 10kbps and have a super small, super compressed file.  Same goes for flac just on a much larger scale iirc.
 
Sep 21, 2013 at 1:36 AM Post #4 of 6
  I'm trying to understand how FLAC files can vary so much in size.  Some FLAC files of classical music can be in 400-500kbps, while rock tracks are often nearer to 1000kbps.  Since FLAC is lossless, no information is being thrown away, isn't FLAC pretty much like an advanced form of a ZIP file?  That is how I (probably wrongly) conceptualize it - that FLAC is basically a zipped WAV with extra optimizations.
 
So why is it that quiet acoustic tracks have much lower bitrates than "busier" tracks (just like lossy codecs)? 

 
Because the busier track contains more information than the quiet acoustic track.
smile.gif

 
Sep 21, 2013 at 3:37 AM Post #5 of 6
  Because the busier track contains more information than the quiet acoustic track.
smile.gif

 
Yes, it might not be very "musical" information, but the lossless codec will faithfully reproduce all the loud noise. Basically, the following factors typically increase the size of FLAC files:
- higher RMS level (a "quiet" track does not even use all the 16 bits most of the time, so that alone allows for some compression)
- high noise content (lots of cymbals, snare drums, etc. as opposed to more "pure" tonal sounds like a piano) - it is not possible to compress uniform white noise losslessly
- more high frequency information, particularly noise-like sounds such as cymbals (because it is harder to predict the next sample from the previous ones)
FLAC works by approximating the signal with linear prediction, and then compressing the residual (the difference of the input and the predicted signal) with entropy coding. So, a quiet, mostly tonal signal will compress well, but a loud, "noisy" metal track with a lot of cymbals will not.
 

Users who are viewing this thread

Back
Top