aboutsummaryrefslogtreecommitdiffstats
path: root/libAACenc/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-03-07 14:27:17 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-03-07 14:27:17 +0100
commit3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552 (patch)
tree66307d4c7722477b8add1f133a84da311bb99470 /libAACenc/src
parent89639e36b29a622c641c3de3a4737a4c848dc365 (diff)
parenta30bfced6b6d6d976c728552d247cb30dd86e238 (diff)
downloadfdk-aac-3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552.tar.gz
fdk-aac-3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552.tar.bz2
fdk-aac-3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552.zip
Merge branch 'mstorjo/master' into dabplusHEADv0.1.6-dabdabplus
Diffstat (limited to 'libAACenc/src')
-rw-r--r--libAACenc/src/aacenc_tns.cpp5
-rw-r--r--libAACenc/src/adj_thr.cpp2
-rw-r--r--libAACenc/src/sf_estim.cpp1
3 files changed, 6 insertions, 2 deletions
diff --git a/libAACenc/src/aacenc_tns.cpp b/libAACenc/src/aacenc_tns.cpp
index d0ff6ac..f036518 100644
--- a/libAACenc/src/aacenc_tns.cpp
+++ b/libAACenc/src/aacenc_tns.cpp
@@ -409,7 +409,7 @@ AAC_ENCODER_ERROR FDKaacEnc_InitTnsConfiguration(INT bitRate,
case 960:
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;
@@ -1168,6 +1168,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])<FL2FXCONST_DBL(0.0f) ) {
tmp = -tmp;
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 {
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])) {