diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-03 02:00:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-12 02:55:46 +0100 |
commit | ab3f129011710d308846d072365c4678a84d76bd (patch) | |
tree | 0d4f2479b8f06dc2ef7234abdb0f6f6342cdacd5 | |
parent | ab91919e57d28eabdb7fadbe5938ee0d33d744e4 (diff) | |
download | ffmpeg-ab3f129011710d308846d072365c4678a84d76bd.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 3e62b6d5b7..14343d977b 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) |