home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 275 / DPCS0111DVD.ISO / Toolkit / Audio-Visual / VirtualDub / Source / VirtualDub-1.9.10-src.7z / src / Kasumi / h / bitutils.h next >
Encoding:
C/C++ Source or Header  |  2009-09-14  |  600 b   |  27 lines

  1. #ifndef f_VD2_KASUMI_BITUTILS_H
  2. #define f_VD2_KASUMI_BITUTILS_H
  3.  
  4. #include <vd2/system/vdtypes.h>
  5.  
  6. namespace nsVDPixmapBitUtils {
  7.     inline uint32 avg_8888_11(uint32 x, uint32 y) {
  8.         return (x|y) - (((x^y)&0xfefefefe)>>1);
  9.     }
  10.  
  11.     inline uint32 avg_8888_121(uint32 x, uint32 y, uint32 z) {
  12.         return avg_8888_11(avg_8888_11(x,z), y);
  13.     }
  14.  
  15.     inline uint32 avg_0808_14641(uint32 a, uint32 b, uint32 c, uint32 d, uint32 e) {
  16.         a &= 0xff00ff;
  17.         b &= 0xff00ff;
  18.         c &= 0xff00ff;
  19.         d &= 0xff00ff;
  20.         e &= 0xff00ff;
  21.  
  22.         return (((a+e) + 4*(b+d) + 6*c + 0x080008)&0x0ff00ff0)>>4;
  23.     }
  24. };
  25.  
  26. #endif
  27.