summaryrefslogtreecommitdiffstats
path: root/libAACenc/src
diff options
context:
space:
mode:
Diffstat (limited to 'libAACenc/src')
-rw-r--r--libAACenc/src/aacenc_lib.cpp5
-rw-r--r--libAACenc/src/aacenc_tns.cpp4
-rw-r--r--libAACenc/src/band_nrg.cpp2
-rw-r--r--libAACenc/src/grp_data.cpp8
4 files changed, 12 insertions, 7 deletions
diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp
index cbb0e2a..6cd1f80 100644
--- a/libAACenc/src/aacenc_lib.cpp
+++ b/libAACenc/src/aacenc_lib.cpp
@@ -1599,6 +1599,11 @@ AACENC_ERROR aacEncoder_SetParam(
if (settings->userBitrateMode != value) {
switch ( value ) {
case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
case 8:
settings->userBitrateMode = value;
hAacEncoder->InitFlags |= AACENC_INIT_CONFIG | AACENC_INIT_TRANSPORT;
diff --git a/libAACenc/src/aacenc_tns.cpp b/libAACenc/src/aacenc_tns.cpp
index 933e4e7..fbff424 100644
--- a/libAACenc/src/aacenc_tns.cpp
+++ b/libAACenc/src/aacenc_tns.cpp
@@ -1150,8 +1150,8 @@ static INT FDKaacEnc_AutoToParcor(
for(j=numOfCoeff-i-1; j>=0; j--) {
FIXP_DBL accu1 = fMult(tmp, input[j]);
FIXP_DBL accu2 = fMult(tmp, workBuffer[j]);
- workBuffer[j] += accu1;
- input[j] += accu2;
+ workBuffer[j] = fAddSaturate(workBuffer[j], accu1);
+ input[j] = fAddSaturate(input[j], accu2);
}
workBuffer++;
diff --git a/libAACenc/src/band_nrg.cpp b/libAACenc/src/band_nrg.cpp
index 458aa9c..c672c6c 100644
--- a/libAACenc/src/band_nrg.cpp
+++ b/libAACenc/src/band_nrg.cpp
@@ -267,7 +267,7 @@ FDKaacEnc_CalcBandEnergyOptimShort(const FIXP_DBL *RESTRICT mdctSpectrum,
FIXP_DBL spec = mdctSpectrum[j]<<leadingBits;
tmp = fPow2AddDiv2(tmp, spec);
}
- bandEnergy[i] = tmp<<1;
+ bandEnergy[i] = scaleValueSaturate(tmp, 1);
}
for(i=0; i<numBands; i++)
diff --git a/libAACenc/src/grp_data.cpp b/libAACenc/src/grp_data.cpp
index 03d4976..88a01ba 100644
--- a/libAACenc/src/grp_data.cpp
+++ b/libAACenc/src/grp_data.cpp
@@ -177,7 +177,7 @@ FDKaacEnc_groupShortData(FIXP_DBL *mdctSpectrum, /* in-out
FIXP_DBL thresh = sfbThreshold->Short[wnd][sfb];
for (j=1; j<groupLen[grp]; j++)
{
- thresh += sfbThreshold->Short[wnd+j][sfb];
+ thresh = fAddSaturate(thresh, sfbThreshold->Short[wnd+j][sfb]);
}
sfbThreshold->Long[i++] = thresh;
}
@@ -195,7 +195,7 @@ FDKaacEnc_groupShortData(FIXP_DBL *mdctSpectrum, /* in-out
FIXP_DBL energy = sfbEnergy->Short[wnd][sfb];
for (j=1; j<groupLen[grp]; j++)
{
- energy += sfbEnergy->Short[wnd+j][sfb];
+ energy = fAddSaturate(energy, sfbEnergy->Short[wnd+j][sfb]);
}
sfbEnergy->Long[i++] = energy;
}
@@ -213,7 +213,7 @@ FDKaacEnc_groupShortData(FIXP_DBL *mdctSpectrum, /* in-out
FIXP_DBL energy = sfbEnergyMS->Short[wnd][sfb];
for (j=1; j<groupLen[grp]; j++)
{
- energy += sfbEnergyMS->Short[wnd+j][sfb];
+ energy = fAddSaturate(energy, sfbEnergyMS->Short[wnd+j][sfb]);
}
sfbEnergyMS->Long[i++] = energy;
}
@@ -231,7 +231,7 @@ FDKaacEnc_groupShortData(FIXP_DBL *mdctSpectrum, /* in-out
FIXP_DBL energy = sfbSpreadEnergy->Short[wnd][sfb];
for (j=1; j<groupLen[grp]; j++)
{
- energy += sfbSpreadEnergy->Short[wnd+j][sfb];
+ energy = fAddSaturate(energy, sfbSpreadEnergy->Short[wnd+j][sfb]);
}
sfbSpreadEnergy->Long[i++] = energy;
}