[FFmpeg-soc] [soc]: r2286 - in eac3: ac3dec.c ac3dec.h eac3dec.c
jbr
subversion at mplayerhq.hu
Sat May 31 18:32:39 CEST 2008
Author: jbr
Date: Sat May 31 18:32:39 2008
New Revision: 2286
Log:
remove redundant variable, hebap, from decode context
Modified:
eac3/ac3dec.c
eac3/ac3dec.h
eac3/eac3dec.c
Modified: eac3/ac3dec.c
==============================================================================
--- eac3/ac3dec.c (original)
+++ eac3/ac3dec.c Sat May 31 18:32:39 2008
@@ -509,7 +509,7 @@ static void remove_dithering(AC3DecodeCo
for(ch=1; ch<=s->fbw_channels; ch++) {
if(!s->dither_flag[ch]) {
coeffs = s->fixed_coeffs[ch];
- bap = s->channel_uses_aht[ch] ? s->hebap[ch] : s->bap[ch];
+ bap = s->bap[ch];
if(s->channel_in_cpl[ch])
end = s->start_freq[CPL_CH];
else
@@ -519,7 +519,7 @@ static void remove_dithering(AC3DecodeCo
coeffs[i] = 0;
}
if(s->channel_in_cpl[ch]) {
- bap = s->channel_uses_aht[CPL_CH] ? s->hebap[CPL_CH] : s->bap[CPL_CH];
+ bap = s->bap[CPL_CH];
for(; i<s->end_freq[CPL_CH]; i++) {
if(!bap[i])
coeffs[i] = 0;
@@ -1117,17 +1117,16 @@ static int decode_audio_block(AC3DecodeC
}
if(bit_alloc_stages[ch] > 0) {
/* Compute bit allocation */
+ const uint8_t *bap_tab;
if (!s->eac3 || s->channel_uses_aht[ch] == 0)
+ bap_tab = ff_ac3_bap_tab;
+ else
+ bap_tab = ff_eac3_hebap_tab;
ff_ac3_bit_alloc_calc_bap(s->mask[ch], s->psd[ch],
s->start_freq[ch], s->end_freq[ch],
s->snr_offset[ch],
s->bit_alloc_params.floor,
- ff_ac3_bap_tab, s->bap[ch]);
- else
- ff_ac3_bit_alloc_calc_bap(s->mask[ch], s->psd[ch],
- s->start_freq[ch], s->end_freq[ch], s->snr_offset[ch],
- s->bit_alloc_params.floor, ff_eac3_hebap_tab,
- s->hebap[ch]);
+ bap_tab, s->bap[ch]);
}
}
Modified: eac3/ac3dec.h
==============================================================================
--- eac3/ac3dec.h (original)
+++ eac3/ac3dec.h Sat May 31 18:32:39 2008
@@ -176,7 +176,6 @@ typedef struct AC3DecodeContext {
int snr_offset[AC3_MAX_CHANNELS]; ///< SNR offset (snroffst)
int fast_gain[AC3_MAX_CHANNELS]; ///< Channel fast gain (fgain)
uint8_t bap[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< bit allocation pointers
- uint8_t hebap[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< high-efficiency bit allocation pointers for AHT
int16_t psd[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< scaled exponents
int16_t band_psd[AC3_MAX_CHANNELS][50]; ///< interpolated exponents (bndpsd)
int16_t mask[AC3_MAX_CHANNELS][50]; ///< masking values
Modified: eac3/eac3dec.c
==============================================================================
--- eac3/eac3dec.c (original)
+++ eac3/eac3dec.c Sat May 31 18:32:39 2008
@@ -183,7 +183,7 @@ void ff_eac3_get_transform_coeffs_aht_ch
/* read 1-bit GAQ gain codes */
gs = 0;
for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
- if (s->hebap[ch][bin] > 7 && s->hebap[ch][bin] < end_bap)
+ if (s->bap[ch][bin] > 7 && s->bap[ch][bin] < end_bap)
gaq_gain[gs++] = get_bits1(gbc) << (gaq_mode-1);
}
} else if (gaq_mode == EAC3_GAQ_124) {
@@ -191,7 +191,7 @@ void ff_eac3_get_transform_coeffs_aht_ch
int gc = 2;
gs = 0;
for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
- if (s->hebap[ch][bin] > 7 && s->hebap[ch][bin] < end_bap) {
+ if (s->bap[ch][bin] > 7 && s->bap[ch][bin] < end_bap) {
if(gc++ == 2) {
int group_gain = get_bits(gbc, 5);
gaq_gain[gs++] = gaq_ungroup_tab[group_gain][0];
@@ -205,7 +205,7 @@ void ff_eac3_get_transform_coeffs_aht_ch
gs=0;
for (bin = s->start_freq[ch]; bin < s->end_freq[ch]; bin++) {
- int hebap = s->hebap[ch][bin];
+ int hebap = s->bap[ch][bin];
int bits = ff_eac3_bits_vs_hebap[hebap];
if (!hebap) {
/* hebap=0 */
More information about the FFmpeg-soc
mailing list