[FFmpeg-soc] [soc]: r4524 - wmapro/wma3dec.c

faust3 subversion at mplayerhq.hu
Wed Jun 24 20:55:25 CEST 2009


Author: faust3
Date: Wed Jun 24 20:55:25 2009
New Revision: 4524

Log:
simplify vector decoding

Modified:
   wmapro/wma3dec.c

Modified: wmapro/wma3dec.c
==============================================================================
--- wmapro/wma3dec.c	Wed Jun 24 20:09:12 2009	(r4523)
+++ wmapro/wma3dec.c	Wed Jun 24 20:55:25 2009	(r4524)
@@ -822,8 +822,6 @@ static int decode_coeffs(WMA3DecodeConte
     int num_zeros = 0;
     const uint16_t* run;
     const uint16_t* level;
-    int zero_init = 0;
-    int rl_switchmask = (s->subframe_len>>8);
 
     dprintf(s->avctx, "decode coefficients for channel %i\n",c);
 
@@ -838,13 +836,6 @@ static int decode_coeffs(WMA3DecodeConte
         level = coef0_level;
     }
 
-    /** for subframe_len 128 the first zero coefficient will switch to
-        the run level mode */
-    if (s->subframe_len == 128) {
-        zero_init = num_zeros = 1;
-        rl_switchmask = 1;
-    }
-
     /** decode vector coefficients (consumes up to 167 bits per iteration for
       4 vector coded large values) */
     while (!rl_mode && cur_coeff + 3 < s->subframe_len) {
@@ -881,12 +872,11 @@ static int decode_coeffs(WMA3DecodeConte
             if (vals[i]) {
                 int sign = get_bits1(&s->gb) - 1;
                 ci->coeffs[cur_coeff] = (vals[i]^sign) - sign;
-                num_zeros = zero_init;
+                num_zeros = 0;
             } else {
                 /** switch to run level mode when subframe_len / 128 zeros
                    were found in a row */
-                rl_mode |= (num_zeros & rl_switchmask);
-                ++num_zeros;
+                rl_mode |= (++num_zeros > s->subframe_len>>8);
             }
             ++cur_coeff;
         }


More information about the FFmpeg-soc mailing list