Commit 396b73c7 authored by Justin Ruggles's avatar Justin Ruggles

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.

Originally committed as revision 18751 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 52dc3fc8
...@@ -729,14 +729,13 @@ static void ac3_upmix_delay(AC3DecodeContext *s) ...@@ -729,14 +729,13 @@ static void ac3_upmix_delay(AC3DecodeContext *s)
* @param[in] end_subband subband number for end of range * @param[in] end_subband subband number for end of range
* @param[in] default_band_struct default band structure table * @param[in] default_band_struct default band structure table
* @param[out] band_struct decoded band structure * @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] num_bands number of bands (optionally NULL)
* @param[out] band_sizes array containing the number of bins in each band (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, static void decode_band_structure(GetBitContext *gbc, int blk, int eac3,
int ecpl, int start_subband, int end_subband, int ecpl, int start_subband, int end_subband,
const uint8_t *default_band_struct, 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 *num_bands, uint8_t *band_sizes)
{ {
int subbnd, bnd, n_subbands, n_bands=0; int subbnd, bnd, n_subbands, n_bands=0;
...@@ -774,8 +773,6 @@ static void decode_band_structure(GetBitContext *gbc, int blk, int eac3, ...@@ -774,8 +773,6 @@ static void decode_band_structure(GetBitContext *gbc, int blk, int eac3,
} }
/* set optional output params */ /* set optional output params */
if (num_subbands)
*num_subbands = n_subbands;
if (num_bands) if (num_bands)
*num_bands = n_bands; *num_bands = n_bands;
if (band_sizes) if (band_sizes)
...@@ -875,8 +872,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk) ...@@ -875,8 +872,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
/* TODO: modify coupling end freq if spectral extension is used */ /* TODO: modify coupling end freq if spectral extension is used */
cpl_start_subband = get_bits(gbc, 4); cpl_start_subband = get_bits(gbc, 4);
cpl_end_subband = get_bits(gbc, 4) + 3; cpl_end_subband = get_bits(gbc, 4) + 3;
s->num_cpl_subbands = cpl_end_subband - cpl_start_subband; if (cpl_start_subband > cpl_end_subband) {
if (s->num_cpl_subbands < 0) {
av_log(s->avctx, AV_LOG_ERROR, "invalid coupling range (%d > %d)\n", av_log(s->avctx, AV_LOG_ERROR, "invalid coupling range (%d > %d)\n",
cpl_start_subband, cpl_end_subband); cpl_start_subband, cpl_end_subband);
return -1; return -1;
...@@ -887,7 +883,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk) ...@@ -887,7 +883,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
decode_band_structure(gbc, blk, s->eac3, 0, decode_band_structure(gbc, blk, s->eac3, 0,
cpl_start_subband, cpl_end_subband, cpl_start_subband, cpl_end_subband,
ff_eac3_default_cpl_band_struct, ff_eac3_default_cpl_band_struct,
s->cpl_band_struct, &s->num_cpl_subbands, s->cpl_band_struct,
&s->num_cpl_bands, NULL); &s->num_cpl_bands, NULL);
} else { } else {
/* coupling not in use */ /* coupling not in use */
......
...@@ -82,7 +82,6 @@ typedef struct { ...@@ -82,7 +82,6 @@ typedef struct {
int channel_in_cpl[AC3_MAX_CHANNELS]; ///< channel in coupling (chincpl) int channel_in_cpl[AC3_MAX_CHANNELS]; ///< channel in coupling (chincpl)
int phase_flags_in_use; ///< phase flags in use (phsflginu) int phase_flags_in_use; ///< phase flags in use (phsflginu)
int phase_flags[18]; ///< phase flags (phsflg) 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) int num_cpl_bands; ///< number of coupling bands (ncplbnd)
uint8_t cpl_band_struct[18]; ///< coupling band structure (cplbndstrc) uint8_t cpl_band_struct[18]; ///< coupling band structure (cplbndstrc)
int firstchincpl; ///< first channel in coupling int firstchincpl; ///< first channel in coupling
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment