diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-05-14 23:08:01 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-05-14 23:08:01 +0000 |
commit | d8085ea727f8768c3ef62d988df79cda6c052301 (patch) | |
tree | 896e0b92005e09ccb8ab3b93abc8ff16f0be49f0 /libavcodec/dsputil.h | |
parent | 3bb10888ff7a845efa30fd64d5978a8708db01d7 (diff) | |
download | ffmpeg-d8085ea727f8768c3ef62d988df79cda6c052301.tar.gz |
cleanup
Originally committed as revision 1882 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.h')
-rw-r--r-- | libavcodec/dsputil.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 6f3d897c4b..0060d77dce 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -268,6 +268,18 @@ void dsputil_init(DSPContext* p, AVCodecContext *avctx); */ 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. |