diff options
author | henry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-04-08 10:31:18 +0000 |
---|---|---|
committer | henry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-04-08 10:31:18 +0000 |
commit | 47f90af3ba4a6c996bdacee54ad5283ccd60b32e (patch) | |
tree | 367801e5a280802791b9fc05e3adb85a32f7c634 /libvo | |
parent | f5fd8bb72ae2aa8865db767948e164b57c293816 (diff) |
support for negative strides (fixes -vf spp,flip crash)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15070 b3059339-0415-0410-9bf9-f77b7e298cf2
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++) |