comparison libvo/fastmemcpy.h @ 23666:5c3c7efd9b75

Get rid of my_memcpy_pic code duplication in many filters.
author reimar
date Thu, 28 Jun 2007 11:24:12 +0000
parents a124f3abc1ec
children e26d1367fa1d
comparison
equal deleted inserted replaced
23665:88b417d972ab 23666:5c3c7efd9b75
66 } 66 }
67 67
68 return retval; 68 return retval;
69 } 69 }
70 70
71 static inline void * memcpy_pic(void * dst, const void * src, int bytesPerLine, int height, int dstStride, int srcStride) 71 #define memcpy_pic(d, s, b, h, ds, ss) memcpy_pic2(d, s, b, h, ds, ss, 0)
72 #define my_memcpy_pic(d, s, b, h, ds, ss) memcpy_pic2(d, s, b, h, ds, ss, 1)
73
74 /**
75 * \param limit2width always skip data between end of line and start of next
76 * instead of copying the full block when strides are the same
77 */
78 static inline void * memcpy_pic2(void * dst, const void * src,
79 int bytesPerLine, int height,
80 int dstStride, int srcStride, int limit2width)
72 { 81 {
73 int i; 82 int i;
74 void *retval=dst; 83 void *retval=dst;
75 84
76 if(dstStride == srcStride) 85 if(!limit2width && dstStride == srcStride)
77 { 86 {
78 if (srcStride < 0) { 87 if (srcStride < 0) {
79 src = (uint8_t*)src + (height-1)*srcStride; 88 src = (uint8_t*)src + (height-1)*srcStride;
80 dst = (uint8_t*)dst + (height-1)*dstStride; 89 dst = (uint8_t*)dst + (height-1)*dstStride;
81 srcStride = -srcStride; 90 srcStride = -srcStride;