diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-03 02:00:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-12-06 12:40:48 +0100 |
commit | 7ffe708297e900889f6979eee292b766b1f1872a (patch) | |
tree | 704a4e6f9d6676384df97c06a260852b28980afd | |
parent | e5c9396a029322b1a43e24b6dbe1cb2ec76bf0f1 (diff) | |
download | ffmpeg-7ffe708297e900889f6979eee292b766b1f1872a.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 c82a3a6240..a48959d82a 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) |