diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-03 02:00:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-19 03:51:38 +0100 |
commit | 3311efe2c22900c7a0e4f54a9759c987c089f488 (patch) | |
tree | 7d17cedc8cba849e801385bee28d1340d873e3d8 | |
parent | c23902b6717b9740a73d73699885bb758f6e839b (diff) | |
download | ffmpeg-3311efe2c22900c7a0e4f54a9759c987c089f488.tar.gz |
avutil/common: Document FFABS() corner case
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 733511fb53fedd3adaaeabc5db9d0b29e71ea1d3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavutil/common.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavutil/common.h b/libavutil/common.h index 852c1de850..223895481b 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -58,6 +58,12 @@ : ((a) + (1<<(b)) - 1) >> (b)) #define FFUDIV(a,b) (((a)>0 ?(a):(a)-(b)+1) / (b)) #define FFUMOD(a,b) ((a)-(b)*FFUDIV(a,b)) + +/** + * Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they + * are not representable as absolute values of their type. This is the same + * as with *abs() + */ #define FFABS(a) ((a) >= 0 ? (a) : (-(a))) #define FFSIGN(a) ((a) > 0 ? 1 : -1) |