diff options
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/fastmemcpy.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/libvo/fastmemcpy.h b/libvo/fastmemcpy.h index a1a07a2c76..032345bca6 100644 --- a/libvo/fastmemcpy.h +++ b/libvo/fastmemcpy.h @@ -25,7 +25,16 @@ static inline void * mem2agpcpy_pic(void * dst, void * src, int bytesPerLine, in int i; void *retval=dst; - if(dstStride == srcStride) mem2agpcpy(dst, src, srcStride*height); + if(dstStride == srcStride) + { + if (srcStride < 0) { + src += (height-1)*srcStride; + dst += (height-1)*dstStride; + srcStride = -srcStride; + } + + mem2agpcpy(dst, src, srcStride*height); + } else { for(i=0; i<height; i++) @@ -44,7 +53,16 @@ static inline void * memcpy_pic(void * dst, void * src, int bytesPerLine, int he int i; void *retval=dst; - if(dstStride == srcStride) memcpy(dst, src, srcStride*height); + if(dstStride == srcStride) + { + if (srcStride < 0) { + src += (height-1)*srcStride; + dst += (height-1)*dstStride; + srcStride = -srcStride; + } + + memcpy(dst, src, srcStride*height); + } else { for(i=0; i<height; i++) |