aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-03 02:00:05 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-09-03 02:18:01 +0200
commit733511fb53fedd3adaaeabc5db9d0b29e71ea1d3 (patch)
tree1ced2f4996f2089d601b7ee7eba18159a329e73d
parent26a0cd1b4b093f3f6e4f15d28a282ec45b87bb98 (diff)
downloadffmpeg-733511fb53fedd3adaaeabc5db9d0b29e71ea1d3.tar.gz
avutil/common: Document FFABS() corner case
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavutil/common.h6
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)