projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
900479b
)
Add UMULH()
author
Måns Rullgård
<mans@mansr.com>
Tue, 26 Jan 2010 18:05:55 +0000
(18:05 +0000)
committer
Måns Rullgård
<mans@mansr.com>
Tue, 26 Jan 2010 18:05:55 +0000
(18:05 +0000)
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
libavcodec/mathops.h
patch
|
blob
|
history
diff --git
a/libavcodec/mathops.h
b/libavcodec/mathops.h
index
5782459
..
e33f3bf
100644
(file)
--- 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