diff options
author | Xin Li <delphij@google.com> | 2020-09-08 16:53:57 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2020-09-08 16:53:57 -0700 |
commit | 7f7e67fe023aa5e479aba0388a7e3fb591bda4e5 (patch) | |
tree | 0e353968c34e8c9699663a9b252836b70847c30b /libAACenc/src/aacenc_lib.cpp | |
parent | 946a672b0f5b8481eb3a429f854fcb34d847d692 (diff) | |
parent | 7a0dde5d5dc4d24095c0391e7fa8297de3c7cd45 (diff) | |
download | fdk-aac-7f7e67fe023aa5e479aba0388a7e3fb591bda4e5.tar.gz fdk-aac-7f7e67fe023aa5e479aba0388a7e3fb591bda4e5.tar.bz2 fdk-aac-7f7e67fe023aa5e479aba0388a7e3fb591bda4e5.zip |
Merge Android R
Bug: 168057903
Merged-In: Idcdb13a8c37b0b4b5446169c3e80dfe55586bc77
Change-Id: I29b7ae1003fb72aeb5fbf1fdfdceea849c1c12b8
Diffstat (limited to 'libAACenc/src/aacenc_lib.cpp')
-rw-r--r-- | libAACenc/src/aacenc_lib.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp index a152c0d..c3977f3 100644 --- a/libAACenc/src/aacenc_lib.cpp +++ b/libAACenc/src/aacenc_lib.cpp @@ -110,7 +110,7 @@ amm-info@iis.fraunhofer.de /* Encoder library info */ #define AACENCODER_LIB_VL0 4 #define AACENCODER_LIB_VL1 0 -#define AACENCODER_LIB_VL2 0 +#define AACENCODER_LIB_VL2 1 #define AACENCODER_LIB_TITLE "AAC Encoder" #ifdef SUPPRESS_BUILD_DATE_INFO #define AACENCODER_LIB_BUILD_DATE "" @@ -446,6 +446,24 @@ static SBR_PS_SIGNALING getSbrSignalingMode( return sbrSignaling; } +static inline INT getAssociatedChElement(SBR_ELEMENT_INFO *elInfoSbr, + CHANNEL_MAPPING *channelMapping) { + ELEMENT_INFO *elInfo = channelMapping->elInfo; + INT nElements = channelMapping->nElements; + INT associatedChElement = -1; + int i; + + for (i = 0; i < nElements; i++) { + if (elInfoSbr->elType == elInfo[i].elType && + elInfoSbr->instanceTag == elInfo[i].instanceTag) { + associatedChElement = i; + break; + } + } + + return associatedChElement; +} + /**************************************************************************** Allocate Encoder ****************************************************************************/ @@ -1921,7 +1939,15 @@ AACENC_ERROR aacEncEncode(const HANDLE_AACENCODER hAacEncoder, { hAacEncoder->extPayload[nExtensions].dataSize = hAacEncoder->pSbrPayload->dataSize[nPayload][i]; - hAacEncoder->extPayload[nExtensions].associatedChElement = i; + hAacEncoder->extPayload[nExtensions].associatedChElement = + getAssociatedChElement( + &hAacEncoder->hEnvEnc->sbrElement[i]->elInfo, + &hAacEncoder->hAacEnc->channelMapping); + if (hAacEncoder->extPayload[nExtensions].associatedChElement == + -1) { + err = AACENC_ENCODE_ERROR; + goto bail; + } } hAacEncoder->extPayload[nExtensions].dataType = EXT_SBR_DATA; /* Once SBR Encoder supports SBR CRC set |