git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
26a0cd1
)
avutil/common: Document FFABS() corner case
author
Michael Niedermayer
<michael@niedermayer.cc>
Thu, 3 Sep 2015 00:00:05 +0000
(
02:00
+0200)
committer
Michael Niedermayer
<michael@niedermayer.cc>
Thu, 3 Sep 2015 00:18:01 +0000
(
02:18
+0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavutil/common.h
patch
|
blob
|
history
diff --git
a/libavutil/common.h
b/libavutil/common.h
index
3e62b6d
..
14343d9
100644
(file)
--- 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)