diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2016-04-09 05:44:33 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-04-09 05:44:33 +0000 |
commit | 4a5a256a01c0f6aa0ebd1b94bba77a70fcac75ee (patch) | |
tree | 626b5c026f23b0c8ec4dab155faf86d55cd9d94e /libAACenc/src/psy_main.cpp | |
parent | 20e8db77ff09cefbe191f1e50815ff8f971a3353 (diff) | |
parent | 125815b0ed558c72bb019a2d36c662e5e7f7c030 (diff) | |
download | fdk-aac-4a5a256a01c0f6aa0ebd1b94bba77a70fcac75ee.tar.gz fdk-aac-4a5a256a01c0f6aa0ebd1b94bba77a70fcac75ee.tar.bz2 fdk-aac-4a5a256a01c0f6aa0ebd1b94bba77a70fcac75ee.zip |
AAC/SBR encoder improvements am: 46ba367
am: 125815b
* commit '125815b0ed558c72bb019a2d36c662e5e7f7c030':
AAC/SBR encoder improvements
Change-Id: I4ef0a1959666e21ace6086f184302aed640043f6
Diffstat (limited to 'libAACenc/src/psy_main.cpp')
-rw-r--r-- | libAACenc/src/psy_main.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/libAACenc/src/psy_main.cpp b/libAACenc/src/psy_main.cpp index 3cc9438..446c894 100644 --- a/libAACenc/src/psy_main.cpp +++ b/libAACenc/src/psy_main.cpp @@ -342,6 +342,7 @@ AAC_ENCODER_ERROR FDKaacEnc_psyMainInit(PSY_INTERNAL *hPsy, tnsChannels, LONG_WINDOW, hPsy->granuleLength, + isLowDelay(audioObjectType), (syntaxFlags&AC_SBR_PRESENT)?1:0, &(hPsy->psyConf[0].tnsConf), &hPsy->psyConf[0], @@ -362,6 +363,7 @@ AAC_ENCODER_ERROR FDKaacEnc_psyMainInit(PSY_INTERNAL *hPsy, tnsChannels, SHORT_WINDOW, hPsy->granuleLength, + isLowDelay(audioObjectType), (syntaxFlags&AC_SBR_PRESENT)?1:0, &hPsy->psyConf[1].tnsConf, &hPsy->psyConf[1], @@ -763,7 +765,8 @@ AAC_ENCODER_ERROR FDKaacEnc_psyMain(INT channels, /* Advance psychoacoustics: Tonality and TNS */ if (psyStatic[0]->isLFE) { - tnsData[0]->dataRaw.Long.subBlockInfo.tnsActive = 0; + tnsData[0]->dataRaw.Long.subBlockInfo.tnsActive[HIFILT] = 0; + tnsData[0]->dataRaw.Long.subBlockInfo.tnsActive[LOFILT] = 0; } else { @@ -819,11 +822,15 @@ AAC_ENCODER_ERROR FDKaacEnc_psyMain(INT channels, for(w = 0; w < nWindows[0]; w++) { if (isShortWindow[0]) - tnsActive[w] = tnsData[0]->dataRaw.Short.subBlockInfo[w].tnsActive || - ((channels == 2) ? tnsData[1]->dataRaw.Short.subBlockInfo[w].tnsActive : 0); + tnsActive[w] = tnsData[0]->dataRaw.Short.subBlockInfo[w].tnsActive[HIFILT] || + tnsData[0]->dataRaw.Short.subBlockInfo[w].tnsActive[LOFILT] || + tnsData[channels-1]->dataRaw.Short.subBlockInfo[w].tnsActive[HIFILT] || + tnsData[channels-1]->dataRaw.Short.subBlockInfo[w].tnsActive[LOFILT]; else - tnsActive[w] = tnsData[0]->dataRaw.Long.subBlockInfo.tnsActive || - ((channels == 2) ? tnsData[1]->dataRaw.Long.subBlockInfo.tnsActive : 0); + tnsActive[w] = tnsData[0]->dataRaw.Long.subBlockInfo.tnsActive[HIFILT] || + tnsData[0]->dataRaw.Long.subBlockInfo.tnsActive[LOFILT] || + tnsData[channels-1]->dataRaw.Long.subBlockInfo.tnsActive[HIFILT] || + tnsData[channels-1]->dataRaw.Long.subBlockInfo.tnsActive[LOFILT]; } for(ch = 0; ch < channels; ch++) { @@ -1150,8 +1157,8 @@ AAC_ENCODER_ERROR FDKaacEnc_psyMain(INT channels, psyData[ch]->sfbMaxScaleSpec.Long, sfbTonality[ch], psyOutChannel[ch]->tnsInfo.order[0][0], - tnsData[ch]->dataRaw.Long.subBlockInfo.predictionGain, - tnsData[ch]->dataRaw.Long.subBlockInfo.tnsActive, + tnsData[ch]->dataRaw.Long.subBlockInfo.predictionGain[HIFILT], + tnsData[ch]->dataRaw.Long.subBlockInfo.tnsActive[HIFILT], psyOutChannel[ch]->sfbEnergyLdData, psyOutChannel[ch]->noiseNrg ); } /* !isLFE */ |