<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Dear list,<br><br>i'm doing a bit of analisys on flac's source code and i've run into something i can't quite grasp.<br><br>flac version 1.2.1<br><br>flaclib C<br><br>stream_encoder.c<br><br>function "process_subframes_"<br><br>line 2999<br><br>++++++++++++++++++++++<br> if(do_mid_side) {<br> FLAC__ASSERT(encoder->protected_->channels == 2);<br> for(channel = 0; channel < 2; channel++) {<br> const unsigned w = get_wasted_bits_(encoder->private_->integer_signal_mid_side[channel], encoder->protected_->blocksize);<br> encoder->private_->subframe_workspace_mid_side[channel][0].wasted_bits = encoder->private_->subframe_workspace_mid_side[channel][1].wasted_bits = w;<br> encoder->private_->subframe_bps_mid_side[channel] = encoder->protected_->bits_per_sample - w + (channel==0? 0:1);<br> }<br> }<br>++++++++++++++++++++++++<br><br>In that piece of code the encoder determines how many wasted bits there are in each channel (mid-side) and calculates effective BPS for each of them. What i don't understand is why it should add one bit to the BPS of the side channel "(channel==0? 0:1)", eventhough there is no "correction" to wasted bits. Could someone shed light on this?<br>Thank you very much in advance!<br>                                            </div></body>
</html>