From: Andre Noll Date: Mon, 19 Oct 2009 21:32:38 +0000 (+0200) Subject: wma_decode_block(): Reduce indentation level. X-Git-Tag: v0.4.1~45 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=c23eb9580325d575af15047108b66e7560093203;p=paraslash.git wma_decode_block(): Reduce indentation level. --- diff --git a/wmadec_filter.c b/wmadec_filter.c index e39dc7f0..70b18b86 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -822,49 +822,51 @@ static int wma_decode_block(struct private_wmadec_data *pwd) /* parse spectral coefficients : just RLE encoding */ for (ch = 0; ch < pwd->ahi.channels; ch++) { - if (pwd->channel_coded[ch]) { - struct vlc *coef_vlc; - int level, run, sign, tindex; - int16_t *ptr, *eptr; - const uint16_t *level_table, *run_table; - - /* special VLC tables are used for ms stereo because - there is potentially less energy there */ - tindex = (ch == 1 && pwd->ms_stereo); - coef_vlc = &pwd->coef_vlc[tindex]; - run_table = pwd->run_table[tindex]; - level_table = pwd->level_table[tindex]; - /* XXX: optimize */ - ptr = &pwd->coefs1[ch][0]; - eptr = ptr + nb_coefs[ch]; - memset(ptr, 0, pwd->block_len * sizeof(int16_t)); - for (;;) { - code = get_vlc(&pwd->gb, coef_vlc->table, - VLCBITS, VLCMAX); - if (code < 0) - return -1; - if (code == 1) /* EOB */ - break; - if (code == 0) { /* escape */ - level = get_bits(&pwd->gb, coef_nb_bits); - /* reading block_len_bits would be better */ - run = get_bits(&pwd->gb, pwd->frame_len_bits); - } else { /* normal code */ - run = run_table[code]; - level = level_table[code]; - } - sign = get_bit(&pwd->gb); - if (!sign) - level = -level; - ptr += run; - if (ptr >= eptr) { - PARA_ERROR_LOG("overflow in spectral RLE, ignoring\n"); - break; - } - *ptr++ = level; - if (ptr >= eptr) /* EOB can be omitted */ - break; + struct vlc *coef_vlc; + int level, run, sign, tindex; + int16_t *ptr, *eptr; + const uint16_t *level_table, *run_table; + + if (!pwd->channel_coded[ch]) + continue; + /* + * special VLC tables are used for ms stereo because there is + * potentially less energy there + */ + tindex = (ch == 1 && pwd->ms_stereo); + coef_vlc = &pwd->coef_vlc[tindex]; + run_table = pwd->run_table[tindex]; + level_table = pwd->level_table[tindex]; + /* XXX: optimize */ + ptr = &pwd->coefs1[ch][0]; + eptr = ptr + nb_coefs[ch]; + memset(ptr, 0, pwd->block_len * sizeof(int16_t)); + for (;;) { + code = get_vlc(&pwd->gb, coef_vlc->table, + VLCBITS, VLCMAX); + if (code < 0) + return -1; + if (code == 1) /* EOB */ + break; + if (code == 0) { /* escape */ + level = get_bits(&pwd->gb, coef_nb_bits); + /* reading block_len_bits would be better */ + run = get_bits(&pwd->gb, pwd->frame_len_bits); + } else { /* normal code */ + run = run_table[code]; + level = level_table[code]; + } + sign = get_bit(&pwd->gb); + if (!sign) + level = -level; + ptr += run; + if (ptr >= eptr) { + PARA_ERROR_LOG("overflow in spectral RLE, ignoring\n"); + break; } + *ptr++ = level; + if (ptr >= eptr) /* EOB can be omitted */ + break; } }