diff options
author | Martin Storsjo <martin@martin.st> | 2020-11-17 12:51:21 +0200 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2020-11-17 12:56:58 +0200 |
commit | ea21799a7bbee287ab1963acdef0487291820eb0 (patch) | |
tree | 6189f9f077af0b969255fae1445fb27102fd001f | |
parent | 559379e08bb0cf26092a5d3cbbbfe0396792cbad (diff) | |
download | fdk-aac-ea21799a7bbee287ab1963acdef0487291820eb0.tar.gz fdk-aac-ea21799a7bbee287ab1963acdef0487291820eb0.tar.bz2 fdk-aac-ea21799a7bbee287ab1963acdef0487291820eb0.zip |
Revert "Avoid undefined shifts in SATURATE_SHIFT"
This reverts commit 3a831a5fbc990c83e9b5b804a082bb158364e793.
This local fix doesn't seem to be needed any more after the latest
upstream update.
-rw-r--r-- | libFDK/include/scale.h | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/libFDK/include/scale.h b/libFDK/include/scale.h index 0d8db9e..a58614e 100644 --- a/libFDK/include/scale.h +++ b/libFDK/include/scale.h @@ -239,31 +239,20 @@ 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)))) -#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) + : ((LONG)(src) >> (scale))) #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 |