summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-01-23 16:22:33 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-01-26 18:37:12 +0100
commit5dd95670808915b391348624d3f9860e021a81a2 (patch)
tree59a9b3b24fb59fbc79fd29334645fa9089ecc164 /libavutil
parent3c700c82cbee49d1f40b6a7063f4b084ae3ee747 (diff)
avutil/common: Add FFABSU() for a signed -> unsigned ABS
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/common.h8
-rw-r--r--libavutil/version.h4
2 files changed, 10 insertions, 2 deletions
diff --git a/libavutil/common.h b/libavutil/common.h
index b9fbcc4d60..a60a558b1d 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -81,6 +81,14 @@
#define FFNABS(a) ((a) <= 0 ? (a) : (-(a)))
/**
+ * Unsigned Absolute value.
+ * This takes the absolute value of a signed int and returns it as a unsigned.
+ * This also works with INT_MIN which would otherwise not be representable
+ * As with many macros, this evaluates its argument twice.
+ */
+#define FFABSU(a) ((a) <= 0 ? -(unsigned)(a) : (unsigned)(a))
+
+/**
* Comparator.
* For two numerical expressions x and y, gives 1 if x > y, -1 if x < y, and 0
* if x == y. This is useful for instance in a qsort comparator callback.
diff --git a/libavutil/version.h b/libavutil/version.h
index bb8d60bef5..21136e6cb7 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,8 +79,8 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 56
-#define LIBAVUTIL_VERSION_MINOR 63
-#define LIBAVUTIL_VERSION_MICRO 101
+#define LIBAVUTIL_VERSION_MINOR 64
+#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \