<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>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.</div><div><br></div><div>You might find more information in the source code.</div><div><br></div><div>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.</div><div><br></div><div>Again, most of the above is conjecture.</div><div><br></div><div>Brian Willoughby</div><div>Sound Consulting</div><div><br></div><br><div><div>On Apr 26, 2010, at 16:02, Fernando Alberto Marengo Rodriguez wrote:<br><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit;"><pre><blockquote type="cite">I am currently investigating about the FLAC format and one <br>thing I can't understand is the "WASTED BITS PER SAMPLE" flag. <br>I've seen an explanation saying:<br>"After decoding subframe decoder should bitwise shift all <br>samples to left."<br><br>Could anyone explain to me what this flag is for?<font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="white-space: pre;"><br></span></font></span></font></blockquote></pre></td></tr></tbody></table></div></div></body></html>