diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-04 12:56:56 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-04 13:09:52 +0100 |
commit | 0afc26d330e6eff6221431bb93c69ed6bc6cc737 (patch) | |
tree | cd63be57ddfad0356979ded380c4747d4ff74d88 /libavcodec/aacdec.c | |
parent | adfe89bc48130e08953ea592b8937817f26cd8aa (diff) | |
parent | 82bd8a57692d8f3643ad0903c97e4a0f84393f53 (diff) | |
download | ffmpeg-0afc26d330e6eff6221431bb93c69ed6bc6cc737.tar.gz |
Merge commit '82bd8a57692d8f3643ad0903c97e4a0f84393f53'
* commit '82bd8a57692d8f3643ad0903c97e4a0f84393f53':
aacdec: Refactor decode_ics_info.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/aacdec.c')
-rw-r--r-- | libavcodec/aacdec.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 1c6963429c..e8fa6c939d 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -1230,7 +1230,9 @@ static void decode_ltp(LongTermPrediction *ltp, static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics, GetBitContext *gb) { - int aot = ac->oc[1].m4ac.object_type; + const MPEG4AudioConfig *const m4ac = &ac->oc[1].m4ac; + const int aot = m4ac->object_type; + const int sampling_index = m4ac->sampling_index; if (aot != AOT_ER_AAC_ELD) { if (get_bits1(gb)) { av_log(ac->avctx, AV_LOG_ERROR, "Reserved bit set.\n"); @@ -1263,23 +1265,23 @@ static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics, } } ics->num_windows = 8; - ics->swb_offset = ff_swb_offset_128[ac->oc[1].m4ac.sampling_index]; - ics->num_swb = ff_aac_num_swb_128[ac->oc[1].m4ac.sampling_index]; - ics->tns_max_bands = ff_tns_max_bands_128[ac->oc[1].m4ac.sampling_index]; + ics->swb_offset = ff_swb_offset_128[sampling_index]; + ics->num_swb = ff_aac_num_swb_128[sampling_index]; + ics->tns_max_bands = ff_tns_max_bands_128[sampling_index]; ics->predictor_present = 0; } else { - ics->max_sfb = get_bits(gb, 6); - ics->num_windows = 1; + ics->max_sfb = get_bits(gb, 6); + ics->num_windows = 1; if (aot == AOT_ER_AAC_LD || aot == AOT_ER_AAC_ELD) { - ics->swb_offset = ff_swb_offset_512[ac->oc[1].m4ac.sampling_index]; - ics->num_swb = ff_aac_num_swb_512[ac->oc[1].m4ac.sampling_index]; - ics->tns_max_bands = ff_tns_max_bands_512[ac->oc[1].m4ac.sampling_index]; + ics->swb_offset = ff_swb_offset_512[sampling_index]; + ics->num_swb = ff_aac_num_swb_512[sampling_index]; + ics->tns_max_bands = ff_tns_max_bands_512[sampling_index]; if (!ics->num_swb || !ics->swb_offset) return AVERROR_BUG; } else { - ics->swb_offset = ff_swb_offset_1024[ac->oc[1].m4ac.sampling_index]; - ics->num_swb = ff_aac_num_swb_1024[ac->oc[1].m4ac.sampling_index]; - ics->tns_max_bands = ff_tns_max_bands_1024[ac->oc[1].m4ac.sampling_index]; + ics->swb_offset = ff_swb_offset_1024[sampling_index]; + ics->num_swb = ff_aac_num_swb_1024[sampling_index]; + ics->tns_max_bands = ff_tns_max_bands_1024[sampling_index]; } if (aot != AOT_ER_AAC_ELD) { ics->predictor_present = get_bits1(gb); |