s->cur_chan = 0;
while (s->cur_chan < s->channels) {
- int cmd;
+ unsigned int cmd;
int len;
if (get_bits_left(&s->gb) < 3+FNSIZE) {
/* get Rice code for residual decoding */
if (cmd != FN_ZERO) {
residual_size = get_ur_golomb_shorten(&s->gb, ENERGYSIZE);
- /* this is a hack as version 0 differed in defintion of get_sr_golomb_shorten */
+ /* this is a hack as version 0 differed in definition of get_sr_golomb_shorten */
if (s->version == 0)
residual_size--;
}
sum += s->offset[channel][i];
coffset = sum / s->nmean;
if (s->version >= 2)
- coffset >>= FFMIN(1, s->bitshift);
+ coffset = s->bitshift == 0 ? coffset : coffset >> s->bitshift - 1 >> 1;
}
/* decode samples for this channel */