Fernando Alberto Marengo Rodriguez
2010-Apr-26 23:02 UTC
[Flac-dev] Flac-dev Digest, Vol 67, Issue 3
Dear list, I am currently investigating about the FLAC format and one thing I can't understand is the "WASTED BITS PER SAMPLE" flag. I've seen an explanation saying: "After decoding subframe decoder should bitwise shift all samples to left." Could anyone explain to me what this flag is for? Many thanks in advance. Regards, Fernando -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20100426/a9488af2/attachment.htm
I'm guessing here, but it seems that some encoders might only be able to process samples in 4-bit or 8-bit groups, maybe even 16-bit multiples, so this flag would allow the decoder to remove any padding that might have been necessary on the encoder side. For example, if someone were to encode 12-bit samples, but the encoder was forced to use 16-bit registers for calculations, then perhaps this flag would be needed to show that 4 bits per sample are wasted. You might find more information in the source code. Whatever the reason might be for wasted bits getting into the flac file, it seems clear that this flag is intended to allow any excess bits to be removed. One thing to keep in mind is that FLAC is designed so that the encoder and decoder can be as independent as possible. The algorithm for the encoder can be improved over time, but the format must allow the decoder to work no matter which version of the encoder is used. Ideally, the FLAC format would not change even if the encoder changed, which means that the format must be capable of describing a wide range of data which might never be used. i.e. I wouldn't be surprised if there are no FLAC files with this flag set. Again, most of the above is conjecture. Brian Willoughby Sound Consulting On Apr 26, 2010, at 16:02, Fernando Alberto Marengo Rodriguez wrote:> I am currently investigating about the FLAC format and one > thing I can't understand is the "WASTED BITS PER SAMPLE" flag. > I've seen an explanation saying: > "After decoding subframe decoder should bitwise shift all > samples to left." > > Could anyone explain to me what this flag is for?-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20100426/e4722930/attachment.htm
2010/4/27 Brian Willoughby <brianw at sounds.wa.com>> i.e. I wouldn't be surprised if there are no FLAC files with this flag > set. >If you look for lossyWAV you'll find that it is actually being used -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20100427/12821b2a/attachment.htm