summaryrefslogtreecommitdiffstats
path: root/libavcodec/dsputil.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-12-21 10:16:22 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-12-21 10:16:22 +0000
commitfebdd0b9b414b2adfe4c3ea2fa06ded2e32e510b (patch)
tree8d2aa283115c22ad6462897ae110b627b531ce81 /libavcodec/dsputil.c
parenta06a18c55dfade76ba5f560d9d8be71951638792 (diff)
downloadffmpeg-streaming-febdd0b9b414b2adfe4c3ea2fa06ded2e32e510b.zip
ffmpeg-streaming-febdd0b9b414b2adfe4c3ea2fa06ded2e32e510b.tar.gz
~15% faster h264_chroma_mc2/4_c() these also prevent some possible out
of array reads. Originally committed as revision 11290 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dsputil.c')
-rw-r--r--libavcodec/dsputil.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c
index e3b5db7..523921e 100644
--- a/libavcodec/dsputil.c
+++ b/libavcodec/dsputil.c
@@ -1440,6 +1440,7 @@ static void OPNAME ## h264_chroma_mc2_c(uint8_t *dst/*align 8*/, uint8_t *src/*a
\
assert(x<8 && y<8 && x>=0 && y>=0);\
\
+ if(D){\
for(i=0; i<h; i++)\
{\
OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
@@ -1447,6 +1448,17 @@ static void OPNAME ## h264_chroma_mc2_c(uint8_t *dst/*align 8*/, uint8_t *src/*a
dst+= stride;\
src+= stride;\
}\
+ }else{\
+ const int E= B+C;\
+ const int step= C ? stride : 1;\
+ for(i=0; i<h; i++)\
+ {\
+ OP(dst[0], (A*src[0] + E*src[step+0]));\
+ OP(dst[1], (A*src[1] + E*src[step+1]));\
+ dst+= stride;\
+ src+= stride;\
+ }\
+ }\
}\
\
static void OPNAME ## h264_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\
@@ -1458,6 +1470,7 @@ static void OPNAME ## h264_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*a
\
assert(x<8 && y<8 && x>=0 && y>=0);\
\
+ if(D){\
for(i=0; i<h; i++)\
{\
OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
@@ -1467,6 +1480,19 @@ static void OPNAME ## h264_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*a
dst+= stride;\
src+= stride;\
}\
+ }else{\
+ const int E= B+C;\
+ const int step= C ? stride : 1;\
+ for(i=0; i<h; i++)\
+ {\
+ OP(dst[0], (A*src[0] + E*src[step+0]));\
+ OP(dst[1], (A*src[1] + E*src[step+1]));\
+ OP(dst[2], (A*src[2] + E*src[step+2]));\
+ OP(dst[3], (A*src[3] + E*src[step+3]));\
+ dst+= stride;\
+ src+= stride;\
+ }\
+ }\
}\
\
static void OPNAME ## h264_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\
OpenPOWER on IntegriCloud