aboutsummaryrefslogtreecommitdiffstats
path: root/libFDK
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 /libFDK
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 'libFDK')
-rw-r--r--libFDK/include/fixpoint_math.h29
-rw-r--r--libFDK/src/FDK_core.cpp2
2 files changed, 30 insertions, 1 deletions
diff --git a/libFDK/include/fixpoint_math.h b/libFDK/include/fixpoint_math.h
index 88e2f09..0d50f0a 100644
--- a/libFDK/include/fixpoint_math.h
+++ b/libFDK/include/fixpoint_math.h
@@ -94,6 +94,35 @@ amm-info@iis.fraunhofer.de
#include "common_fix.h"
+#if !defined(FUNCTION_fIsLessThan)
+/**
+ * \brief Compares two fixpoint values incl. scaling.
+ * \param a_m mantissa of the first input value.
+ * \param a_e exponent of the first input value.
+ * \param b_m mantissa of the second input value.
+ * \param b_e exponent of the second input value.
+ * \return non-zero if (a_m*2^a_e) < (b_m*2^b_e), 0 otherwise
+ */
+FDK_INLINE INT fIsLessThan(FIXP_DBL a_m, INT a_e, FIXP_DBL b_m, INT b_e)
+{
+ if (a_e > b_e) {
+ return (b_m >> fMin(a_e-b_e, DFRACT_BITS-1) > a_m);
+ } else {
+ return (a_m >> fMin(b_e-a_e, DFRACT_BITS-1) < b_m);
+ }
+}
+
+FDK_INLINE INT fIsLessThan(FIXP_SGL a_m, INT a_e, FIXP_SGL b_m, INT b_e)
+{
+ if (a_e > b_e) {
+ return (b_m >> fMin(a_e-b_e, FRACT_BITS-1) > a_m);
+ } else {
+ return (a_m >> fMin(b_e-a_e, FRACT_BITS-1) < b_m);
+ }
+}
+#endif
+
+
#define LD_DATA_SCALING (64.0f)
#define LD_DATA_SHIFT 6 /* pow(2, LD_DATA_SHIFT) = LD_DATA_SCALING */
diff --git a/libFDK/src/FDK_core.cpp b/libFDK/src/FDK_core.cpp
index 8fa5596..f4b510d 100644
--- a/libFDK/src/FDK_core.cpp
+++ b/libFDK/src/FDK_core.cpp
@@ -93,7 +93,7 @@ amm-info@iis.fraunhofer.de
/* FDK tools library info */
#define FDK_TOOLS_LIB_VL0 2
#define FDK_TOOLS_LIB_VL1 3
-#define FDK_TOOLS_LIB_VL2 4
+#define FDK_TOOLS_LIB_VL2 5
#define FDK_TOOLS_LIB_TITLE "FDK Tools"
#ifdef __ANDROID__
#define FDK_TOOLS_LIB_BUILD_DATE ""