aboutsummaryrefslogtreecommitdiffstats
path: root/libAACenc/src/quantize.cpp
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2016-04-09 05:44:33 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-04-09 05:44:33 +0000
commit4a5a256a01c0f6aa0ebd1b94bba77a70fcac75ee (patch)
tree626b5c026f23b0c8ec4dab155faf86d55cd9d94e /libAACenc/src/quantize.cpp
parent20e8db77ff09cefbe191f1e50815ff8f971a3353 (diff)
parent125815b0ed558c72bb019a2d36c662e5e7f7c030 (diff)
downloadfdk-aac-4a5a256a01c0f6aa0ebd1b94bba77a70fcac75ee.tar.gz
fdk-aac-4a5a256a01c0f6aa0ebd1b94bba77a70fcac75ee.tar.bz2
fdk-aac-4a5a256a01c0f6aa0ebd1b94bba77a70fcac75ee.zip
AAC/SBR encoder improvements am: 46ba367
am: 125815b * commit '125815b0ed558c72bb019a2d36c662e5e7f7c030': AAC/SBR encoder improvements Change-Id: I4ef0a1959666e21ace6086f184302aed640043f6
Diffstat (limited to 'libAACenc/src/quantize.cpp')
-rw-r--r--libAACenc/src/quantize.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/libAACenc/src/quantize.cpp b/libAACenc/src/quantize.cpp
index 5380e35..a74da0e 100644
--- a/libAACenc/src/quantize.cpp
+++ b/libAACenc/src/quantize.cpp
@@ -2,7 +2,7 @@
/* -----------------------------------------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
+© Copyright 1995 - 2015 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
All rights reserved.
1. INTRODUCTION
@@ -104,13 +104,19 @@ amm-info@iis.fraunhofer.de
static void FDKaacEnc_quantizeLines(INT gain,
INT noOfLines,
FIXP_DBL *mdctSpectrum,
- SHORT *quaSpectrum)
+ SHORT *quaSpectrum,
+ INT dZoneQuantEnable)
{
int line;
- FIXP_DBL k = FL2FXCONST_DBL(-0.0946f + 0.5f)>>16;
+ FIXP_DBL k = FL2FXCONST_DBL(0.0f);
FIXP_QTD quantizer = FDKaacEnc_quantTableQ[(-gain)&3];
INT quantizershift = ((-gain)>>2)+1;
+ const INT kShift=16;
+ if (dZoneQuantEnable)
+ k = FL2FXCONST_DBL(0.23f)>>kShift;
+ else
+ k = FL2FXCONST_DBL(-0.0946f + 0.5f)>>kShift;
for (line = 0; line < noOfLines; line++)
{
@@ -263,7 +269,8 @@ void FDKaacEnc_QuantizeSpectrum(INT sfbCnt,
FIXP_DBL *mdctSpectrum,
INT globalGain,
INT *scalefactors,
- SHORT *quantizedSpectrum)
+ SHORT *quantizedSpectrum,
+ INT dZoneQuantEnable)
{
INT sfbOffs,sfb;
@@ -280,7 +287,8 @@ void FDKaacEnc_QuantizeSpectrum(INT sfbCnt,
FDKaacEnc_quantizeLines(globalGain - scalefactor, /* QSS */
sfbOffset[sfbOffs+sfb+1] - sfbOffset[sfbOffs+sfb],
mdctSpectrum + sfbOffset[sfbOffs+sfb],
- quantizedSpectrum + sfbOffset[sfbOffs+sfb]);
+ quantizedSpectrum + sfbOffset[sfbOffs+sfb],
+ dZoneQuantEnable);
}
}
@@ -296,7 +304,8 @@ void FDKaacEnc_QuantizeSpectrum(INT sfbCnt,
FIXP_DBL FDKaacEnc_calcSfbDist(FIXP_DBL *mdctSpectrum,
SHORT *quantSpectrum,
INT noOfLines,
- INT gain
+ INT gain,
+ INT dZoneQuantEnable
)
{
INT i,scale;
@@ -311,7 +320,8 @@ FIXP_DBL FDKaacEnc_calcSfbDist(FIXP_DBL *mdctSpectrum,
FDKaacEnc_quantizeLines(gain,
1,
&mdctSpectrum[i],
- &quantSpectrum[i]);
+ &quantSpectrum[i],
+ dZoneQuantEnable);
if (fAbs(quantSpectrum[i])>MAX_QUANT) {
return FL2FXCONST_DBL(0.0f);