diff dsputil.h @ 1264:2fa34e615c76 libavcodec

cleanup
author michaelni
date Wed, 14 May 2003 23:08:01 +0000
parents e8c3884f2c7e
children 85b71f9f7450
line wrap: on
line diff
--- a/dsputil.h	Wed May 14 22:38:58 2003 +0000
+++ b/dsputil.h	Wed May 14 23:08:01 2003 +0000
@@ -268,6 +268,18 @@
  */
 void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last);
 
+#define	BYTE_VEC32(c)	((c)*0x01010101UL)
+
+static inline uint32_t rnd_avg32(uint32_t a, uint32_t b)
+{
+    return (a | b) - (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
+}
+
+static inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b)
+{
+    return (a & b) + (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
+}
+
 /**
  * Empty mmx state.
  * this must be called between any dsp function and float/double code.