mirror of https://github.com/mstorsjo/fdk-aac.git
Merge "Fix SATURATE_LEFT_SHIFT_ALT() since it returned 0x80000000 in certain cases" am: 27894057af
am: 86d12efb92
Change-Id: I61e1f526eccf8c6cdf428058ba7b1da4ae2f9a80
This commit is contained in:
commit
232d000173
|
@ -268,11 +268,11 @@ inline void scaleValueInPlace(FIXP_DBL *value, /*!< Value */
|
||||||
* to avoid problems when inverting the sign of the result.
|
* to avoid problems when inverting the sign of the result.
|
||||||
*/
|
*/
|
||||||
#ifndef SATURATE_LEFT_SHIFT_ALT
|
#ifndef SATURATE_LEFT_SHIFT_ALT
|
||||||
#define SATURATE_LEFT_SHIFT_ALT(src, scale, dBits) \
|
#define SATURATE_LEFT_SHIFT_ALT(src, scale, dBits) \
|
||||||
(((LONG)(src) > ((LONG)(((1U) << ((dBits)-1)) - 1) >> (scale))) \
|
(((LONG)(src) > ((LONG)(((1U) << ((dBits)-1)) - 1) >> (scale))) \
|
||||||
? (LONG)(((1U) << ((dBits)-1)) - 1) \
|
? (LONG)(((1U) << ((dBits)-1)) - 1) \
|
||||||
: ((LONG)(src) < ~((LONG)(((1U) << ((dBits)-1)) - 2) >> (scale))) \
|
: ((LONG)(src) <= ~((LONG)(((1U) << ((dBits)-1)) - 1) >> (scale))) \
|
||||||
? ~((LONG)(((1U) << ((dBits)-1)) - 2)) \
|
? ~((LONG)(((1U) << ((dBits)-1)) - 2)) \
|
||||||
: ((LONG)(src) << (scale)))
|
: ((LONG)(src) << (scale)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue