aboutsummaryrefslogtreecommitdiffstats
path: root/fdk-aac/libFDK
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-09-16 10:15:54 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-09-16 10:15:54 +0200
commitac10ac25317d2027e21b1390054e47201e7aec98 (patch)
tree4b1114b5806709d99634c1b1571e3fe1ed0a7417 /fdk-aac/libFDK
parentc9b14925962bf6ca3978dc07bf8db32ada7003c5 (diff)
downloadODR-AudioEnc-ac10ac25317d2027e21b1390054e47201e7aec98.tar.gz
ODR-AudioEnc-ac10ac25317d2027e21b1390054e47201e7aec98.tar.bz2
ODR-AudioEnc-ac10ac25317d2027e21b1390054e47201e7aec98.zip
Update fdk-aac
This corresponds to 9718203 in https://github.com/Opendigitalradio/fdk-aac
Diffstat (limited to 'fdk-aac/libFDK')
-rw-r--r--fdk-aac/libFDK/include/scale.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/fdk-aac/libFDK/include/scale.h b/fdk-aac/libFDK/include/scale.h
index 30fa089..fcfc116 100644
--- a/fdk-aac/libFDK/include/scale.h
+++ b/fdk-aac/libFDK/include/scale.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
@@ -123,7 +123,7 @@ void scaleValues(FIXP_DBL *dst, const FIXP_DBL *src, INT len, INT scalefactor);
#if (SAMPLE_BITS == 16)
void scaleValues(FIXP_PCM *dst, const FIXP_DBL *src, INT len, INT scalefactor);
#endif
-void scaleValues(FIXP_PCM *dst, const FIXP_SGL *src, INT len, INT scalefactor);
+void scaleValues(FIXP_SGL *dst, const FIXP_SGL *src, INT len, INT scalefactor);
void scaleCplxValues(FIXP_DBL *r_dst, FIXP_DBL *i_dst, const FIXP_DBL *r_src,
const FIXP_DBL *i_src, INT len, INT scalefactor);
void scaleValuesWithFactor(FIXP_DBL *vector, FIXP_DBL factor, INT len,
@@ -241,20 +241,31 @@ inline void scaleValueInPlace(FIXP_DBL *value, /*!< Value */
#ifndef SATURATE_RIGHT_SHIFT
#define SATURATE_RIGHT_SHIFT(src, scale, dBits) \
+ (((scale) >= 8*sizeof(LONG)) ? (LONG)0 : \
((((LONG)(src) >> (scale)) > (LONG)(((1U) << ((dBits)-1)) - 1)) \
? (LONG)(((1U) << ((dBits)-1)) - 1) \
: (((LONG)(src) >> (scale)) < ~((LONG)(((1U) << ((dBits)-1)) - 1))) \
? ~((LONG)(((1U) << ((dBits)-1)) - 1)) \
- : ((LONG)(src) >> (scale)))
+ : ((LONG)(src) >> (scale))))
+#endif
+
+#ifndef SATURATE_LEFT_MAX
+#define SATURATE_LEFT_MAX(src, dBits) \
+ (((LONG)(src) > 0) \
+ ? (LONG)(((1U) << ((dBits)-1)) - 1) \
+ : ((LONG)(src) < 0) \
+ ? ~((LONG)(((1U) << ((dBits)-1)) - 1)) \
+ : (LONG)0)
#endif
#ifndef SATURATE_LEFT_SHIFT
#define SATURATE_LEFT_SHIFT(src, scale, dBits) \
+ (((scale) >= 8*sizeof(LONG)) ? SATURATE_LEFT_MAX(src, dBits) : \
(((LONG)(src) > ((LONG)(((1U) << ((dBits)-1)) - 1) >> (scale))) \
? (LONG)(((1U) << ((dBits)-1)) - 1) \
: ((LONG)(src) < ~((LONG)(((1U) << ((dBits)-1)) - 1) >> (scale))) \
? ~((LONG)(((1U) << ((dBits)-1)) - 1)) \
- : ((LONG)(src) << (scale)))
+ : ((LONG)(src) << (scale))))
#endif
#ifndef SATURATE_SHIFT