diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2019-01-03 17:05:25 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-01-03 17:05:25 -0800 |
commit | 6d1247f2e235e26635aba13f5758b8ba61e11089 (patch) | |
tree | a405123a71cbc0b139225fc6d41c8a6941631aa2 /libMpegTPDec/src | |
parent | 1ce3f9e135acc3383251751cea3e174a355e1f94 (diff) | |
parent | 4ab4454f2917470e7cc2b4fc0b36c223b3780a5b (diff) | |
download | fdk-aac-6d1247f2e235e26635aba13f5758b8ba61e11089.tar.gz fdk-aac-6d1247f2e235e26635aba13f5758b8ba61e11089.tar.bz2 fdk-aac-6d1247f2e235e26635aba13f5758b8ba61e11089.zip |
Merge "Add AOT specific number of qmf bands sanity check in SpatialSpecificConfig()" am: bcda185d56
am: 4ab4454f29
Change-Id: I0ac3055487ce17f6218e3a0644778a0d8da27119
Diffstat (limited to 'libMpegTPDec/src')
-rw-r--r-- | libMpegTPDec/src/tpdec_asc.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/libMpegTPDec/src/tpdec_asc.cpp b/libMpegTPDec/src/tpdec_asc.cpp index 5270f2b..28bc22d 100644 --- a/libMpegTPDec/src/tpdec_asc.cpp +++ b/libMpegTPDec/src/tpdec_asc.cpp @@ -1413,7 +1413,9 @@ static TRANSPORTDEC_ERROR EldSpecificConfig_Parse(CSAudioSpecificConfig *asc, esc->m_useLdQmfTimeAlign = 1; if (cb->cbSsc != NULL) { ErrorStatus = (TRANSPORTDEC_ERROR)cb->cbSsc( - cb->cbSscData, hBs, asc->m_aot, asc->m_extensionSamplingFrequency, + cb->cbSscData, hBs, asc->m_aot, + asc->m_samplingFrequency << esc->m_sbrSamplingRate, + asc->m_samplesPerFrame << esc->m_sbrSamplingRate, 1, /* stereoConfigIndex */ -1, /* nTimeSlots: read from bitstream */ eldExtLen, asc->configMode, &asc->SacConfigChanged); @@ -1812,9 +1814,16 @@ static TRANSPORTDEC_ERROR UsacRsv60DecoderConfig_Parse( if (usc->element[i].m_stereoConfigIndex > 0) { if (cb->cbSsc != NULL) { + int samplesPerFrame = asc->m_samplesPerFrame; + + if (usc->m_sbrRatioIndex == 1) samplesPerFrame <<= 2; + if (usc->m_sbrRatioIndex == 2) + samplesPerFrame = (samplesPerFrame * 8) / 3; + if (usc->m_sbrRatioIndex == 3) samplesPerFrame <<= 1; + /* Mps212Config() ISO/IEC FDIS 23003-3 */ if (cb->cbSsc(cb->cbSscData, hBs, asc->m_aot, - asc->m_extensionSamplingFrequency, + asc->m_extensionSamplingFrequency, samplesPerFrame, usc->element[i].m_stereoConfigIndex, usc->m_coreSbrFrameLengthIndex, 0, /* don't know the length */ @@ -2181,8 +2190,9 @@ TRANSPORTDEC_ERROR AudioSpecificConfig_Parse( case AOT_MPEGS: if (cb->cbSsc != NULL) { if (cb->cbSsc(cb->cbSscData, bs, self->m_aot, self->m_samplingFrequency, - 1, -1, /* nTimeSlots: read from bitstream */ - 0, /* don't know the length */ + self->m_samplesPerFrame, 1, + -1, /* nTimeSlots: read from bitstream */ + 0, /* don't know the length */ self->configMode, &self->SacConfigChanged)) { return TRANSPORTDEC_UNSUPPORTED_FORMAT; } @@ -2365,10 +2375,17 @@ static TRANSPORTDEC_ERROR Drm_xHEAACDecoderConfig( /*usc->element[elemIdx].m_stereoConfigIndex =*/FDKreadBits(hBs, 2); if (usc->element[elemIdx].m_stereoConfigIndex > 0) { if (cb->cbSsc != NULL) { + int samplesPerFrame = asc->m_samplesPerFrame; + + if (usc->m_sbrRatioIndex == 1) samplesPerFrame <<= 2; + if (usc->m_sbrRatioIndex == 2) + samplesPerFrame = (samplesPerFrame * 8) / 3; + if (usc->m_sbrRatioIndex == 3) samplesPerFrame <<= 1; + ErrorStatus = (TRANSPORTDEC_ERROR)cb->cbSsc( cb->cbSscData, hBs, AOT_DRM_USAC, /* syntax differs from MPEG Mps212Config() */ - asc->m_extensionSamplingFrequency, + asc->m_extensionSamplingFrequency, samplesPerFrame, usc->element[elemIdx].m_stereoConfigIndex, usc->m_coreSbrFrameLengthIndex, 0, /* don't know the length */ asc->configMode, &asc->SacConfigChanged); |