diff options
author | Martin Storsjo <martin@martin.st> | 2012-11-01 11:08:03 +0200 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2012-11-01 11:08:03 +0200 |
commit | 54dfe1ec6972ca0d56dcb671448f84fea5e37e35 (patch) | |
tree | 5d26aa077f3aa32d3e5113546abc5a4219332640 /libSBRdec/src/sbrdecoder.cpp | |
parent | fea3c1d0ffaf5975bb15462e11edf9c7a664890d (diff) | |
parent | 6ab36997af5d5acda4f21d33031f4e45c85f96b7 (diff) | |
download | fdk-aac-dabplus-54dfe1ec6972ca0d56dcb671448f84fea5e37e35.tar.gz fdk-aac-dabplus-54dfe1ec6972ca0d56dcb671448f84fea5e37e35.tar.bz2 fdk-aac-dabplus-54dfe1ec6972ca0d56dcb671448f84fea5e37e35.zip |
Merge remote-tracking branch 'aosp/jb-mr1-release' into master
Conflicts:
libAACenc/src/band_nrg.cpp
libAACenc/src/grp_data.cpp
libSBRenc/src/env_est.cpp
Diffstat (limited to 'libSBRdec/src/sbrdecoder.cpp')
-rw-r--r-- | libSBRdec/src/sbrdecoder.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/libSBRdec/src/sbrdecoder.cpp b/libSBRdec/src/sbrdecoder.cpp index a40e5ba..192bdd2 100644 --- a/libSBRdec/src/sbrdecoder.cpp +++ b/libSBRdec/src/sbrdecoder.cpp @@ -137,7 +137,7 @@ amm-info@iis.fraunhofer.de /* Decoder library info */ #define SBRDECODER_LIB_VL0 2 #define SBRDECODER_LIB_VL1 1 -#define SBRDECODER_LIB_VL2 2 +#define SBRDECODER_LIB_VL2 3 #define SBRDECODER_LIB_TITLE "SBR Decoder" #define SBRDECODER_LIB_BUILD_DATE __DATE__ #define SBRDECODER_LIB_BUILD_TIME __TIME__ @@ -533,7 +533,7 @@ SBR_ERROR sbrDecoder_InitElement ( FDKmemclear(self->pSbrElement[elementIndex]->frameErrorFlag, ((1)+1)*sizeof(UCHAR)); /* Initialize this instance */ - sbrError = sbrDecoder_ResetElement( + sbrError = sbrDecoder_ResetElement( self, sampleRateIn, sampleRateOut, @@ -577,7 +577,7 @@ SBR_ERROR sbrDecoder_HeaderUpdate( ) { SBR_ERROR errorStatus = SBRDEC_OK; - + /* change of control data, reset decoder */ @@ -818,6 +818,7 @@ SBR_ERROR sbrDecoder_drcFeedChannel ( HANDLE_SBRDECODER self, USHORT *pBandTop ) { SBRDEC_DRC_CHANNEL *pSbrDrcChannelData = NULL; + int band, isValidData = 0; if (self == NULL) { return SBRDEC_NOT_INITIALIZED; @@ -826,10 +827,21 @@ SBR_ERROR sbrDecoder_drcFeedChannel ( HANDLE_SBRDECODER self, return SBRDEC_SET_PARAM_FAIL; } + /* Search for gain values different to 1.0f */ + for (band = 0; band < numBands; band += 1) { + if ( !((pNextFact_mag[band] == FL2FXCONST_DBL(0.5)) && (nextFact_exp == 1)) + && !((pNextFact_mag[band] == (FIXP_DBL)MAXVAL_DBL) && (nextFact_exp == 0)) ) { + isValidData = 1; + break; + } + } + /* Find the right SBR channel */ pSbrDrcChannelData = sbrDecoder_drcGetChannel( self, ch ); if ( pSbrDrcChannelData != NULL ) { + if ( pSbrDrcChannelData->enable || isValidData ) + { /* Activate processing only with real and valid data */ int i; pSbrDrcChannelData->enable = 1; @@ -844,6 +856,7 @@ SBR_ERROR sbrDecoder_drcFeedChannel ( HANDLE_SBRDECODER self, pSbrDrcChannelData->nextFact_mag[i] = pNextFact_mag[i]; } } + } return SBRDEC_OK; } |