[FFmpeg-cvslog] r18751 - in trunk/libavcodec: ac3dec.c ac3dec.h

jbr subversion
Wed May 6 03:47:34 CEST 2009


Author: jbr
Date: Wed May  6 03:47:34 2009
New Revision: 18751

Log:
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.

Modified:
   trunk/libavcodec/ac3dec.c
   trunk/libavcodec/ac3dec.h

Modified: trunk/libavcodec/ac3dec.c
==============================================================================
--- trunk/libavcodec/ac3dec.c	Wed May  6 01:39:10 2009	(r18750)
+++ trunk/libavcodec/ac3dec.c	Wed May  6 03:47:34 2009	(r18751)
@@ -729,14 +729,13 @@ static void ac3_upmix_delay(AC3DecodeCon
  * @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 @@ static void decode_band_structure(GetBit
     }
 
     /* 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 @@ static int decode_audio_block(AC3DecodeC
             /* 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 @@ static int decode_audio_block(AC3DecodeC
            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 */

Modified: trunk/libavcodec/ac3dec.h
==============================================================================
--- trunk/libavcodec/ac3dec.h	Wed May  6 01:39:10 2009	(r18750)
+++ trunk/libavcodec/ac3dec.h	Wed May  6 03:47:34 2009	(r18751)
@@ -82,7 +82,6 @@ typedef struct {
     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



More information about the ffmpeg-cvslog mailing list