From f2c694af28c10dcde10aa1f357f2b4e6a6176812 Mon Sep 17 00:00:00 2001 From: Måns Rullgård Date: Tue, 26 Jan 2010 18:05:55 +0000 Subject: 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 --- libavcodec/mathops.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libavcodec/mathops.h') 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 -- cgit v1.2.3