changeset 11018:5f2c4bcf6e6e libavcodec

Add UMULH() This function/macro returns the high half of the unsigned 64-bit product of two unsigned 32-bit operands.
author mru
date Tue, 26 Jan 2010 18:05:55 +0000
parents aa10bb3c244c
children 62db4d1fdac9
files mathops.h
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mathops.h	Tue Jan 26 17:17:48 2010 +0000
+++ b/mathops.h	Tue Jan 26 18:05:55 2010 +0000
@@ -53,6 +53,12 @@
 }
 #endif
 
+#ifndef UMULH
+static av_always_inline unsigned UMULH(unsigned a, unsigned b){
+    return ((uint64_t)(a) * (uint64_t)(b))>>32;
+}
+#endif
+
 #ifndef MUL64
 #   define MUL64(a,b) ((int64_t)(a) * (int64_t)(b))
 #endif