[FFmpeg-soc] [soc]: r1577 - in eac3: eac3.h eac3dec.c

jbr subversion at mplayerhq.hu
Sat Dec 15 00:04:42 CET 2007


Author: jbr
Date: Sat Dec 15 00:04:41 2007
New Revision: 1577

Log:
remove 2 unneeded variables in the decoding context and simplify parsing of
mixing data

Modified:
   eac3/eac3.h
   eac3/eac3dec.c

Modified: eac3/eac3.h
==============================================================================
--- eac3/eac3.h	(original)
+++ eac3/eac3.h	Sat Dec 15 00:04:41 2007
@@ -52,8 +52,6 @@ typedef struct EAC3Context{
     int lfe_on;                      ///< Low frequency effect channel on (lfeon)
     int bitstream_id;                ///< Bit stream identification (bsid)
     float dialog_norm[2];            ///< Dialogue normalization (dialnorm)
-    int mixdef;                      ///< Mix control type
-    int mixdeflen;                   ///< Length of mixing parameter data field
     int paninfo[2];                  ///< Pan information
     int blkmixcfginfo[6];            ///< Block mixing configuration information
 ///@}

Modified: eac3/eac3dec.c
==============================================================================
--- eac3/eac3dec.c	(original)
+++ eac3/eac3dec.c	Sat Dec 15 00:04:41 2007
@@ -448,17 +448,11 @@ static int parse_bsi(GetBitContext *gbc,
             if (get_bits1(gbc)) {
                 skip_bits(gbc, 6);  // skip external program scale factor
             }
-            s->mixdef = get_bits(gbc, 2);
-            if (s->mixdef == 1) {
-                /* mixing option 2 */
-                skip_bits(gbc, 5);
-            } else if (s->mixdef == 2) {
-                /* mixing option 3 */
-                skip_bits(gbc, 12);
-            } else if (s->mixdef == 3) {
-                /* mixing option 4 */
-                s->mixdeflen = get_bits(gbc, 5);
-                skip_bits(gbc, 8*(s->mixdeflen+2));
+            /* skip mixing parameter data */
+            switch(get_bits(gbc, 2)) {
+                case 1: skip_bits(gbc, 5);                     break;
+                case 2: skip_bits(gbc, 12);                    break;
+                case 3: skip_bits(gbc, 8*get_bits(gbc, 5)+16); break;
             }
             if (s->channel_mode < 2) {
                 /* if mono or dual mono source */



More information about the FFmpeg-soc mailing list