diff options
author | Xin Li <delphij@google.com> | 2021-08-14 06:31:12 +0000 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2021-08-14 06:31:12 +0000 |
commit | a950cd990528f07b93cc5af48145e7cb6bfeb3ca (patch) | |
tree | c6a1ddee22e29d9ea00ec2523071a711368189cd /libAACenc | |
parent | 6d10f91a77002b6371ebada491f507ef974ca572 (diff) | |
parent | dcb2d8bd81e4f71007abed9bc89d67580a56b93a (diff) | |
download | fdk-aac-a950cd990528f07b93cc5af48145e7cb6bfeb3ca.tar.gz fdk-aac-a950cd990528f07b93cc5af48145e7cb6bfeb3ca.tar.bz2 fdk-aac-a950cd990528f07b93cc5af48145e7cb6bfeb3ca.zip |
Merge sc-dev-plus-aosp-without-vendor@7634622
Merged-In: I18d2a0819145e1f02c8868674eab081ab243f0a9
Change-Id: Ia7a8fba7d5108dd4281a47b1aa15966bb6eee947
Diffstat (limited to 'libAACenc')
-rw-r--r-- | libAACenc/include/aacenc_lib.h | 4 | ||||
-rw-r--r-- | libAACenc/src/aacenc_lib.cpp | 24 |
2 files changed, 17 insertions, 11 deletions
diff --git a/libAACenc/include/aacenc_lib.h b/libAACenc/include/aacenc_lib.h index 71f7556..f0f23b4 100644 --- a/libAACenc/include/aacenc_lib.h +++ b/libAACenc/include/aacenc_lib.h @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2021 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -1643,7 +1643,7 @@ AACENC_ERROR aacEncEncode(const HANDLE_AACENCODER hAacEncoder, * * \return * - AACENC_OK, on succes. - * - AACENC_INIT_ERROR, on failure. + * - AACENC_INVALID_HANDLE, AACENC_INIT_ERROR, on failure. */ AACENC_ERROR aacEncInfo(const HANDLE_AACENCODER hAacEncoder, AACENC_InfoStruct *pInfo); diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp index 0ae329b..c11db27 100644 --- a/libAACenc/src/aacenc_lib.cpp +++ b/libAACenc/src/aacenc_lib.cpp @@ -1,7 +1,7 @@ /* ----------------------------------------------------------------------------- Software License for The Fraunhofer FDK AAC Codec Library for Android -© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten +© Copyright 1995 - 2021 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. All rights reserved. 1. INTRODUCTION @@ -1242,7 +1242,7 @@ static INT aacenc_SbrCallback(void *self, HANDLE_FDK_BITSTREAM hBs, INT aacenc_SscCallback(void *self, HANDLE_FDK_BITSTREAM hBs, const AUDIO_OBJECT_TYPE coreCodec, const INT samplingRate, const INT frameSize, - const INT stereoConfigIndex, + const INT numChannels, const INT stereoConfigIndex, const INT coreSbrFrameLengthIndex, const INT configBytes, const UCHAR configMode, UCHAR *configChanged) { HANDLE_AACENCODER hAacEncoder = (HANDLE_AACENCODER)self; @@ -1784,8 +1784,8 @@ AACENC_ERROR aacEncEncode(const HANDLE_AACENCODER hAacEncoder, hAacEncoder->nSamplesRead)); INT_PCM *pIn = hAacEncoder->inputBuffer + - (hAacEncoder->inputBufferOffset + hAacEncoder->nSamplesRead) / - hAacEncoder->aacConfig.nChannels; + hAacEncoder->inputBufferOffset / hAacEncoder->aacConfig.nChannels + + hAacEncoder->nSamplesRead / hAacEncoder->extParam.nChannels; newSamples -= (newSamples % hAacEncoder->extParam @@ -1827,12 +1827,13 @@ AACENC_ERROR aacEncEncode(const HANDLE_AACENCODER hAacEncoder, /* clear out until end-of-buffer */ if (nZeros) { + INT_PCM *pIn = + hAacEncoder->inputBuffer + + hAacEncoder->inputBufferOffset / + hAacEncoder->aacConfig.nChannels + + hAacEncoder->nSamplesRead / hAacEncoder->extParam.nChannels; for (i = 0; i < (int)hAacEncoder->extParam.nChannels; i++) { - FDKmemclear(hAacEncoder->inputBuffer + - i * hAacEncoder->inputBufferSizePerChannel + - (hAacEncoder->inputBufferOffset + - hAacEncoder->nSamplesRead) / - hAacEncoder->extParam.nChannels, + FDKmemclear(pIn + i * hAacEncoder->inputBufferSizePerChannel, sizeof(INT_PCM) * nZeros); } hAacEncoder->nZerosAppended += nZeros; @@ -2520,6 +2521,11 @@ AACENC_ERROR aacEncInfo(const HANDLE_AACENCODER hAacEncoder, AACENC_InfoStruct *pInfo) { AACENC_ERROR err = AACENC_OK; + if ((hAacEncoder == NULL) || (pInfo == NULL)) { + err = AACENC_INVALID_HANDLE; + goto bail; + } + FDKmemclear(pInfo, sizeof(AACENC_InfoStruct)); pInfo->confSize = 64; /* pre-initialize */ |