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(-) (limited to 'libAACenc/src') 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 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(-) (limited to 'libAACenc/src') 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 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(+) (limited to 'libAACenc/src') 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: 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(+) (limited to 'libAACenc/src') 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