Is FLAC a variable bit rate format when streamed? If so, how can it be truly lossless? -- Dennis Brunnenmeyer Director of Engineering CEDAR RIDGE SYSTEMS 15019 Rattlesnake Road Grass Valley, CA 95945-8710 Office: 1 (530) 477-9015 Mobile: 1 (530) 320-9025 eMail: dennisb /at/ chronometrics /dot/ com http://www.chronometrics.com/crs/index.html <http://www.chronometrics.com/crs/index.html> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20110523/b8ce69cb/attachment.htm
FLAC is variable bitrate, but the bitrate is determined by how efficiently the data can be compressed while maintaining 100% data integrity. On Mon, May 23, 2011 at 1:26 PM, Dennis Brunnenmeyer <dennisb at chronometrics.com> wrote:> Is FLAC a variable bit rate format when streamed? If so, how can it be truly > lossless? > -- > > Dennis Brunnenmeyer > Director of Engineering > CEDAR RIDGE SYSTEMS > 15019 Rattlesnake Road > Grass Valley, CA 95945-8710 > Office:?? 1 (530) 477-9015 > Mobile: 1 (530) 320-9025 > eMail:? dennisb /at/ chronometrics /dot/ com > http://www.chronometrics.com/crs/index.html > > > _______________________________________________ > Flac-dev mailing list > Flac-dev at xiph.org > http://lists.xiph.org/mailman/listinfo/flac-dev > >
On 2011-05-23, at 19:26 , Dennis Brunnenmeyer wrote:> Is FLAC a variable bit rate format when streamed? If so, how can it be truly lossless?The same way zip and PNG compression are truly lossless: something can take more space than the information it contains needs. For instance, take a 1024*1024 completely white bitmap. Your bitmap file is 1MB (1048576 bytes). A good PNG compressor can get it to 200 bytes (this is not a typo: I have a completely white 1024*1024 PNG file in 222 bytes). Well it's the same with sound (a 5mn track with no sound whatsoever contains less information than "Nun seh' ich wohl, warum so dunkle Flammen"). That's also why the format can't help but be VBR: different pieces of sound contain different amounts of information per second, and therefore have different compression ratio (and compression ratios can ? very rarely ? go above even 1: white noise is completely incompressible, when you add FLAC metadata you end up with a FLAC file bigger than the source WAV)
I'm well aware how compression works. But images and document files do not depend on the relative timing of the data to reproduce themselves. They are in essence only two-dimensional in space, whereas the data in a sound file is time-dependent. The question really has more to do with the decoded FLAC stream output, which I presume is a linear PCM file, e.g. WAV. If FLAC is lossless and created from an original CBR WAV file, is is true that the decoded output is also CBR when played? That is, WAV in = WAV out, where both are CBR? Thanks for any insights on this matter. I've been told that because a FLAC stream from a server to an application is VBR, that certain transients are not handled correctly, like the ringing of bells. If this were true, FLAC would not be lossless in this application. Dennis... ------------------------------------------------------------------------ On 5/23/2011 10:58 AM, Masklinn wrote:> On 2011-05-23, at 19:26 , Dennis Brunnenmeyer wrote: >> Is FLAC a variable bit rate format when streamed? If so, how can it be truly lossless? > The same way zip and PNG compression are truly lossless: something can take more space than the information it contains needs. > > For instance, take a 1024*1024 completely white bitmap. Your bitmap file is 1MB (1048576 bytes). A good PNG compressor can get it to 200 bytes (this is not a typo: I have a completely white 1024*1024 PNG file in 222 bytes). > > Well it's the same with sound (a 5mn track with no sound whatsoever contains less information than "Nun seh' ich wohl, warum so dunkle Flammen"). That's also why the format can't help but be VBR: different pieces of sound contain different amounts of information per second, and therefore have different compression ratio (and compression ratios can --- very rarely --- go above even 1: white noise is completely incompressible, when you add FLAC metadata you end up with a FLAC file bigger than the source WAV)-- Dennis Brunnenmeyer Director of Engineering CEDAR RIDGE SYSTEMS 15019 Rattlesnake Road Grass Valley, CA 95945-8710 Office: 1 (530) 477-9015 Mobile: 1 (530) 320-9025 eMail: dennisb /at/ chronometrics /dot/ com http://www.chronometrics.com/crs/index.html <http://www.chronometrics.com/crs/index.html> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20110523/26a47170/attachment-0001.htm
My question is based on temporal considerations. Given a WAV file converted to FLAC and then decoded to WAV, is it possible for artifacts to be introduced? I've been told that FLAC files, when played back into a high-quality sound system, fail to properly reproduce certain kinds of sounds, like ringing bells or the 'clang' of a triangle. If this were the case, then FLAC would not be lossless in a dynamic sense. As a proponent of FLAC for lossless music storage on a server, this question is important to convincing others that FLAC accurately reproduces the original WAV or PCM file. Dennis... ------------------------------------------------------------------------ On 5/23/2011 10:37 AM, Tyler Eaves wrote:> FLAC is variable bitrate, but the bitrate is determined by how > efficiently the data can be compressed while maintaining 100% data > integrity. > > On Mon, May 23, 2011 at 1:26 PM, Dennis Brunnenmeyer > <dennisb at chronometrics.com> wrote: >> Is FLAC a variable bit rate format when streamed? If so, how can it be truly >> lossless? >> -- >> >> Dennis Brunnenmeyer >> Director of Engineering >> CEDAR RIDGE SYSTEMS >> 15019 Rattlesnake Road >> Grass Valley, CA 95945-8710 >> Office: 1 (530) 477-9015 >> Mobile: 1 (530) 320-9025 >> eMail: dennisb /at/ chronometrics /dot/ com >> http://www.chronometrics.com/crs/index.html >> >> >> _______________________________________________ >> Flac-dev mailing list >> Flac-dev at xiph.org >> http://lists.xiph.org/mailman/listinfo/flac-dev >> >>-- Dennis Brunnenmeyer Director of Engineering CEDAR RIDGE SYSTEMS 15019 Rattlesnake Road Grass Valley, CA 95945-8710 Office: 1 (530) 477-9015 Mobile: 1 (530) 320-9025 eMail: dennisb /at/ chronometrics /dot/ com http://www.chronometrics.com/crs/index.html <http://www.chronometrics.com/crs/index.html> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20110523/ef7ef0ec/attachment.htm
On May 23, 2011, at 10:26, Dennis Brunnenmeyer wrote:> Is FLAC a variable bit rate format when streamed? If so, how can it > be truly lossless?No offense intended, but your logic is backwards. You should be asking: How can a constant bit rate format be truly lossless ... unless it is not compressed at all. Look at it this way: You can either guarantee a low bit rate, and you'll have to lose data to fit ... or you can guarantee that no data is lost, and you'll have to adjust the bit rate up to guarantee that. You can't have both the guarantee of a (low) target constant bit rate and a guarantee that nothing will be lost when you reduce bit rate below uncompressed. Masklinn actually did a great job of explaining why, I just wanted to present a different way of looking at the problem. Brian Willoughby Sound Consulting -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20110523/be9843af/attachment.htm