diff options
Diffstat (limited to 'libAACdec/src')
-rw-r--r-- | libAACdec/src/aacdecoder_lib.cpp | 11 | ||||
-rw-r--r-- | libAACdec/src/channel.cpp | 21 | ||||
-rw-r--r-- | libAACdec/src/channelinfo.h | 4 | ||||
-rw-r--r-- | libAACdec/src/stereo.cpp | 5 |
4 files changed, 21 insertions, 20 deletions
diff --git a/libAACdec/src/aacdecoder_lib.cpp b/libAACdec/src/aacdecoder_lib.cpp index b7ea8df..e62d187 100644 --- a/libAACdec/src/aacdecoder_lib.cpp +++ b/libAACdec/src/aacdecoder_lib.cpp @@ -396,7 +396,8 @@ static INT aacDecoder_SscCallback(void *handle, HANDLE_FDK_BITSTREAM hBs, /* MPS found but invalid or not decodable by this instance */ hAacDecoder->mpsEnableCurr = 0; hAacDecoder->mpsApplicable = 0; - if ((coreCodec == AOT_USAC) || IS_LOWDELAY(coreCodec)) { + if ((coreCodec == AOT_USAC) || (coreCodec == AOT_DRM_USAC) || + IS_LOWDELAY(coreCodec)) { errTp = TRANSPORTDEC_PARSE_ERROR; } else { errTp = TRANSPORTDEC_OK; @@ -1654,14 +1655,14 @@ aacDecoder_DecodeFrame(HANDLE_AACDECODER self, INT_PCM *pTimeData_extern, self->streamInfo.frameSize; for (ch = 0; ch < self->streamInfo.numChannels; ch++) { - int mapValue = FDK_chMapDescr_getMapValue( + UCHAR mapValue = FDK_chMapDescr_getMapValue( &self->mapDescr, (UCHAR)ch, self->chMapIndex); - reverseInChannelMap[mapValue] = ch; + if (mapValue < (8)) reverseInChannelMap[mapValue] = ch; } for (ch = 0; ch < (int)numDrcOutChannels; ch++) { - int mapValue = FDK_chMapDescr_getMapValue( + UCHAR mapValue = FDK_chMapDescr_getMapValue( &self->mapDescr, (UCHAR)ch, numDrcOutChannels); - reverseOutChannelMap[mapValue] = ch; + if (mapValue < (8)) reverseOutChannelMap[mapValue] = ch; } /* The output of SBR and MPS is interleaved. Deinterleaving may be diff --git a/libAACdec/src/channel.cpp b/libAACdec/src/channel.cpp index dbbf58a..cfffd57 100644 --- a/libAACdec/src/channel.cpp +++ b/libAACdec/src/channel.cpp @@ -225,15 +225,18 @@ void CChannelElement_Decode( /* apply intensity stereo */ /* modifies pAacDecoderChannelInfo[]->aSpecSfb */ if (!(flags & (AC_USAC | AC_RSVD50 | AC_RSV603DA))) { - CJointStereo_ApplyIS( - pAacDecoderChannelInfo, - GetScaleFactorBandOffsets(&pAacDecoderChannelInfo[L]->icsInfo, - pSamplingRateInfo), - GetWindowGroupLengthTable(&pAacDecoderChannelInfo[L]->icsInfo), - GetWindowGroups(&pAacDecoderChannelInfo[L]->icsInfo), - GetScaleFactorBandsTransmitted(&pAacDecoderChannelInfo[L]->icsInfo), - pAacDecoderChannelInfo[L]->pDynData->RawDataInfo.CommonWindow ? 1 - : 0); + if ((pAacDecoderChannelInfo[L]->pDynData->RawDataInfo.CommonWindow == + 1) && + (el_channels == 2)) { + CJointStereo_ApplyIS( + pAacDecoderChannelInfo, + GetScaleFactorBandOffsets(&pAacDecoderChannelInfo[L]->icsInfo, + pSamplingRateInfo), + GetWindowGroupLengthTable(&pAacDecoderChannelInfo[L]->icsInfo), + GetWindowGroups(&pAacDecoderChannelInfo[L]->icsInfo), + GetScaleFactorBandsTransmitted( + &pAacDecoderChannelInfo[L]->icsInfo)); + } } } /* maybe_stereo */ diff --git a/libAACdec/src/channelinfo.h b/libAACdec/src/channelinfo.h index 7c95e12..45a288f 100644 --- a/libAACdec/src/channelinfo.h +++ b/libAACdec/src/channelinfo.h @@ -478,15 +478,13 @@ void CJointStereo_ApplyMS( \param pWindowGroupLength pointer to window group length array. \param windowGroups number of window groups. \param scaleFactorBandsTransmitted number of transmitted scalefactor bands. - \param CommonWindow common window bit. \return none */ void CJointStereo_ApplyIS(CAacDecoderChannelInfo *pAacDecoderChannelInfo[2], const short *pScaleFactorBandOffsets, const UCHAR *pWindowGroupLength, const int windowGroups, - const int scaleFactorBandsTransmitted, - const UINT CommonWindow); + const int scaleFactorBandsTransmitted); /* aacdec_pns.cpp */ int CPns_IsPnsUsed(const CPnsData *pPnsData, const int group, const int band); diff --git a/libAACdec/src/stereo.cpp b/libAACdec/src/stereo.cpp index bb4f050..eed826b 100644 --- a/libAACdec/src/stereo.cpp +++ b/libAACdec/src/stereo.cpp @@ -1177,8 +1177,7 @@ void CJointStereo_ApplyIS(CAacDecoderChannelInfo *pAacDecoderChannelInfo[2], const SHORT *pScaleFactorBandOffsets, const UCHAR *pWindowGroupLength, const int windowGroups, - const int scaleFactorBandsTransmitted, - const UINT CommonWindow) { + const int scaleFactorBandsTransmitted) { CJointStereoData *pJointStereoData = &pAacDecoderChannelInfo[L]->pComData->jointStereoData; @@ -1228,7 +1227,7 @@ void CJointStereo_ApplyIS(CAacDecoderChannelInfo *pAacDecoderChannelInfo[2], rightScale[band] = leftScale[band] + msb + 1; - if (CommonWindow && (pJointStereoData->MsUsed[band] & groupMask)) { + if (pJointStereoData->MsUsed[band] & groupMask) { if (CodeBook[band] == INTENSITY_HCB) /* _NOT_ in-phase */ { scale = -scale; |