]> git.tue.mpg.de Git - paraslash.git/commitdiff
wma_decode_block(): Reduce indentation level.
authorAndre Noll <maan@systemlinux.org>
Mon, 19 Oct 2009 21:32:38 +0000 (23:32 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 18 Nov 2009 18:34:27 +0000 (19:34 +0100)
wmadec_filter.c

index e39dc7f04bfaf3be53ed2ebc836561653cc4a1a1..70b18b8627c675001c8c85bbb79d7f24a55eff4d 100644 (file)
@@ -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;
                }
        }