changeset 9607:6d3d3df92a4e libavcodec

ac3dec: Remove unneeded context variable, num_cpl_subbands. It is also not needed for spectral extension or enhanced coupling since it is redundant information, so I am removing it from decode_band_structure() as well.
author jbr
date Wed, 06 May 2009 01:47:34 +0000
parents 31090f08314e
children f3c6d57a50aa
files ac3dec.c ac3dec.h
diffstat 2 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ac3dec.c	Tue May 05 23:39:10 2009 +0000
+++ b/ac3dec.c	Wed May 06 01:47:34 2009 +0000
@@ -729,14 +729,13 @@
  * @param[in] end_subband subband number for end of range
  * @param[in] default_band_struct default band structure table
  * @param[out] band_struct decoded band structure
- * @param[out] num_subbands number of subbands (optionally NULL)
  * @param[out] num_bands number of bands (optionally NULL)
  * @param[out] band_sizes array containing the number of bins in each band (optionally NULL)
  */
 static void decode_band_structure(GetBitContext *gbc, int blk, int eac3,
                                   int ecpl, int start_subband, int end_subband,
                                   const uint8_t *default_band_struct,
-                                  uint8_t *band_struct, int *num_subbands,
+                                  uint8_t *band_struct,
                                   int *num_bands, uint8_t *band_sizes)
 {
     int subbnd, bnd, n_subbands, n_bands=0;
@@ -774,8 +773,6 @@
     }
 
     /* set optional output params */
-    if (num_subbands)
-        *num_subbands = n_subbands;
     if (num_bands)
         *num_bands = n_bands;
     if (band_sizes)
@@ -875,8 +872,7 @@
             /* TODO: modify coupling end freq if spectral extension is used */
             cpl_start_subband = get_bits(gbc, 4);
             cpl_end_subband   = get_bits(gbc, 4) + 3;
-            s->num_cpl_subbands = cpl_end_subband - cpl_start_subband;
-            if (s->num_cpl_subbands < 0) {
+            if (cpl_start_subband > cpl_end_subband) {
                 av_log(s->avctx, AV_LOG_ERROR, "invalid coupling range (%d > %d)\n",
                        cpl_start_subband, cpl_end_subband);
                 return -1;
@@ -887,7 +883,7 @@
            decode_band_structure(gbc, blk, s->eac3, 0,
                                  cpl_start_subband, cpl_end_subband,
                                  ff_eac3_default_cpl_band_struct,
-                                 s->cpl_band_struct, &s->num_cpl_subbands,
+                                 s->cpl_band_struct,
                                  &s->num_cpl_bands, NULL);
         } else {
             /* coupling not in use */
--- a/ac3dec.h	Tue May 05 23:39:10 2009 +0000
+++ b/ac3dec.h	Wed May 06 01:47:34 2009 +0000
@@ -82,7 +82,6 @@
     int channel_in_cpl[AC3_MAX_CHANNELS];   ///< channel in coupling                    (chincpl)
     int phase_flags_in_use;                 ///< phase flags in use                     (phsflginu)
     int phase_flags[18];                    ///< phase flags                            (phsflg)
-    int num_cpl_subbands;                   ///< number of coupling sub bands           (ncplsubnd)
     int num_cpl_bands;                      ///< number of coupling bands               (ncplbnd)
     uint8_t cpl_band_struct[18];            ///< coupling band structure                (cplbndstrc)
     int firstchincpl;                       ///< first channel in coupling