diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2013-12-30 16:01:08 -0800 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2014-03-31 23:41:44 +0000 |
commit | 603f48ab99ce76f552f4f6f85d06b8c5b94c698e (patch) | |
tree | 303937f6779cdb798e3cec67ebe32abb39eab15b /libAACdec/src/aacdecoder.cpp | |
parent | 629f60c0e71f4a5ad273d5ab3fc6964e5eb1f9f4 (diff) | |
download | fdk-aac-603f48ab99ce76f552f4f6f85d06b8c5b94c698e.tar.gz fdk-aac-603f48ab99ce76f552f4f6f85d06b8c5b94c698e.tar.bz2 fdk-aac-603f48ab99ce76f552f4f6f85d06b8c5b94c698e.zip |
AAC Decoder: introduce time domain limiter
Introduce time domain limiter. The module is per default enabled for all
AAC-LC and HE-AAC v1/2 streams. For all ER-AAC-LD and ER-AAC-ELD streams
the limiter is disabled per default. The feature can be en- or disabled
via dynamic API parameter. Note that the limiter introduces an additional
output delay which depends on the module parameters and the streams
sampling rate.
Bug 9428126
Change-Id: I299a072340b33e2c324facbd347a72c8de3d380e
Diffstat (limited to 'libAACdec/src/aacdecoder.cpp')
-rw-r--r-- | libAACdec/src/aacdecoder.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp index 7903f76..18c9afa 100644 --- a/libAACdec/src/aacdecoder.cpp +++ b/libAACdec/src/aacdecoder.cpp @@ -1653,6 +1653,8 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame( { int stride, offset, c; + /* Turn on/off DRC modules level normalization in digital domain depending on the limiter status. */ + aacDecoder_drcSetParam( self->hDrcInfo, APPLY_NORMALIZATION, (self->limiterEnableCurr) ? 0 : 1 ); /* Extract DRC control data and map it to channels (without bitstream delay) */ aacDecoder_drcProlog ( self->hDrcInfo, @@ -1703,12 +1705,15 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame( /* Reset DRC control data for this channel */ aacDecoder_drcInitChannelData ( &self->pAacDecoderStaticChannelInfo[c]->drcData ); } + /* The DRC module demands to be called with the gain field holding the gain scale. */ + self->extGain[0] = (FIXP_DBL)TDL_GAIN_SCALING; /* DRC processing */ aacDecoder_drcApply ( self->hDrcInfo, self->hSbrDecoder, pAacDecoderChannelInfo, &self->pAacDecoderStaticChannelInfo[c]->drcData, + self->extGain, c, self->streamInfo.aacSamplesPerFrame, self->sbrEnabled @@ -1726,6 +1731,7 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame( (self->frameOK && !(flags&AACDEC_CONCEAL)), self->aacCommonData.workBufferCore1->mdctOutTemp ); + self->extGainDelay = self->streamInfo.aacSamplesPerFrame; break; case AACDEC_RENDER_ELDFB: CBlock_FrequencyToTimeLowDelay( @@ -1735,6 +1741,7 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame( self->streamInfo.aacSamplesPerFrame, stride ); + self->extGainDelay = (self->streamInfo.aacSamplesPerFrame*2 - self->streamInfo.aacSamplesPerFrame/2 - 1)/2; break; default: ErrorStatus = AAC_DEC_UNKNOWN; |