Browse Source

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
tags/v0.6
Måns Rullgård 16 years ago
parent
commit
f2c694af28
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavcodec/mathops.h

+ 6
- 0
libavcodec/mathops.h View File

@@ -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


Loading…
Cancel
Save