{
unsigned channel;
unsigned i;
- FLAC__int32 mid, side, left, right;
+ FLAC__int32 mid, side;
unsigned frame_crc; /* the one we calculate from the input stream */
FLAC__uint32 x;
case FLAC__CHANNEL_ASSIGNMENT_MID_SIDE:
FLAC__ASSERT(decoder->private_->frame.header.channels == 2);
for(i = 0; i < decoder->private_->frame.header.blocksize; i++) {
+#if 1
mid = decoder->private_->output[0][i];
side = decoder->private_->output[1][i];
mid <<= 1;
- if(side & 1) /* i.e. if 'side' is odd... */
- mid++;
- left = mid + side;
- right = mid - side;
- decoder->private_->output[0][i] = left >> 1;
- decoder->private_->output[1][i] = right >> 1;
+ mid |= (side & 1); /* i.e. if 'side' is odd... */
+ decoder->private_->output[0][i] = (mid + side) >> 1;
+ decoder->private_->output[1][i] = (mid - side) >> 1;
+#else
+ //@@@@@@ OPT: try without 'side' temp variable
+ mid = (decoder->private_->output[0][i] << 1) | (decoder->private_->output[1][i] & 1); /* i.e. if 'side' is odd... */
+ decoder->private_->output[0][i] = (mid + decoder->private_->output[1][i]) >> 1;
+ decoder->private_->output[1][i] = (mid - decoder->private_->output[1][i]) >> 1;
+#endif
}
break;
default: