diff options
author | Alex Converse <alex.converse@gmail.com> | 2017-02-09 08:28:30 -0800 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2017-02-13 09:31:13 -0800 |
commit | 3bb24fc344f0e8448b3c6826193e8ee43f7d984d (patch) | |
tree | 041b4bb3765ff08cd19bb360478362cc2772a023 | |
parent | 20ea8bf9390b3a68e43bbe666154aa8b5150cad3 (diff) | |
download | ffmpeg-3bb24fc344f0e8448b3c6826193e8ee43f7d984d.tar.gz |
aacsbr: Associate SBR data with AAC elements on init
Quiets some log spam on pure upsampling mode.
Fixes ticket 5163.
-rw-r--r-- | libavcodec/aacdec_template.c | 2 | ||||
-rw-r--r-- | libavcodec/aacsbr.h | 2 | ||||
-rw-r--r-- | libavcodec/aacsbr_template.c | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index e230c87733..d980ae0e22 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -134,7 +134,7 @@ static av_cold int che_configure(AACContext *ac, if (!ac->che[type][id]) { if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement)))) return AVERROR(ENOMEM); - AAC_RENAME(ff_aac_sbr_ctx_init)(ac, &ac->che[type][id]->sbr); + AAC_RENAME(ff_aac_sbr_ctx_init)(ac, &ac->che[type][id]->sbr, type); } if (type != TYPE_CCE) { if (*channels >= MAX_CHANNELS - (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1))) { diff --git a/libavcodec/aacsbr.h b/libavcodec/aacsbr.h index 88c4d8a916..dd8b66c7bb 100644 --- a/libavcodec/aacsbr.h +++ b/libavcodec/aacsbr.h @@ -81,7 +81,7 @@ static const int8_t vlc_sbr_lav[10] = /** Initialize SBR. */ void AAC_RENAME(ff_aac_sbr_init)(void); /** Initialize one SBR context. */ -void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr); +void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr, int id_aac); /** Close one SBR context. */ void AAC_RENAME(ff_aac_sbr_ctx_close)(SpectralBandReplication *sbr); /** Decode one SBR element. */ diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c index 511054276a..f8aa4854df 100644 --- a/libavcodec/aacsbr_template.c +++ b/libavcodec/aacsbr_template.c @@ -81,11 +81,12 @@ static void sbr_turnoff(SpectralBandReplication *sbr) { memset(&sbr->spectrum_params, -1, sizeof(SpectrumParameters)); } -av_cold void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr) +av_cold void AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr, int id_aac) { if(sbr->mdct.mdct_bits) return; sbr->kx[0] = sbr->kx[1]; + sbr->id_aac = id_aac; sbr_turnoff(sbr); sbr->data[0].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128); sbr->data[1].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128); |