From 2504f6043487ec9c4664efea0229c07c867a53f4 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Wed, 6 Apr 2016 08:53:36 -0700 Subject: Remove redundant parentheses around == comparison operator Bug: 28026175 Change-Id: I61be1ab98d7279d09250ea4b810c5f31886da048 --- libSBRenc/src/sbr_encoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libSBRenc/src/sbr_encoder.cpp b/libSBRenc/src/sbr_encoder.cpp index 86a3f91..71aab78 100644 --- a/libSBRenc/src/sbr_encoder.cpp +++ b/libSBRenc/src/sbr_encoder.cpp @@ -1939,7 +1939,7 @@ INT sbrEncoder_Init( - if ( (aot==AOT_PS) ) { + if ( aot==AOT_PS ) { usePs = 1; } if ( aot==AOT_ER_AAC_ELD ) { -- cgit v1.2.3 From 2fc642731f78c042c4b67f4cd877619994fe3c65 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Tue, 23 Aug 2016 10:25:28 -0700 Subject: Fix build warning Bug: 28026175 Change-Id: Ie8d84f694fcb788e5fb8780b11fa07bb98097ce0 --- libAACenc/src/adj_thr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libAACenc/src/adj_thr.cpp b/libAACenc/src/adj_thr.cpp index a79a9ae..09584f4 100644 --- a/libAACenc/src/adj_thr.cpp +++ b/libAACenc/src/adj_thr.cpp @@ -958,7 +958,7 @@ static FIXP_DBL FDKaacEnc_calcChaosMeasure(PSY_OUT_CHANNEL *psyOutChannel, CalcInvLdData( (((CalcLdData(frameFormFactor)>>1) - (CalcLdData(frameEnergy)>>(2+1))) - (fMultDiv2(FL2FXCONST_DBL(0.75f),CalcLdData((FIXP_DBL)frameNLines<<(DFRACT_BITS-1-SCALE_NLINES))) - - (((FIXP_DBL)(SCALE_FORM_FAC-SCALE_NRGS_SQRT4+FORM_FAC_SHIFT-(SCALE_NLINES_P34))<<(DFRACT_BITS-1-LD_DATA_SHIFT))>>1)) + (((FIXP_DBL)(-((-SCALE_FORM_FAC+SCALE_NRGS_SQRT4-FORM_FAC_SHIFT+SCALE_NLINES_P34) << (DFRACT_BITS-1-LD_DATA_SHIFT))))>>1)) )<<1 ); } else { -- cgit v1.2.3 From 86e949c0768dc49b7215d41062be8274f7c9dca6 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Mon, 5 Jun 2017 10:09:41 -0700 Subject: Add OWNERS in external/aac Owners are selected from top CL approvals or owners. They will be suggested to review/approve future CLs. Test: build/make/tools/checkowners.py -c -v OWNERS Change-Id: Iacb2e068189b39030a218b6496ca41a0bd4ce7d2 --- OWNERS | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 OWNERS diff --git a/OWNERS b/OWNERS new file mode 100644 index 0000000..ffd753e --- /dev/null +++ b/OWNERS @@ -0,0 +1,2 @@ +jmtrivi@google.com +gkasten@android.com -- cgit v1.2.3 From ecb2ad9a7b72b9fe96720c59289e5ccd9bf0f433 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Thu, 3 Aug 2017 12:51:43 +0300 Subject: Check that all channel mapping entries used are valid If channel numbers are changed on the fly (in invalid bitstreams), we can end up with a channel mapping with fewer channels mapped than we actually try to output. Ideally, this condition should probably be checked somewhere closer to where it enters such a state, not when using the channel mapping though. Fixes: 2808/clusterfuzz-testcase-minimized-4694952892170240 Fixes: 2275/clusterfuzz-testcase-minimized-6205444085252096 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg --- libSBRdec/src/sbrdecoder.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libSBRdec/src/sbrdecoder.cpp b/libSBRdec/src/sbrdecoder.cpp index f9ded54..766d7e9 100644 --- a/libSBRdec/src/sbrdecoder.cpp +++ b/libSBRdec/src/sbrdecoder.cpp @@ -1444,6 +1444,9 @@ sbrDecoder_DecodeElement ( self->flags |= (applyPs) ? SBRDEC_PS_DECODED : 0; } + if (channelMapping[0] == 255 || channelMapping[1] == 255) + return SBRDEC_UNSUPPORTED_CONFIG; + /* Set strides for reading and writing */ if (interleaved) { strideIn = numInChannels; -- cgit v1.2.3 From 52c2660c26beaaccf903759c18bb758e9f18a470 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Thu, 3 Aug 2017 13:47:15 +0300 Subject: Make sure at least one bit exists before reading further in FDKreadBit Fixes: 2709/clusterfuzz-testcase-minimized-6160249369133056 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg --- libFDK/include/FDK_bitstream.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libFDK/include/FDK_bitstream.h b/libFDK/include/FDK_bitstream.h index d47a750..19bc864 100644 --- a/libFDK/include/FDK_bitstream.h +++ b/libFDK/include/FDK_bitstream.h @@ -277,11 +277,15 @@ FDK_INLINE UINT FDKreadBit(HANDLE_FDK_BITSTREAM hBitStream) hBitStream->CacheWord = FDK_get32 (&hBitStream->hBitBuf); hBitStream->BitsInCache = CACHE_BITS; } - else + else if (validBits > 0) { hBitStream->CacheWord = FDK_get (&hBitStream->hBitBuf,validBits); hBitStream->BitsInCache = validBits; } + else + { + return 0; + } } hBitStream->BitsInCache--; -- cgit v1.2.3 From ee6d9476a656195460c903bde741e96be4220660 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Thu, 3 Aug 2017 13:59:22 +0300 Subject: Check for heightLayer out of range Alternatively, the bits read in CProgramConfig_ReadHeightExt could be checked right there instead. Fixes: 2802/clusterfuzz-testcase-minimized-6752357788418048 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg --- libMpegTPDec/src/tpdec_asc.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libMpegTPDec/src/tpdec_asc.cpp b/libMpegTPDec/src/tpdec_asc.cpp index 96a1b35..a292bcb 100644 --- a/libMpegTPDec/src/tpdec_asc.cpp +++ b/libMpegTPDec/src/tpdec_asc.cpp @@ -650,6 +650,8 @@ int CProgramConfig_LookupElement( /* search in front channels */ for (i = 0; i < pPce->NumFrontChannelElements; i++) { int heightLayer = pPce->FrontElementHeightInfo[i]; + if (heightLayer >= PC_NUM_HEIGHT_LAYER) + return 0; if (isCpe == pPce->FrontElementIsCpe[i] && pPce->FrontElementTagSelect[i] == tag) { int h, elIdx = ec[heightLayer], chIdx = cc[heightLayer]; AUDIO_CHANNEL_TYPE aChType = (AUDIO_CHANNEL_TYPE)((heightLayer<<4) | ACT_FRONT); @@ -704,6 +706,8 @@ int CProgramConfig_LookupElement( /* search in side channels */ for (i = 0; i < pPce->NumSideChannelElements; i++) { int heightLayer = pPce->SideElementHeightInfo[i]; + if (heightLayer >= PC_NUM_HEIGHT_LAYER) + return 0; if (isCpe == pPce->SideElementIsCpe[i] && pPce->SideElementTagSelect[i] == tag) { int h, elIdx = ec[heightLayer], chIdx = cc[heightLayer]; AUDIO_CHANNEL_TYPE aChType = (AUDIO_CHANNEL_TYPE)((heightLayer<<4) | ACT_SIDE); @@ -758,6 +762,8 @@ int CProgramConfig_LookupElement( /* search in back channels */ for (i = 0; i < pPce->NumBackChannelElements; i++) { int heightLayer = pPce->BackElementHeightInfo[i]; + if (heightLayer >= PC_NUM_HEIGHT_LAYER) + return 0; if (isCpe == pPce->BackElementIsCpe[i] && pPce->BackElementTagSelect[i] == tag) { int h, elIdx = ec[heightLayer], chIdx = cc[heightLayer]; AUDIO_CHANNEL_TYPE aChType = (AUDIO_CHANNEL_TYPE)((heightLayer<<4) | ACT_BACK); @@ -817,18 +823,24 @@ int CProgramConfig_LookupElement( Start with counting the front channels/elements at normal height */ for (i = 0; i < pPce->NumFrontChannelElements; i+=1) { int heightLayer = pPce->FrontElementHeightInfo[i]; + if (heightLayer >= PC_NUM_HEIGHT_LAYER) + return 0; ec[heightLayer] += 1; cc[heightLayer] += (pPce->FrontElementIsCpe[i]) ? 2 : 1; } /* Count side channels/elements at normal height */ for (i = 0; i < pPce->NumSideChannelElements; i+=1) { int heightLayer = pPce->SideElementHeightInfo[i]; + if (heightLayer >= PC_NUM_HEIGHT_LAYER) + return 0; ec[heightLayer] += 1; cc[heightLayer] += (pPce->SideElementIsCpe[i]) ? 2 : 1; } /* Count back channels/elements at normal height */ for (i = 0; i < pPce->NumBackChannelElements; i+=1) { int heightLayer = pPce->BackElementHeightInfo[i]; + if (heightLayer >= PC_NUM_HEIGHT_LAYER) + return 0; ec[heightLayer] += 1; cc[heightLayer] += (pPce->BackElementIsCpe[i]) ? 2 : 1; } -- cgit v1.2.3 From a4aa860efb3b3ff2d535a4af45457e888aefa85e Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Mon, 7 Aug 2017 13:12:02 +0900 Subject: Make software codecs as VNDK Software codecs and their dependencies are marked as VNDK (or just vendor_available:true for static/header libs). Bug: 37343418 Test: build the software codecs with BOARD_VNDK_VERSION=current Change-Id: I9ecedb5a95abc9978ff7ed3538bd2dedec750c7d --- Android.bp | 1 + 1 file changed, 1 insertion(+) diff --git a/Android.bp b/Android.bp index 75fe8af..daad82c 100644 --- a/Android.bp +++ b/Android.bp @@ -1,5 +1,6 @@ cc_library_static { name: "libFraunhoferAAC", + vendor_available: true, srcs: [ "libAACdec/src/*.cpp", "libAACenc/src/*.cpp", -- cgit v1.2.3 From 393a86c0dbffdf741e44b84e6a88eb1c2138073d Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Tue, 15 Aug 2017 14:57:37 +0300 Subject: Check that pSettings is initialized Fixes: 2872/clusterfuzz-testcminimized-4529959869612032 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg --- libSBRdec/src/sbrdecoder.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libSBRdec/src/sbrdecoder.cpp b/libSBRdec/src/sbrdecoder.cpp index 766d7e9..7d9468c 100644 --- a/libSBRdec/src/sbrdecoder.cpp +++ b/libSBRdec/src/sbrdecoder.cpp @@ -1446,6 +1446,10 @@ sbrDecoder_DecodeElement ( if (channelMapping[0] == 255 || channelMapping[1] == 255) return SBRDEC_UNSUPPORTED_CONFIG; + if (!pSbrChannel[0]->SbrDec.LppTrans.pSettings) + return SBRDEC_UNSUPPORTED_CONFIG; + if (stereo && !pSbrChannel[1]->SbrDec.LppTrans.pSettings) + return SBRDEC_UNSUPPORTED_CONFIG; /* Set strides for reading and writing */ if (interleaved) { -- cgit v1.2.3 From 1244b257ee7ec7d56f021a5c2e39e2c04881a148 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Tue, 15 Aug 2017 16:36:05 +0300 Subject: Always feed more input data when possible for ADTS This fixes cases where an ADTS header could set numberOfRawDataBlocks to a number larger than 1, which would lead to transportDec_FillData not feeding any more data, even though the input buffer was depleted. Fixes: 3014/clusterfuzz-testcase-5425740193464320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg --- libMpegTPDec/src/tpdec_lib.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libMpegTPDec/src/tpdec_lib.cpp b/libMpegTPDec/src/tpdec_lib.cpp index 24f755b..09f0703 100644 --- a/libMpegTPDec/src/tpdec_lib.cpp +++ b/libMpegTPDec/src/tpdec_lib.cpp @@ -342,9 +342,7 @@ TRANSPORTDEC_ERROR transportDec_FillData( } } else { /* ... else feed bitbuffer with new stream data (append). */ - if (hTp->numberOfRawDataBlocks <= 0) { - FDKfeedBuffer (hBs, pBuffer, bufferSize, pBytesValid) ; - } + FDKfeedBuffer (hBs, pBuffer, bufferSize, pBytesValid); } return TRANSPORTDEC_OK; -- cgit v1.2.3 From 963b1891562e930a7d997215e700ef5ec5b4461e Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 18 Aug 2017 22:33:37 +0300 Subject: Enhance TNS tuning for 8 kHz audio sampling rate This tuning has been suggested by Fraunhofer, fixing overflows in encoding certain sequences. --- libAACenc/src/aacenc_tns.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libAACenc/src/aacenc_tns.cpp b/libAACenc/src/aacenc_tns.cpp index 9a07e8f..5fcd309 100644 --- a/libAACenc/src/aacenc_tns.cpp +++ b/libAACenc/src/aacenc_tns.cpp @@ -388,7 +388,7 @@ AAC_ENCODER_ERROR FDKaacEnc_InitTnsConfiguration(INT bitRate, switch (granuleLength) { case 1024: /* TNS start line: skip lower MDCT lines to prevent artifacts due to filter mismatch */ - tC->lpcStartBand[LOFILT] = (blockType == SHORT_WINDOW) ? 0 : ((sampleRate < 18783) ? 4 : 8); + tC->lpcStartBand[LOFILT] = (blockType == SHORT_WINDOW) ? 0 : ((sampleRate <= 8000) ? 2 : ((sampleRate < 18783) ? 4 : 8)); tC->lpcStartLine[LOFILT] = pC->sfbOffset[tC->lpcStartBand[LOFILT]]; i = tC->lpcStopBand; -- cgit v1.2.3 From a3d11689433a046ad57add8ea22dedceb2fe722d Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 18 Aug 2017 22:37:30 +0300 Subject: Adjust the fix for infinite loops with a drained ADTS stream This should have less risk of causing other issues. --- libMpegTPDec/src/tpdec_lib.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libMpegTPDec/src/tpdec_lib.cpp b/libMpegTPDec/src/tpdec_lib.cpp index 09f0703..5760752 100644 --- a/libMpegTPDec/src/tpdec_lib.cpp +++ b/libMpegTPDec/src/tpdec_lib.cpp @@ -342,7 +342,9 @@ TRANSPORTDEC_ERROR transportDec_FillData( } } else { /* ... else feed bitbuffer with new stream data (append). */ - FDKfeedBuffer (hBs, pBuffer, bufferSize, pBytesValid); + if ((hTp->numberOfRawDataBlocks <= 0) || (FDKgetValidBits(hBs)==0)) { + FDKfeedBuffer (hBs, pBuffer, bufferSize, pBytesValid) ; + } } return TRANSPORTDEC_OK; -- cgit v1.2.3 From e2e35b82738dc9d5e5229477d49d557cadad4dc7 Mon Sep 17 00:00:00 2001 From: Doug Benedict Date: Wed, 20 Sep 2017 14:30:42 -0700 Subject: Make sure there are enough bits when reading ADTS header. --- libMpegTPDec/src/tpdec_adts.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libMpegTPDec/src/tpdec_adts.cpp b/libMpegTPDec/src/tpdec_adts.cpp index c455681..934fbc8 100644 --- a/libMpegTPDec/src/tpdec_adts.cpp +++ b/libMpegTPDec/src/tpdec_adts.cpp @@ -185,6 +185,9 @@ TRANSPORTDEC_ERROR adtsRead_DecodeHeader( #endif valBits = FDKgetValidBits(hBs); + if (valBits < ADTS_HEADERLENGTH) { + return TRANSPORTDEC_NOT_ENOUGH_BITS; + } /* adts_fixed_header */ bs.mpeg_id = FDKreadBits(hBs, Adts_Length_Id); -- cgit v1.2.3 From 3e8a17c1c1a7bed415b033734e9ac4a5dd7673d1 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Wed, 27 Sep 2017 10:17:29 -0700 Subject: Use -Werror in external/aac Bug: 66996870 Test: build with WITH_TIDY=1 Exempt-From-Owner-Approval: Colin +2 should be the owner approval Change-Id: I167f73ee9dc5e977fd6976f48732ae1e1fe13c8b --- Android.bp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Android.bp b/Android.bp index 75fe8af..0ae0b84 100644 --- a/Android.bp +++ b/Android.bp @@ -12,6 +12,8 @@ cc_library_static { "libSBRenc/src/*.cpp", ], cflags: [ + "-Werror", + "-Wno-constant-conversion", "-Wno-sequence-point", "-Wno-extra", "-Wno-#warnings", -- cgit v1.2.3 From c366b3db8fd78013edc5968df8507473b6fa71e6 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 20 Oct 2017 15:36:53 +0300 Subject: Add tighter sanity checks in CBlock_GetEscape We can't read 31 bits of value here, since that would place the topmost bit in the sign bit. Fixes: 3480/clusterfuzz-testcase-4573445423628288 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg --- libAACdec/src/block.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libAACdec/src/block.cpp b/libAACdec/src/block.cpp index bda565c..8bee2d4 100644 --- a/libAACdec/src/block.cpp +++ b/libAACdec/src/block.cpp @@ -138,7 +138,7 @@ LONG CBlock_GetEscape(HANDLE_FDK_BITSTREAM bs, /*!< pointer to bitstream */ if (i > 16) { - if (i - 16 > CACHE_BITS) { /* cannot read more than "CACHE_BITS" bits at once in the function FDKreadBits() */ + if (i >= 31) { /* (1 << i) will shift into the sign bit if i >= 31 */ return (MAX_QUANTIZED_VALUE + 1); /* returning invalid value that will be captured later */ } -- cgit v1.2.3 From cf697df5ad1495f167181dec0976ee228bec6378 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 20 Oct 2017 16:05:02 +0300 Subject: Avoid reading out of bounds due to negative aaIccIndexMapped Fixes: 3452/clusterfuzz-testcase-4898065225875456 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg --- libSBRdec/src/psdec.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libSBRdec/src/psdec.cpp b/libSBRdec/src/psdec.cpp index 965917a..88a79a4 100644 --- a/libSBRdec/src/psdec.cpp +++ b/libSBRdec/src/psdec.cpp @@ -944,7 +944,7 @@ void initSlotBasedRotation( HANDLE_PS_DEC h_ps_d, /*!< pointer to the module sta FIXP_SGL invL; FIXP_DBL ScaleL, ScaleR; - FIXP_DBL Alpha, Beta; + FIXP_DBL Alpha, Beta, AlphasValue; FIXP_DBL h11r, h12r, h21r, h22r; const FIXP_DBL *PScaleFactors; @@ -1015,8 +1015,11 @@ void initSlotBasedRotation( HANDLE_PS_DEC h_ps_d, /*!< pointer to the module sta ScaleR = PScaleFactors[noIidSteps + h_ps_d->specificTo.mpeg.coef.aaIidIndexMapped[env][bin]]; ScaleL = PScaleFactors[noIidSteps - h_ps_d->specificTo.mpeg.coef.aaIidIndexMapped[env][bin]]; - Beta = fMult (fMult( Alphas[h_ps_d->specificTo.mpeg.coef.aaIccIndexMapped[env][bin]], ( ScaleR - ScaleL )), FIXP_SQRT05); - Alpha = Alphas[h_ps_d->specificTo.mpeg.coef.aaIccIndexMapped[env][bin]]>>1; + AlphasValue = 0; + if (h_ps_d->specificTo.mpeg.coef.aaIccIndexMapped[env][bin] >= 0) + AlphasValue = Alphas[h_ps_d->specificTo.mpeg.coef.aaIccIndexMapped[env][bin]]; + Beta = fMult (fMult( AlphasValue, ( ScaleR - ScaleL )), FIXP_SQRT05); + Alpha = AlphasValue>>1; /* Alpha and Beta are now both scaled by 2 shifts right */ -- cgit v1.2.3 From 1e3515e03e2dbdbd48dacc31ef75d25c201a4c51 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Mon, 30 Oct 2017 23:06:44 +0200 Subject: Fix an assertion failure (avoid division by zero) when encoding a particular input --- libAACenc/src/aacenc_tns.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libAACenc/src/aacenc_tns.cpp b/libAACenc/src/aacenc_tns.cpp index 5fcd309..3026d69 100644 --- a/libAACenc/src/aacenc_tns.cpp +++ b/libAACenc/src/aacenc_tns.cpp @@ -1147,6 +1147,9 @@ static INT FDKaacEnc_AutoToParcor( workBuffer++; } + if (input[0] == 0) + input[0] = 1; + tmp = fMult((FIXP_DBL)((LONG)TNS_PREDGAIN_SCALE<<21), fDivNorm(fAbs(autoCorr_0), fAbs(input[0]), &scale)); if ( fMultDiv2(autoCorr_0, input[0]) Date: Mon, 20 Nov 2017 12:35:32 +0200 Subject: Avoid reading out of bounds due to too large aaIidIndexMapped Fixes: 4151/clusterfuzz-testcase-4854089193095168 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg --- libSBRdec/src/psdec.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libSBRdec/src/psdec.cpp b/libSBRdec/src/psdec.cpp index 88a79a4..1729f90 100644 --- a/libSBRdec/src/psdec.cpp +++ b/libSBRdec/src/psdec.cpp @@ -938,7 +938,7 @@ void initSlotBasedRotation( HANDLE_PS_DEC h_ps_d, /*!< pointer to the module sta INT group = 0; INT bin = 0; - INT noIidSteps; + INT noIidSteps, noFactors; /* const UCHAR *pQuantizedIIDs;*/ @@ -984,6 +984,7 @@ void initSlotBasedRotation( HANDLE_PS_DEC h_ps_d, /*!< pointer to the module sta { PScaleFactors = ScaleFactorsFine; /* values are shiftet right by one */ noIidSteps = NO_IID_STEPS_FINE; + noFactors = NO_IID_LEVELS_FINE; /*pQuantizedIIDs = quantizedIIDsFine;*/ } @@ -991,6 +992,7 @@ void initSlotBasedRotation( HANDLE_PS_DEC h_ps_d, /*!< pointer to the module sta { PScaleFactors = ScaleFactors; /* values are shiftet right by one */ noIidSteps = NO_IID_STEPS; + noFactors = NO_IID_LEVELS; /*pQuantizedIIDs = quantizedIIDs;*/ } @@ -1012,8 +1014,11 @@ void initSlotBasedRotation( HANDLE_PS_DEC h_ps_d, /*!< pointer to the module sta /* ScaleR and ScaleL are scaled by 1 shift right */ - ScaleR = PScaleFactors[noIidSteps + h_ps_d->specificTo.mpeg.coef.aaIidIndexMapped[env][bin]]; - ScaleL = PScaleFactors[noIidSteps - h_ps_d->specificTo.mpeg.coef.aaIidIndexMapped[env][bin]]; + ScaleL = ScaleR = 0; + if (noIidSteps + h_ps_d->specificTo.mpeg.coef.aaIidIndexMapped[env][bin] >= 0 && noIidSteps + h_ps_d->specificTo.mpeg.coef.aaIidIndexMapped[env][bin] < noFactors) + ScaleR = PScaleFactors[noIidSteps + h_ps_d->specificTo.mpeg.coef.aaIidIndexMapped[env][bin]]; + if (noIidSteps - h_ps_d->specificTo.mpeg.coef.aaIidIndexMapped[env][bin] >= 0 && noIidSteps - h_ps_d->specificTo.mpeg.coef.aaIidIndexMapped[env][bin] < noFactors) + ScaleL = PScaleFactors[noIidSteps - h_ps_d->specificTo.mpeg.coef.aaIidIndexMapped[env][bin]]; AlphasValue = 0; if (h_ps_d->specificTo.mpeg.coef.aaIccIndexMapped[env][bin] >= 0) -- cgit v1.2.3 From 1b0cec288c5a0867ee0c008cd5a846facb72a524 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Wed, 20 Dec 2017 10:21:34 +0200 Subject: Fix an assertion failure when encoding a particular input at specific bitrates --- libAACenc/src/sf_estim.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libAACenc/src/sf_estim.cpp b/libAACenc/src/sf_estim.cpp index 1cb243b..75b8d42 100644 --- a/libAACenc/src/sf_estim.cpp +++ b/libAACenc/src/sf_estim.cpp @@ -533,6 +533,7 @@ static void FDKaacEnc_assimilateSingleScf(PSY_OUT_CHANNEL *psyOutChan, (scfAct > scfMin) && (scfAct <= scfMin+MAX_SCF_DELTA) && (scfAct >= scfMax-MAX_SCF_DELTA) && + (scfAct <= fixMin(scfMin,fixMin(*scfLast, *scfNext))+MAX_SCF_DELTA) && (*scfLast != prevScfLast[sfbAct] || *scfNext != prevScfNext[sfbAct] || deltaPe < deltaPeLast[sfbAct])) { -- cgit v1.2.3 From 89aeea5f292306c429550e4c9fe55d865c903600 Mon Sep 17 00:00:00 2001 From: ezicomezigo Date: Wed, 20 Dec 2017 18:25:56 +0900 Subject: Fix SBR multichannel noise for 5.1 ch, the channel elements are as follows: SCE - CPE - CPE - LFE and the channel-mapping table for 5.1 ch is : { 2, 0, 1, 4, 5, 3,255,255}, /* 5.1ch */ For the last LFE channel, sbr decoder returns error, SBRDEC_UNSUPPORTED_CONFIG; --- libSBRdec/src/sbrdecoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libSBRdec/src/sbrdecoder.cpp b/libSBRdec/src/sbrdecoder.cpp index 7d9468c..a341746 100644 --- a/libSBRdec/src/sbrdecoder.cpp +++ b/libSBRdec/src/sbrdecoder.cpp @@ -1444,7 +1444,7 @@ sbrDecoder_DecodeElement ( self->flags |= (applyPs) ? SBRDEC_PS_DECODED : 0; } - if (channelMapping[0] == 255 || channelMapping[1] == 255) + if (channelMapping[0] == 255 || ((*numOutChannels == 2) && channelMapping[1] == 255)) return SBRDEC_UNSUPPORTED_CONFIG; if (!pSbrChannel[0]->SbrDec.LppTrans.pSettings) return SBRDEC_UNSUPPORTED_CONFIG; -- cgit v1.2.3 From 54da05eb397725f93754094392f2772892a847db Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Tue, 6 Mar 2018 12:29:40 +0200 Subject: Update the list of extra files for "make dist" --- Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 5b2c65b..1ee2dfc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -188,7 +188,8 @@ EXTRA_DIST = \ $(top_srcdir)/autogen.sh \ $(top_srcdir)/MODULE_LICENSE_FRAUNHOFER \ $(top_srcdir)/NOTICE \ - $(top_srcdir)/Android.mk \ + $(top_srcdir)/OWNERS \ + $(top_srcdir)/Android.bp \ $(top_srcdir)/fdk-aac.sym \ $(top_srcdir)/Makefile.vc \ $(top_srcdir)/documentation/*.pdf \ -- cgit v1.2.3 From 5891b75b311c8fb27706cc2128a49d10dc477dca Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Tue, 6 Mar 2018 12:35:43 +0200 Subject: Fix warnings with MSVC about mismatch between signed and unsigned in a header --- libFDK/include/FDK_bitstream.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libFDK/include/FDK_bitstream.h b/libFDK/include/FDK_bitstream.h index 19bc864..e75e570 100644 --- a/libFDK/include/FDK_bitstream.h +++ b/libFDK/include/FDK_bitstream.h @@ -245,7 +245,7 @@ FDK_INLINE UINT FDKreadBits(HANDLE_FDK_BITSTREAM hBitStream, if (hBitStream->BitsInCache <= numberOfBits) { - const UINT validBits = FDK_getValidBits (&hBitStream->hBitBuf) ; + const INT validBits = FDK_getValidBits (&hBitStream->hBitBuf) ; const INT freeBits = (CACHE_BITS-1) - hBitStream->BitsInCache ; const INT bitsToRead = (freeBits <= validBits) ? freeBits : validBits ; @@ -309,7 +309,7 @@ inline UINT FDKread2Bits(HANDLE_FDK_BITSTREAM hBitStream) UINT BitsInCache = hBitStream->BitsInCache; if (BitsInCache < 2) /* Comparison changed from 'less-equal' to 'less' */ { - const UINT validBits = FDK_getValidBits (&hBitStream->hBitBuf) ; + const INT validBits = FDK_getValidBits (&hBitStream->hBitBuf) ; const INT freeBits = (CACHE_BITS-1) - BitsInCache ; const INT bitsToRead = (freeBits <= validBits) ? freeBits : validBits ; -- cgit v1.2.3 From a30bfced6b6d6d976c728552d247cb30dd86e238 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Tue, 6 Mar 2018 12:22:48 +0200 Subject: Bump the versions and add a changelog entry for v0.1.6 --- ChangeLog | 4 ++++ configure.ac | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b544ece..a36902f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +0.1.6 + - Lots of minor assorted crash/fuzz fixes, mostly for the decoder but + also some for the encoder + 0.1.5 - Updated upstream sources - Fixed building with GCC 3.3 and 3.4 diff --git a/configure.ac b/configure.ac index 1485ff7..86a9102 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl -*- Autoconf -*- dnl Process this file with autoconf to produce a configure script. -AC_INIT([fdk-aac], [0.1.5], [http://sourceforge.net/projects/opencore-amr/]) +AC_INIT([fdk-aac], [0.1.6], [http://sourceforge.net/projects/opencore-amr/]) AC_CONFIG_AUX_DIR(.) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([tar-ustar foreign]) @@ -26,7 +26,7 @@ AC_SEARCH_LIBS([sin], [m]) dnl soname version to use dnl goes by ‘current[:revision[:age]]’ with the soname ending up as dnl current.age.revision -FDK_AAC_VERSION=1:0:0 +FDK_AAC_VERSION=1:1:0 AS_IF([test x$enable_shared = xyes], [LIBS_PRIVATE=$LIBS], [LIBS_PUBLIC=$LIBS]) AC_SUBST(FDK_AAC_VERSION) -- cgit v1.2.3