aboutsummaryrefslogtreecommitdiffstats
path: root/libFDK/include/fixpoint_math.h
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-01-16 04:25:38 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-01-16 04:25:38 +0000
commit29c3f50d140d9cb10ed40aa39ce5057bfe1f2f32 (patch)
tree1674c75a501ef638bc0dde91dfc4bd944e5a9735 /libFDK/include/fixpoint_math.h
parentb7b63e5f7902e338fe97d084bed50d467adb9c97 (diff)
parent063d5f30864c6293855da6f7b8dd482d7c408158 (diff)
downloadfdk-aac-29c3f50d140d9cb10ed40aa39ce5057bfe1f2f32.tar.gz
fdk-aac-29c3f50d140d9cb10ed40aa39ce5057bfe1f2f32.tar.bz2
fdk-aac-29c3f50d140d9cb10ed40aa39ce5057bfe1f2f32.zip
Snap for 6138855 from 063d5f30864c6293855da6f7b8dd482d7c408158 to rvc-release
Change-Id: I76b653e2aa437267603833e7fade774c4d210243
Diffstat (limited to 'libFDK/include/fixpoint_math.h')
-rw-r--r--libFDK/include/fixpoint_math.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/libFDK/include/fixpoint_math.h b/libFDK/include/fixpoint_math.h
index 3805892..93aea19 100644
--- a/libFDK/include/fixpoint_math.h
+++ b/libFDK/include/fixpoint_math.h
@@ -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
@@ -545,15 +545,20 @@ inline INT fMultIceil(FIXP_DBL a, INT b) {
m = fMultNorm(a, (FIXP_DBL)b, &m_e);
if (m_e < (INT)0) {
- if (m_e > (INT)-DFRACT_BITS) {
+ if (m_e > (INT) - (DFRACT_BITS - 1)) {
mi = (m >> (-m_e));
if ((LONG)m & ((1 << (-m_e)) - 1)) {
mi = mi + (FIXP_DBL)1;
}
} else {
- mi = (FIXP_DBL)1;
- if (m < (FIXP_DBL)0) {
- mi = (FIXP_DBL)0;
+ if (m > (FIXP_DBL)0) {
+ mi = (FIXP_DBL)1;
+ } else {
+ if ((m_e == -(DFRACT_BITS - 1)) && (m == (FIXP_DBL)MINVAL_DBL)) {
+ mi = (FIXP_DBL)-1;
+ } else {
+ mi = (FIXP_DBL)0;
+ }
}
}
} else {