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

bwolowiec subversion at mplayerhq.hu
Mon Aug 20 11:56:53 CEST 2007


Author: bwolowiec
Date: Mon Aug 20 11:56:53 2007
New Revision: 1044

Log:
remove redundant variables


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

Modified: eac3/ac3tab.c
==============================================================================
--- eac3/ac3tab.c	(original)
+++ eac3/ac3tab.c	Mon Aug 20 11:56:53 2007
@@ -1354,6 +1354,14 @@ const uint8_t ff_eac3_defspxbndstrc[17] 
 { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
 
 /**
+ * Table E2.17 Default Enhanced Coupling Banding Structure
+ */
+
+const uint8_t ff_eac3_defecplbndstrc[22] =
+{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1};
+
+
+/**
  * Table E3.14 Spectral Extension Attenuation Table
  */
 const float ff_eac3_spxattentab[32][3] = {

Modified: eac3/ac3tab.h
==============================================================================
--- eac3/ac3tab.h	(original)
+++ eac3/ac3tab.h	Mon Aug 20 11:56:53 2007
@@ -58,6 +58,7 @@ extern const int16_t (*ff_vq_hebap[8])[6
 extern const uint8_t ff_eac3_frm_expstr[32][6];
 extern const uint8_t ff_eac3_defcplbndstrc[18];
 extern const uint8_t ff_eac3_defspxbndstrc[17];
+extern const uint8_t ff_eac3_defecplbndstrc[22];
 extern const float   ff_eac3_spxattentab[32][3];
 
 extern const uint8_t ff_ac3_rematrix_band_tbl[5];

Modified: eac3/eac3.h
==============================================================================
--- eac3/eac3.h	(original)
+++ eac3/eac3.h	Mon Aug 20 11:56:53 2007
@@ -60,7 +60,6 @@ typedef struct EAC3Context{
     int lfeon;                       ///< Low frequency effect channel on
     int bsid;                        ///< Bit stream identification
     float dialnorm[2];               ///< Dialogue normalization
-    int compr[2];                    ///< Compression gain word
     int chanmap;                     ///< Custom channel map
     int mixmdate;                    ///< Mixing meta-data exists
     int dmixmod;                     ///< Preferred stereo downmix mode
@@ -78,8 +77,6 @@ typedef struct EAC3Context{
     int frmmixcfginfoe;              ///< Frame mixing configuration information exists
     int blkmixcfginfo[6];            ///< Block mixing configuration information
     int infomdate;                   ///< Informational meta-data exists
-    int bsmod;                       ///< Bit stream mode
-    int sourcefscod;                 ///< Source sample rate code
 ///@}
 ///@name Audio Frame
 ///@{
@@ -118,7 +115,6 @@ typedef struct EAC3Context{
     int spxstrtf;                    ///< Spectral extension start copy frequency code
     int spxbegf;                     ///< Spectral extension begin frequency code
     int spxendf;                     ///< Spectral extension end frequency code
-    int spxbndstrce;                 ///< Spectral extension band structure exists
     int spxbndstrc[MAX_SPX_CODES];   ///< Spectral extension band structure
     int spxcoe[AC3_MAX_CHANNELS];    ///< Spectral extension coordinates exists
     int spxblnd[AC3_MAX_CHANNELS];   ///< Spectral extension blend
@@ -127,11 +123,9 @@ typedef struct EAC3Context{
     int phsflginu;                   ///< Phase flag in use
     int cplbegf;                     ///< Coupling begin frequency code
     int cplendf;                     ///< Coupling end frequency code
-    int cplbndstrce;                 ///< Coupling band structure exists
     int cplbndstrc[19];              ///< Coupling band structure
     int ecplbegf;                    ///< Enhanced coupling begin frequency code
     int ecplendf;                    ///< Enhanced coupling end frequency code
-    int ecplbndstrce;                ///< Enhanced coupling band structure exists
     int ecplbndstrc[23];             ///< Enhanced coupling band structure
     int cplcoe[AC3_MAX_CHANNELS];    ///< Coupling coordinates exists
     int phsflg[18];                  ///< Phase flag

Modified: eac3/eac3dec.c
==============================================================================
--- eac3/eac3dec.c	(original)
+++ eac3/eac3dec.c	Mon Aug 20 11:56:53 2007
@@ -80,11 +80,8 @@ static int parse_bsi(GetBitContext *gbc,
     for(i = 0; i < (s->acmod?1:2); i++){
         s->dialnorm[i] = ff_ac3_dialnorm_tbl[get_bits(gbc, 5)];
         if(get_bits1(gbc)){
-            GET_BITS(s->compr[i], gbc, 8);
-        }else{
-            //TODO default compr
+            skip_bits(gbc, 8); //skip Compression gain word
         }
-    }
     if(s->strmtyp == 0x1){
         /* if dependent stream */
         if(get_bits1(gbc)){
@@ -170,7 +167,7 @@ static int parse_bsi(GetBitContext *gbc,
     GET_BITS(s->infomdate, gbc, 1);
     if(s->infomdate){
         /* Informational metadata */
-        GET_BITS(s->bsmod, gbc, 3);
+        skip_bits(gbc, 3); //skip Bit stream mode
         skip_bits(gbc, 2); //skip copyright bit and original bitstream bit
         if(s->acmod == AC3_ACMOD_STEREO) /* if in 2/0 mode */{
             skip_bits(gbc, 4); //skip Dolby surround and headphone mode
@@ -186,7 +183,7 @@ static int parse_bsi(GetBitContext *gbc,
         }
         if(s->fscod < 0x3){
             /* if not half sample rate */
-            GET_BITS(s->sourcefscod, gbc, 1); // TODO
+            skip_bits1(gbc); //skip Source sample rate code
         }
     }
     if((s->strmtyp == 0x0) && (s->numblkscod != 0x3) ){
@@ -447,10 +444,7 @@ static int parse_audblk(GetBitContext *g
                 if(s->chinspx[ch])
                     s->endmant[ch] = 25 + 12 * s->spxbegf;
             }
-
-            GET_BITS(s->spxbndstrce, gbc, 1);
-
-            if(s->spxbndstrce){
+            if(get_bits1(gbc)){
                 for(bnd = s->spxbegf+1; bnd < s->spxendf; bnd++){
                     GET_BITS(s->spxbndstrc[bnd], gbc, 1);
                 }
@@ -557,9 +551,7 @@ static int parse_audblk(GetBitContext *g
                     if(s->chincpl[ch])
                         s->endmant[ch] = s->strtmant[CPL_CH];
                 }
-
-                GET_BITS(s->cplbndstrce, gbc, 1);
-                if(s->cplbndstrce){
+                if(get_bits1(gbc)){
                     for(bnd = s->cplbegf+1; bnd < s->cplendf; bnd++){
                         GET_BITS(s->cplbndstrc[bnd], gbc, 1);
                     }
@@ -597,12 +589,16 @@ static int parse_audblk(GetBitContext *g
                         s->ecpl_end_subbnd = s->spxbegf * 2;
                     }
                 }
-                GET_BITS(s->ecplbndstrce, gbc, 1);
-                if (s->ecplbndstrce){
+                if (get_bits1(gbc)){
                     for(sbnd = FFMAX(9, s->ecpl_start_subbnd+1);
                             sbnd < s->ecpl_end_subbnd; sbnd++){
                         GET_BITS(s->ecplbndstrc[sbnd], gbc, 1);
                     }
+                }else{
+                    if(!blk){
+                        for(sbnd = 0; sbnd < 22; sbnd++)
+                            s->ecplbndstrc[sbnd] = ff_eac3_defecplbndstrc[sbnd]
+                    }
                 }
                 //necplbnd = ecpl_end_subbnd - ecpl_start_subbnd;
                 //necplbnd -= ecplbndstrc[ecpl_start_subbnd] + ... + ecplbndstrc[ecpl_end_subbnd -1]



More information about the FFmpeg-soc mailing list