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

faust3 subversion at mplayerhq.hu
Sat Jun 14 18:15:12 CEST 2008


Author: faust3
Date: Sat Jun 14 18:15:12 2008
New Revision: 2436

Log:
decode number of subframes from the extradata

Modified:
   wmapro/wma3dec.c

Modified: wmapro/wma3dec.c
==============================================================================
--- wmapro/wma3dec.c	(original)
+++ wmapro/wma3dec.c	Sat Jun 14 18:15:12 2008
@@ -20,6 +20,11 @@
 #include "avcodec.h"
 #include "bitstream.h"
 
+
+/* TODO
+   shrink types
+*/
+
 typedef struct WMA3DecodeContext {
     AVCodecContext*     avctx;
     GetBitContext       gb;
@@ -44,7 +49,9 @@ typedef struct WMA3DecodeContext {
     // Packet loss variables
     unsigned int        packet_loss;
 
-
+    // General frame info
+    int                 allow_subframes;
+    int                 max_num_subframes;
 
     // Buffered frame data
     int                 prev_frame_bit_size;
@@ -63,6 +70,7 @@ static void dump_context(WMA3DecodeConte
     PRINT_HEX("ed decode flags",s->decode_flags);
     PRINT("samples per frame",s->samples_per_frame);
     PRINT("log2 frame size",s->log2_frame_size);
+    PRINT("max num subframes",s->max_num_subframes);
 }
 
 
@@ -107,6 +115,7 @@ static av_cold int wma3_decode_init(AVCo
     WMA3DecodeContext *s = avctx->priv_data;
     uint8_t *edata_ptr = avctx->extradata;
     int i;
+    int log2_max_num_subframes;
 
     s->avctx = avctx;
 
@@ -133,6 +142,11 @@ static av_cold int wma3_decode_init(AVCo
     s->log2_block_align_bits = av_log2(avctx->block_align*8);
     s->log2_frame_size = s->log2_block_align_bits + 1;
 
+    /* subframe info */
+    log2_max_num_subframes = (s->decode_flags & 0x38) >> 3;
+    s->max_num_subframes = 1 << log2_max_num_subframes;
+    s->allow_subframes = s->max_num_subframes > 1;
+
     dump_context(s);
 
     return 0;



More information about the FFmpeg-soc mailing list