summaryrefslogtreecommitdiff
path: root/libavcodec/mathops.h
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-01-26 18:05:55 +0000
committerMåns Rullgård <mans@mansr.com>2010-01-26 18:05:55 +0000
commitf2c694af28c10dcde10aa1f357f2b4e6a6176812 (patch)
tree7207e6a8ca2cc3dc738ed04190ce000ba8afe532 /libavcodec/mathops.h
parent900479bb74ad0e472b04cef28c91c3b0fef918c2 (diff)
downloadffmpeg-f2c694af28c10dcde10aa1f357f2b4e6a6176812.tar.gz
Add UMULH()
This function/macro returns the high half of the unsigned 64-bit product of two unsigned 32-bit operands. Originally committed as revision 21463 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mathops.h')
-rw-r--r--libavcodec/mathops.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h
index 5782459080..e33f3bf303 100644
--- a/libavcodec/mathops.h
+++ b/libavcodec/mathops.h
@@ -53,6 +53,12 @@ static av_always_inline int MULH(int a, int b){
}
#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