aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-01-23 04:26:12 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-01-23 04:26:12 +0000
commit3a6eca5c661f7e7596c39aa9e4a5c6763bbef035 (patch)
tree1e8c7295686f97e3b680c299923ef3d22aabb3e0
parent7d1449b89a620a476a47ba3edf140dc9c66115b1 (diff)
parentcedcc475f52dd704497524dda6ec2ef430d2b6c5 (diff)
downloadfdk-aac-3a6eca5c661f7e7596c39aa9e4a5c6763bbef035.tar.gz
fdk-aac-3a6eca5c661f7e7596c39aa9e4a5c6763bbef035.tar.bz2
fdk-aac-3a6eca5c661f7e7596c39aa9e4a5c6763bbef035.zip
Snap for 6154573 from cedcc475f52dd704497524dda6ec2ef430d2b6c5 to rvc-release
Change-Id: I6edb0ebedba940eb136ae37bed4e010ee76f3d58
-rw-r--r--libDRCdec/src/drcGainDec_preprocess.cpp5
-rw-r--r--libFDK/include/fixpoint_math.h2
-rw-r--r--libFDK/src/fixpoint_math.cpp8
3 files changed, 12 insertions, 3 deletions
diff --git a/libDRCdec/src/drcGainDec_preprocess.cpp b/libDRCdec/src/drcGainDec_preprocess.cpp
index c543c53..8d94ace 100644
--- a/libDRCdec/src/drcGainDec_preprocess.cpp
+++ b/libDRCdec/src/drcGainDec_preprocess.cpp
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
+© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -285,6 +285,9 @@ static DRC_ERROR _compressorIO_sigmoid_common(
&e_tmp2);
invExp = fDivNorm(FL2FXCONST_DBL(1.0f / (float)(1 << 1)), exp, &e_invExp);
e_invExp += 1 - 5;
+ if (tmp2 < (FIXP_DBL)0) {
+ return DE_NOT_OK;
+ }
denom = fPow(tmp2, e_tmp2, invExp, e_invExp, &e_denom);
*out = fDivNormSigned(tmp, denom, &e_out);
e_out += 7 - e_denom;
diff --git a/libFDK/include/fixpoint_math.h b/libFDK/include/fixpoint_math.h
index 373eec1..51df4d7 100644
--- a/libFDK/include/fixpoint_math.h
+++ b/libFDK/include/fixpoint_math.h
@@ -775,7 +775,7 @@ FIXP_DBL fPow(FIXP_DBL base_m, INT base_e, FIXP_DBL exp_m, INT exp_e,
/**
* \brief return (base_m * 2^base_e) ^ N
- * \param base_m mantissa of the base
+ * \param base_m mantissa of the base. Must not be negative.
* \param base_e exponent of the base
* \param N power to be calculated of the base
* \param result_e pointer to a INT where the exponent of the result will be
diff --git a/libFDK/src/fixpoint_math.cpp b/libFDK/src/fixpoint_math.cpp
index 6c656fa..1e26420 100644
--- a/libFDK/src/fixpoint_math.cpp
+++ b/libFDK/src/fixpoint_math.cpp
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
+© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -650,6 +650,12 @@ FIXP_DBL fPow(FIXP_DBL base_m, INT base_e, FIXP_DBL exp_m, INT exp_e,
INT ans_lg2_e, baselg2_e;
FIXP_DBL base_lg2, ans_lg2, result;
+ if (base_m <= (FIXP_DBL)0) {
+ result = (FIXP_DBL)0;
+ *result_e = 0;
+ return result;
+ }
+
/* Calc log2 of base */
base_lg2 = fLog2(base_m, base_e, &baselg2_e);