# HG changeset patch # User mru # Date 1264529155 0 # Node ID 5f2c4bcf6e6efca0d3d5aeabf643943bdedd4b18 # Parent aa10bb3c244c24880fd2df1066b6ef02b1e0da42 Add UMULH() This function/macro returns the high half of the unsigned 64-bit product of two unsigned 32-bit operands. diff -r aa10bb3c244c -r 5f2c4bcf6e6e mathops.h --- 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