[FFmpeg-soc] [soc]: r4355 - in wmapro: wma3.h wma3dec.c

faust3 subversion at mplayerhq.hu
Sun May 31 11:04:15 CEST 2009


Author: faust3
Date: Sun May 31 11:04:15 2009
New Revision: 4355

Log:
removed a few unused variables made read only variables const

Modified:
   wmapro/wma3.h
   wmapro/wma3dec.c

Modified: wmapro/wma3.h
==============================================================================
--- wmapro/wma3.h	Sun May 31 10:36:44 2009	(r4354)
+++ wmapro/wma3.h	Sun May 31 11:04:15 2009	(r4355)
@@ -113,7 +113,6 @@ typedef struct WMA3DecodeContext {
     int8_t           num_channels;                  ///< number of channels
     int8_t           lfe_channel;                   ///< lfe channel index
     const float**    def_decorrelation_mat;         ///< default decorrelation matrix
-    uint8_t          allow_subframes;               ///< frames may contain subframes
     uint8_t          max_num_subframes;             ///< maximum number of subframes
     int8_t           num_possible_block_sizes;      ///< nb of supported block sizes
     uint16_t         min_samples_per_subframe;      ///< minimum samples per subframe
@@ -127,8 +126,6 @@ typedef struct WMA3DecodeContext {
     int              num_saved_bits;                ///< saved number of bits
     int              frame_offset;                  ///< frame offset in the bit reservoir
     int              subframe_offset;               ///< subframe offset in the bit reservoir
-    uint8_t          bit5;                          ///< padding bit? (CBR files)
-    uint8_t          bit6;                          ///< unknown
     uint8_t          packet_loss;                   ///< set in case of bitstream error
 
     /** frame decode state */

Modified: wmapro/wma3dec.c
==============================================================================
--- wmapro/wma3dec.c	Sun May 31 10:36:44 2009	(r4354)
+++ wmapro/wma3dec.c	Sun May 31 11:04:15 2009	(r4355)
@@ -228,7 +228,6 @@ static av_cold int wma_decode_init(AVCod
     /** subframe info */
     s->max_num_subframes = 1 << ((s->decode_flags & 0x38) >> 3);
     s->num_possible_block_sizes = av_log2(s->max_num_subframes) + 1;
-    s->allow_subframes = s->max_num_subframes > 1;
     s->min_samples_per_subframe = s->samples_per_frame / s->max_num_subframes;
     s->dynamic_range_compression = (s->decode_flags & 0x80) >> 7;
 
@@ -838,7 +837,7 @@ static int wma_decode_coeffs(WMA3DecodeC
 
     /** decode run level coded coefficients */
     if(rl_mode){
-        unsigned int coeff_mask = s->subframe_len - 1;
+        const unsigned int coeff_mask = s->subframe_len - 1;
         while(cur_coeff < s->subframe_len){
             unsigned int idx;
             int sign;
@@ -1204,7 +1203,6 @@ static int wma_decode_subframe(WMA3Decod
     if(transmit_coeffs){
         int quant;
         int sign = 1;
-        int large_quant = 0;
         if((get_bits1(&s->gb))){ /** FIXME: might change run level mode decision */
             av_log(s->avctx,AV_LOG_ERROR,"unsupported quant step coding\n");
             return 0;
@@ -1216,9 +1214,8 @@ static int wma_decode_subframe(WMA3Decod
             sign = -1;
         }
         s->quant_step += quant;
-        if(quant <= -32 || quant > 30)
-            large_quant = 1;
-        while(large_quant && (get_bits_count(&s->gb) + 5 < s->num_saved_bits)){
+        if(quant <= -32 || quant > 30){
+        while(get_bits_count(&s->gb) + 5 < s->num_saved_bits){
             quant = get_bits(&s->gb,5);
             if(quant != 31){
                 s->quant_step += quant * sign;
@@ -1229,6 +1226,7 @@ static int wma_decode_subframe(WMA3Decod
                 av_log(s->avctx,AV_LOG_DEBUG,"negative quant step\n");
             }
         }
+        }
 
         /** decode quantization step modifiers for every channel */
 
@@ -1546,8 +1544,7 @@ static int wma_decode_packet(AVCodecCont
     /** parse packet header */
     init_get_bits(&gb, buf, s->buf_bit_size);
     packet_sequence_number    = get_bits(&gb, 4);
-    s->bit5                   = get_bits1(&gb);
-    s->bit6                   = get_bits1(&gb);
+    skip_bits(&gb, 2);
 
     /** get number of bits that need to be added to the previous frame */
     num_bits_prev_frame = get_bits(&gb, s->log2_frame_size);


More information about the FFmpeg-soc mailing list