1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

aacsbr: Associate SBR data with AAC elements on init

Quiets some log spam on pure upsampling mode.

Fixes ticket 5163.
This commit is contained in:
Alex Converse 2017-02-09 08:28:30 -08:00
parent 20ea8bf939
commit 3bb24fc344
3 changed files with 4 additions and 3 deletions

View File

@ -134,7 +134,7 @@ static av_cold int che_configure(AACContext *ac,
if (!ac->che[type][id]) { if (!ac->che[type][id]) {
if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement)))) if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
return AVERROR(ENOMEM); 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 (type != TYPE_CCE) {
if (*channels >= MAX_CHANNELS - (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1))) { if (*channels >= MAX_CHANNELS - (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1))) {

View File

@ -81,7 +81,7 @@ static const int8_t vlc_sbr_lav[10] =
/** Initialize SBR. */ /** Initialize SBR. */
void AAC_RENAME(ff_aac_sbr_init)(void); void AAC_RENAME(ff_aac_sbr_init)(void);
/** Initialize one SBR context. */ /** 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. */ /** Close one SBR context. */
void AAC_RENAME(ff_aac_sbr_ctx_close)(SpectralBandReplication *sbr); void AAC_RENAME(ff_aac_sbr_ctx_close)(SpectralBandReplication *sbr);
/** Decode one SBR element. */ /** Decode one SBR element. */

View File

@ -81,11 +81,12 @@ static void sbr_turnoff(SpectralBandReplication *sbr) {
memset(&sbr->spectrum_params, -1, sizeof(SpectrumParameters)); 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) if(sbr->mdct.mdct_bits)
return; return;
sbr->kx[0] = sbr->kx[1]; sbr->kx[0] = sbr->kx[1];
sbr->id_aac = id_aac;
sbr_turnoff(sbr); sbr_turnoff(sbr);
sbr->data[0].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128); 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); sbr->data[1].synthesis_filterbank_samples_offset = SBR_SYNTHESIS_BUF_SIZE - (1280 - 128);